X-Git-Url: https://scripts.mit.edu/gitweb/autoinstallsdev/mediawiki.git/blobdiff_plain/19e297c21b10b1b8a3acad5e73fc71dcb35db44a..6932310fd58ebef145fa01eb76edf7150284d8ea:/vendor/oojs/oojs-ui/php/layouts/PanelLayout.php diff --git a/vendor/oojs/oojs-ui/php/layouts/PanelLayout.php b/vendor/oojs/oojs-ui/php/layouts/PanelLayout.php new file mode 100644 index 00000000..83ad87c9 --- /dev/null +++ b/vendor/oojs/oojs-ui/php/layouts/PanelLayout.php @@ -0,0 +1,61 @@ + false, + 'padded' => false, + 'expanded' => true, + 'framed' => false, + ], $config ); + + // Parent constructor + parent::__construct( $config ); + + // Initialization + $this->addClasses( [ 'oo-ui-panelLayout' ] ); + if ( $config['scrollable'] ) { + $this->addClasses( [ 'oo-ui-panelLayout-scrollable' ] ); + } + if ( $config['padded'] ) { + $this->addClasses( [ 'oo-ui-panelLayout-padded' ] ); + } + if ( $config['expanded'] ) { + $this->addClasses( [ 'oo-ui-panelLayout-expanded' ] ); + } + if ( $config['framed'] ) { + $this->addClasses( [ 'oo-ui-panelLayout-framed' ] ); + } + } + public function getConfig( &$config ) { + if ( $this->hasClass( 'oo-ui-panelLayout-scrollable' ) ) { + $config['scrollable'] = true; + } + if ( $this->hasClass( 'oo-ui-panelLayout-padded' ) ) { + $config['padded'] = true; + } + if ( !$this->hasClass( 'oo-ui-panelLayout-expanded' ) ) { + $config['expanded'] = false; + } + if ( $this->hasClass( 'oo-ui-panelLayout-framed' ) ) { + $config['framed'] = true; + } + $config['content'] = $this->content; + return parent::getConfig( $config ); + } +}