Make a sidebar key with value false mean 'skip this header'.
[lhc/web/wiklou.git] / skins / Modern.php
index 1871adf..9b85064 100644 (file)
@@ -21,12 +21,12 @@ class SkinModern extends SkinTemplate {
        var $skinname = 'modern', $stylename = 'modern',
                $template = 'ModernTemplate', $useHeadElement = true;
 
+       /**
+        * @param $out OutputPage
+        */
        function setupSkinUserCss( OutputPage $out ){
-               // Do not call parent::setupSkinUserCss(), we have our own print style
-               $out->addStyle( 'common/shared.css', 'screen' );
-               $out->addStyle( 'modern/main.css', 'screen' );
-               $out->addStyle( 'modern/print.css', 'print' );
-               $out->addStyle( 'modern/rtl.css', 'screen', '', 'rtl' );
+               parent::setupSkinUserCss( $out );
+               $out->addModuleStyles ('skins.modern');
        }
 }
 
@@ -35,6 +35,10 @@ class SkinModern extends SkinTemplate {
  * @ingroup Skins
  */
 class ModernTemplate extends MonoBookTemplate {
+
+       /**
+        * @var Skin
+        */
        var $skin;
        /**
         * Template filter callback for Modern skin.
@@ -45,9 +49,7 @@ class ModernTemplate extends MonoBookTemplate {
         * @access private
         */
        function execute() {
-               global $wgRequest;
                $this->skin = $skin = $this->data['skin'];
-               $action = $wgRequest->getText( 'action' );
 
                // Suppress warnings to prevent notices about missing indexes in $this->data
                wfSuppressWarnings();
@@ -61,27 +63,7 @@ class ModernTemplate extends MonoBookTemplate {
        <div id="mw_main">
        <div id="mw_contentwrapper">
        <!-- navigation portlet -->
-       <div id="p-cactions" class="portlet">
-               <h5><?php $this->msg('views') ?></h5>
-               <div class="pBody">
-                       <ul>
-       <?php           foreach($this->data['content_actions'] as $key => $tab) {
-                                       echo '
-                                <li id="' . Sanitizer::escapeId( "ca-$key" ) . '"';
-                                       if( $tab['class'] ) {
-                                               echo ' class="'.htmlspecialchars($tab['class']).'"';
-                                       }
-                                       echo'><a href="'.htmlspecialchars($tab['href']).'"';
-                                       if( isset($tab["tooltiponly"]) && $tab["tooltiponly"] ) {
-                                               echo $skin->tooltip( "ca-$key" );
-                                       } else {
-                                               echo $skin->tooltipAndAccesskey( "ca-$key" );
-                                       }
-                                       echo '>'.htmlspecialchars($tab['text']).'</a></li>';
-                               } ?>
-                       </ul>
-               </div>
-       </div>
+<?php $this->cactions( $skin ); ?>
 
        <!-- content -->
        <div id="mw_content">
@@ -106,6 +88,8 @@ class ModernTemplate extends MonoBookTemplate {
                <?php if($this->data['showjumplinks']) { ?><div id="jump-to-nav"><?php $this->msg('jumpto') ?> <a href="#mw_portlets"><?php $this->msg('jumptonavigation') ?></a>, <a href="#searchInput"><?php $this->msg('jumptosearch') ?></a></div><?php } ?>
 
                <?php $this->html('bodytext') ?>
+               <?php if($this->data['printfooter']) { ?><div class="printfooter"><?php $this->html('printfooter'); ?></div><?php } ?>
+               <?php $this->html('debughtml'); ?>
                <div class='mw_clear'></div>
                <?php if($this->data['catlinks']) { $this->html('catlinks'); } ?>
                <?php $this->html ('dataAfterContent') ?>
@@ -116,24 +100,7 @@ class ModernTemplate extends MonoBookTemplate {
        <div id="mw_portlets"<?php $this->html("userlangattributes") ?>>
 
        <!-- portlets -->
-       <?php
-               $sidebar = $this->data['sidebar'];
-               if ( !isset( $sidebar['SEARCH'] ) ) $sidebar['SEARCH'] = true;
-               if ( !isset( $sidebar['TOOLBOX'] ) ) $sidebar['TOOLBOX'] = true;
-               if ( !isset( $sidebar['LANGUAGES'] ) ) $sidebar['LANGUAGES'] = true;
-
-               foreach ($sidebar as $boxName => $cont) {
-                       if ( $boxName == 'SEARCH' ) {
-                               $this->searchBox();
-                       } elseif ( $boxName == 'TOOLBOX' ) {
-                               $this->toolbox();
-                       } elseif ( $boxName == 'LANGUAGES' ) {
-                               $this->languageBox();
-                       } else {
-                               $this->customBox( $boxName, $cont );
-                       }
-               }
-       ?>
+       <?php $this->renderPortals( $this->data['sidebar'] ); ?>
 
        </div><!-- mw_portlets -->