Fix Bug #31547 - Category links need less spacing and better wrapping
[lhc/web/wiklou.git] / skins / MonoBook.php
index be6f495..00507e7 100644 (file)
@@ -31,21 +31,16 @@ class SkinMonoBook extends SkinTemplate {
                parent::setupSkinUserCss( $out );
 
                $out->addModuleStyles( 'skins.monobook' );
-               
+
                // Ugh. Can't do this properly because $wgHandheldStyle may be a URL
                if( $wgHandheldStyle ) {
                        // Currently in testing... try 'chick/main.css'
                        $out->addStyle( $wgHandheldStyle, 'handheld' );
                }
-               
-               // TODO: Migrate all of these
-               //$out->addStyle( 'monobook/IE50Fixes.css', 'screen', 'lt IE 5.5000' );
-               //$out->addStyle( 'monobook/IE55Fixes.css', 'screen', 'IE 5.5000' );
-               //$out->addStyle( 'monobook/IE60Fixes.css', 'screen', 'IE 6' );
-               //$out->addStyle( 'monobook/IE70Fixes.css', 'screen', 'IE 7' );
 
-               // TODO: migrate
-               //$out->addStyle( 'monobook/rtl.css', 'screen', '', 'rtl' );
+               // TODO: Migrate all of these
+               $out->addStyle( 'monobook/IE60Fixes.css', 'screen', 'IE 6' );
+               $out->addStyle( 'monobook/IE70Fixes.css', 'screen', 'IE 7' );
 
        }
 }
@@ -56,11 +51,6 @@ class SkinMonoBook extends SkinTemplate {
  */
 class MonoBookTemplate extends BaseTemplate {
 
-       /**
-        * @var Skin
-        */
-       var $skin;
-
        /**
         * Template filter callback for MonoBook skin.
         * Takes an associative array of data set from a SkinTemplate-based
@@ -70,19 +60,17 @@ class MonoBookTemplate extends BaseTemplate {
         * @access private
         */
        function execute() {
-               $this->skin = $this->data['skin'];
-
                // Suppress warnings to prevent notices about missing indexes in $this->data
                wfSuppressWarnings();
 
                $this->html( 'headelement' );
 ?><div id="globalWrapper">
-<div id="column-content"><div id="content"<?php $this->html("specialpageattributes") ?>>
+<div id="column-content"><div id="content">
        <a id="top"></a>
        <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
 
        <h1 id="firstHeading" class="firstHeading"><?php $this->html('title') ?></h1>
-       <div id="bodyContent">
+       <div id="bodyContent" class="mw-body">
                <div id="siteSub"><?php $this->msg('tagline') ?></div>
                <div id="contentSub"<?php $this->html('userlangattributes') ?>><?php $this->html('subtitle') ?></div>
 <?php if($this->data['undelete']) { ?>
@@ -90,12 +78,10 @@ class MonoBookTemplate extends BaseTemplate {
 <?php } ?><?php if($this->data['newtalk'] ) { ?>
                <div class="usermessage"><?php $this->html('newtalk')  ?></div>
 <?php } ?><?php if($this->data['showjumplinks']) { ?>
-               <div id="jump-to-nav"><?php $this->msg('jumpto') ?> <a href="#column-one"><?php $this->msg('jumptonavigation') ?></a>, <a href="#searchInput"><?php $this->msg('jumptosearch') ?></a></div>
+               <div id="jump-to-nav" class="mw-jump"><?php $this->msg('jumpto') ?> <a href="#column-one"><?php $this->msg('jumptonavigation') ?></a>, <a href="#searchInput"><?php $this->msg('jumptosearch') ?></a></div>
 <?php } ?>
                <!-- start content -->
 <?php $this->html('bodytext') ?>
-               <?php if($this->data['printfooter']) { ?><div class="printfooter"><?php $this->html('printfooter'); ?></div><?php } ?>
-               <?php $this->html('debughtml'); ?>
                <?php if($this->data['catlinks']) { $this->html('catlinks'); } ?>
                <!-- end content -->
                <?php if($this->data['dataAfterContent']) { $this->html ('dataAfterContent'); } ?>
@@ -103,7 +89,7 @@ class MonoBookTemplate extends BaseTemplate {
        </div>
 </div></div>
 <div id="column-one"<?php $this->html('userlangattributes')  ?>>
-<?php $this->cactions( $this->skin ); ?>
+<?php $this->cactions(); ?>
        <div class="portlet" id="p-personal">
                <h5><?php $this->msg('personaltools') ?></h5>
                <div class="pBody">
@@ -116,12 +102,11 @@ class MonoBookTemplate extends BaseTemplate {
                </div>
        </div>
        <div class="portlet" id="p-logo">
-               <?php
-                       $logoAttribs = array() + Linker::tooltipAndAccesskeyAttribs('p-logo');
-                       $logoAttribs['style'] = "background-image: url({$this->data['logopath']});";
-                       $logoAttribs['href'] = $this->data['nav_urls']['mainpage']['href'];
-                       echo Html::element( 'a', $logoAttribs );
-               ?>
+<?php
+                       echo Html::element( 'a', array(
+                               'href' => $this->data['nav_urls']['mainpage']['href'],
+                               'style' => "background-image: url({$this->data['logopath']});" )
+                               + Linker::tooltipAndAccesskeyAttribs('p-logo') ); ?>
 
        </div>
        <script type="<?php $this->text('jsmimetype') ?>"> if (window.isMSIE55) fixalpha(); </script>
@@ -144,7 +129,7 @@ class MonoBookTemplate extends BaseTemplate {
        foreach ( $validFooterIcons as $blockName => $footerIcons ) { ?>
        <div id="f-<?php echo htmlspecialchars($blockName); ?>ico">
 <?php foreach ( $footerIcons as $icon ) { ?>
-               <?php echo $this->skin->makeFooterIcon( $icon ); ?>
+               <?php echo $this->getSkin()->makeFooterIcon( $icon ); ?>
 
 <?php }
 ?>
@@ -225,32 +210,15 @@ echo $footerEnd;
         *
         * @param $skin Skin
         */
-       function cactions( Skin $skin ) {
+       function cactions() {
 ?>
        <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) {
-                                       $linkAttribs = array( 'href' => $tab['href'] );
-                                       
-                                       if( isset( $tab["tooltiponly"] ) && $tab["tooltiponly"] ) {
-                                               $title = Linker::titleAttrib( "ca-$key" );
-                                               if ( $title !== false ) {
-                                                       $linkAttribs['title'] = $title;
-                                               }
-                                       } else {
-                                               $linkAttribs += Linker::tooltipAndAccesskeyAttribs( "ca-$key" );
-                                       }
-                                       $linkHtml = Html::element( 'a', $linkAttribs, $tab['text'] );
-                                       
-                                       /* Surround with a <li> */
-                                       $liAttribs = array( 'id' => Sanitizer::escapeId( "ca-$key" ) );
-                                       if( $tab['class'] ) {
-                                               $liAttribs['class'] = $tab['class'];
-                                       }
-                                       echo '
-                               ' . Html::rawElement( 'li', $liAttribs, $linkHtml );
+                                       echo '
+                               ' . $this->makeListItem( $key, $tab );
                                } ?>
 
                        </ul>
@@ -272,7 +240,7 @@ echo $footerEnd;
 <?php
                }
                wfRunHooks( 'MonoBookTemplateToolboxEnd', array( &$this ) );
-               wfRunHooks( 'SkinTemplateToolboxEnd', array( &$this ) );
+               wfRunHooks( 'SkinTemplateToolboxEnd', array( &$this, true ) );
 ?>
                        </ul>
                </div>