Directionality improvements as part of bug 6100 (under $wgBetterDirectionality):
[lhc/web/wiklou.git] / skins / MonoBook.php
index 061f4f6..a766e94 100644 (file)
@@ -23,6 +23,9 @@ class SkinMonoBook extends SkinTemplate {
        var $skinname = 'monobook', $stylename = 'monobook',
                $template = 'MonoBookTemplate', $useHeadElement = true;
 
+       /**
+        * @param $out OutputPage
+        */
        function setupSkinUserCss( OutputPage $out ) {
                global $wgHandheldStyle;
                parent::setupSkinUserCss( $out );
@@ -52,7 +55,12 @@ class SkinMonoBook extends SkinTemplate {
  * @ingroup Skins
  */
 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
@@ -86,6 +94,8 @@ class MonoBookTemplate extends BaseTemplate {
 <?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'); } ?>
@@ -107,7 +117,7 @@ class MonoBookTemplate extends BaseTemplate {
        </div>
        <div class="portlet" id="p-logo">
                <?php
-                       $logoAttribs = array() + $skin->tooltipAndAccesskeyAttribs('p-logo');
+                       $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 );
@@ -134,8 +144,18 @@ class MonoBookTemplate extends BaseTemplate {
 ?>
 </div><!-- end of the left (by default at least) column -->
 <div class="visualClear"></div>
+<?php
+       $validFooterIcons = $this->getFooterIcons( "icononly" );
+       $validFooterLinks = $this->getFooterLinks( "flat" ); // Additional footer links
+
+       if ( count( $validFooterIcons ) + count( $validFooterLinks ) > 0 ) { ?>
 <div id="footer"<?php $this->html('userlangattributes') ?>>
-<?php foreach ( $this->getFooterIcons("icononly") as $blockName => $footerIcons ) { ?>
+<?php
+               $footerEnd = '</div>';
+       } else {
+               $footerEnd = '';
+       }
+       foreach ( $validFooterIcons as $blockName => $footerIcons ) { ?>
        <div id="f-<?php echo htmlspecialchars($blockName); ?>ico">
 <?php foreach ( $footerIcons as $icon ) { ?>
                <?php echo $this->skin->makeFooterIcon( $icon ); ?>
@@ -145,21 +165,19 @@ class MonoBookTemplate extends BaseTemplate {
        </div>
 <?php }
 
-               // Generate additional footer links
-               $validFooterLinks = $this->getFooterLinks("flat");
                if ( count( $validFooterLinks ) > 0 ) {
 ?>     <ul id="f-list">
 <?php
                        foreach( $validFooterLinks as $aLink ) { ?>
                <li id="<?php echo $aLink ?>"><?php $this->html($aLink) ?></li>
-
 <?php
                        }
 ?>
        </ul>
 <?php  }
+echo $footerEnd;
 ?>
-</div>
+
 </div>
 <?php
                $this->printTrail();
@@ -196,6 +214,8 @@ class MonoBookTemplate extends BaseTemplate {
        /**
         * Prints the cactions bar.
         * Shared between MonoBook and Modern
+        *
+        * @param $skin Skin
         */
        function cactions( Skin $skin ) {
 ?>
@@ -207,12 +227,12 @@ class MonoBookTemplate extends BaseTemplate {
                                        $linkAttribs = array( 'href' => $tab['href'] );
                                        
                                        if( isset( $tab["tooltiponly"] ) && $tab["tooltiponly"] ) {
-                                               $title = $skin->titleAttrib( "ca-$key" );
+                                               $title = Linker::titleAttrib( "ca-$key" );
                                                if ( $title !== false ) {
                                                        $linkAttribs['title'] = $title;
                                                }
                                        } else {
-                                               $linkAttribs += $skin->tooltipAndAccesskeyAttribs( "ca-$key" );
+                                               $linkAttribs += Linker::tooltipAndAccesskeyAttribs( "ca-$key" );
                                        }
                                        $linkHtml = Html::element( 'a', $linkAttribs, $tab['text'] );
                                        
@@ -274,14 +294,14 @@ class MonoBookTemplate extends BaseTemplate {
        /*************************************************************************************************/
        function customBox( $bar, $cont ) {
                $portletAttribs = array( 'class' => 'generated-sidebar portlet', 'id' => Sanitizer::escapeId( "p-$bar" ) );
-               $tooltip = $this->skin->titleAttrib( "p-$bar" );
+               $tooltip = Linker::titleAttrib( "p-$bar" );
                if ( $tooltip !== false ) {
                        $portletAttribs['title'] = $tooltip;
                }
                echo '  ' . Html::openElement( 'div', $portletAttribs );
 ?>
 
-               <h5><?php $out = wfMsg( $bar ); if (wfEmptyMsg($bar, $out)) echo htmlspecialchars($bar); else echo htmlspecialchars($out); ?></h5>
+               <h5><?php $msg = wfMessage( $bar ); echo htmlspecialchars( $msg->exists() ? $msg->text() : $bar ); ?></h5>
                <div class='pBody'>
 <?php   if ( is_array( $cont ) ) { ?>
                        <ul>