Merge "(bug 37195) Doc fix. $from and $until are arrays since 1.17."
[lhc/web/wiklou.git] / skins / CologneBlue.php
index 84042c3..56c6b08 100644 (file)
@@ -71,8 +71,6 @@ class CologneBlueTemplate extends BaseTemplate {
        /**
         * Language/charset variant links for classic-style skins
         * @return string
-        *
-        * @fixed
         */
        function variantLinks() {
                $s = array();
@@ -86,7 +84,6 @@ class CologneBlueTemplate extends BaseTemplate {
                return $this->getSkin()->getLanguage()->pipeList( $s );
        }
 
-       // @fixed
        function otherLanguages() {
                global $wgHideInterlanguageLinks;
                if ( $wgHideInterlanguageLinks ) {
@@ -110,7 +107,6 @@ class CologneBlueTemplate extends BaseTemplate {
                        . $this->getSkin()->getLanguage()->pipeList( $s );
        }
 
-       // @fixed
        function pageTitleLinks() {
                $s = array();
                $footlinks = $this->getFooterLinks();
@@ -130,7 +126,6 @@ class CologneBlueTemplate extends BaseTemplate {
         * @param $message string Key of the message to use in place of standard text
         *
         * @return string
-        * @fixed
         */
        function processBottomLink( $key, $navlink, $message=null ) {
                if ( !$navlink ) {
@@ -145,7 +140,6 @@ class CologneBlueTemplate extends BaseTemplate {
                return $this->makeListItem( $key, $this->processNavlinkForDocument( $navlink ), array( 'tag' => 'span' ) );
        }
 
-       // @fixed
        function bottomLinks() {
                $toolbox = $this->getToolbox();
                $content_nav = $this->data['content_navigation'];
@@ -197,7 +191,6 @@ class CologneBlueTemplate extends BaseTemplate {
                return implode( array_filter( $lines ), "<br />\n" ) . "<br />\n";
        }
 
-       // @fixed
        function talkLink() {
                $title = $this->getSkin()->getTitle();
 
@@ -271,25 +264,19 @@ class CologneBlueTemplate extends BaseTemplate {
 
        /**
         * @return string
-        *
-        * @fixed
         */
        function beforeContent() {
                ob_start();
 ?>
 <div id="content">
        <div id="topbar">
-               <p id="sitetitle">
+               <p id="sitetitle" role="banner">
                        <a href="<?php echo htmlspecialchars( $this->data['nav_urls']['mainpage']['href'] ) ?>">
                                <?php echo wfMessage( 'sitetitle' )->escaped() ?>
                        </a>
                </p>
                <p id="sitesub"><?php echo wfMessage( 'sitesubtitle' )->escaped() ?></p>
-               <div id="toplinks">
-                       <p id="syslinks"><?php echo $this->sysLinks() ?></p>
-                       <p id="variantlinks"><?php echo $this->variantLinks() ?></p>
-               </div>
-               <div id="linkcollection">
+               <div id="linkcollection" role="navigation">
                        <div id="langlinks"><?php echo str_replace( '<br />', '', $this->otherLanguages() ) ?></div>
                        <?php echo $this->getSkin()->getCategories() ?>
                        <div id="titlelinks"><?php echo $this->pageTitleLinks() ?></div>
@@ -298,11 +285,14 @@ class CologneBlueTemplate extends BaseTemplate {
                        <?php } ?>
                </div>
        </div>
-       <div id="article">
+       <div id="article" role="main">
                <?php if ( $this->getSkin()->getSiteNotice() ) { ?>
                <div id="siteNotice"><?php echo $this->getSkin()->getSiteNotice() ?></div>
                <?php } ?>
-               <h1 id="firstHeading"><span dir="auto"><?php echo $this->data['title'] ?></span></h1>
+               <h1 id="firstHeading" lang="<?php
+                       $this->data['pageLanguage'] = $this->getSkin()->getTitle()->getPageLanguage()->getCode();
+                       $this->html( 'pageLanguage' );
+               ?>"><span dir="auto"><?php echo $this->data['title'] ?></span></h1>
                <?php if ( $this->translator->translate( 'tagline' ) ) { ?>
                <p class="tagline"><?php echo htmlspecialchars( $this->translator->translate( 'tagline' ) ) ?></p>
                <?php } ?>
@@ -321,14 +311,12 @@ class CologneBlueTemplate extends BaseTemplate {
 
        /**
         * @return string
-        *
-        * @fixed
         */
        function afterContent() {
                ob_start();
 ?>
        </div>
-       <div id='footer'>
+       <div id="footer" role="contentinfo">
 <?php
                // Page-related links
                echo $this->bottomLinks();
@@ -352,7 +340,14 @@ class CologneBlueTemplate extends BaseTemplate {
 ?>
        </div>
 </div>
-<?php echo $this->quickBar() ?>
+<div id="mw-navigation">
+       <h2><?php echo wfMessage( 'navigation-heading' )->escaped() ?></h2>
+       <div id="toplinks" role="navigation">
+               <p id="syslinks"><?php echo $this->sysLinks() ?></p>
+               <p id="variantlinks"><?php echo $this->variantLinks() ?></p>
+       </div>
+       <?php echo $this->quickBar() ?>
+</div>
 <?php
                $s = ob_get_contents();
                ob_end_clean();
@@ -362,8 +357,6 @@ class CologneBlueTemplate extends BaseTemplate {
 
        /**
         * @return string
-        *
-        * @fixed
         */
        function sysLinks() {
                $s = array(
@@ -397,8 +390,6 @@ class CologneBlueTemplate extends BaseTemplate {
         *
         * @param $bar sidebar data
         * @return array modified sidebar data
-        *
-        * @fixed
         */
        function sidebarAdditions( $bar ) {
                // "This page" and "Edit" menus
@@ -430,9 +421,10 @@ class CologneBlueTemplate extends BaseTemplate {
                        $qbmyoptions[$key] = null;
                }
 
-               $bar['qbedit'] = $qbedit;
-               $bar['qbpageoptions'] = $qbpageoptions;
-               $bar['qbmyoptions'] = $qbmyoptions;
+               // Use the closest reasonable name
+               $bar['cactions'] = $qbedit;
+               $bar['pageoptions'] = $qbpageoptions; // this is a non-standard portlet name, but nothing fits
+               $bar['personal'] = $qbmyoptions;
 
                return $bar;
        }
@@ -442,8 +434,6 @@ class CologneBlueTemplate extends BaseTemplate {
         * @access private
         *
         * @return string
-        *
-        * @fixed
         */
        function quickBar() {
                // Massage the sidebar. We want to:
@@ -479,12 +469,9 @@ class CologneBlueTemplate extends BaseTemplate {
                $bar = array();
                foreach ( $orig_bar as $heading => $data ) {
                        if ( $heading == 'SEARCH' ) {
-                               $bar['qbfind'] = $this->searchForm( 'sidebar' );
+                               $bar['search'] = $this->searchForm( 'sidebar' );
                        } elseif ( $heading == 'TOOLBOX' ) {
-                               $bar['toolbox'] = $this->getToolbox();
-                       } elseif ( $heading == 'navigation' ) {
-                               // Use the navigation heading from standard sidebar as the "browse" section
-                               $bar['qbbrowse'] = $data;
+                               $bar['tb'] = $this->getToolbox();
                        } else {
                                $bar[$heading] = $data;
                        }
@@ -492,12 +479,22 @@ class CologneBlueTemplate extends BaseTemplate {
 
 
                // Output the sidebar
+               // CologneBlue uses custom messages for some portlets, but we should keep the ids for consistency
+               $idToMessage = array(
+                       'search' => 'qbfind',
+                       'navigation' => 'qbbrowse',
+                       'tb' => 'toolbox',
+                       'cactions' => 'qbedit',
+                       'personal' => 'qbmyoptions',
+                       'pageoptions' => 'qbpageoptions',
+               );
+
                $s = "<div id='quickbar'>\n";
 
                foreach ( $bar as $heading => $data ) {
-                       $headingMsg = wfMessage( $heading );
-                       $headingHTML = "<h6>" . ( $headingMsg->exists() ? $headingMsg->escaped() : htmlspecialchars( $heading ) ) . "</h6>";
                        $portletId = Sanitizer::escapeId( "p-$heading" );
+                       $headingMsg = wfMessage( $idToMessage[$heading] ? $idToMessage[$heading] : $heading );
+                       $headingHTML = "<h3>" . ( $headingMsg->exists() ? $headingMsg->escaped() : htmlspecialchars( $heading ) ) . "</h3>";
                        $listHTML = "";
 
                        if ( is_array( $data ) ) {
@@ -517,7 +514,8 @@ class CologneBlueTemplate extends BaseTemplate {
                        }
 
                        if ( $listHTML ) {
-                               $s .= "<div class=\"portlet\" id=\"$portletId\">\n$headingHTML\n$listHTML\n</div>\n";
+                               $role = ( $heading == 'search' ) ? 'search' : 'navigation';
+                               $s .= "<div class=\"portlet\" id=\"$portletId\" role=\"$role\">\n$headingHTML\n$listHTML\n</div>\n";
                        }
                }
 
@@ -528,8 +526,6 @@ class CologneBlueTemplate extends BaseTemplate {
        /**
         * @param $label string
         * @return string
-        *
-        * @fixed
         */
        function searchForm( $which ) {
                global $wgUseTwoButtonsSearchForm;