Merge "Simplify SpecialVersion:listToText()"
[lhc/web/wiklou.git] / skins / CologneBlue.php
index dc5c001..3b53468 100644 (file)
@@ -36,7 +36,7 @@ class SkinCologneBlue extends SkinTemplate {
        var $useHeadElement = true;
 
        /**
-        * @param $out OutputPage
+        * @param OutputPage $out
         */
        function setupSkinUserCss( OutputPage $out ) {
                parent::setupSkinUserCss( $out );
@@ -47,6 +47,8 @@ class SkinCologneBlue extends SkinTemplate {
        /**
         * Override langlink formatting behavior not to uppercase the language names.
         * See otherLanguages() in CologneBlueTemplate.
+        * @param string $name
+        * @return string
         */
        function formatLanguageName( $name ) {
                return $name;
@@ -90,21 +92,37 @@ class CologneBlueTemplate extends BaseTemplate {
                        return "";
                }
 
+               $html = '';
+
                // We override SkinTemplate->formatLanguageName() in SkinCologneBlue
                // not to capitalize the language names.
                $language_urls = $this->data['language_urls'];
-               if ( empty( $language_urls ) ) {
-                       return "";
-               }
+               if ( !empty( $language_urls ) ) {
+                       $s = array();
+                       foreach ( $language_urls as $key => $data ) {
+                               $s[] = $this->makeListItem( $key, $data, array( 'tag' => 'span' ) );
+                       }
 
-               $s = array();
-               foreach ( $language_urls as $key => $data ) {
-                       $s[] = $this->makeListItem( $key, $data, array( 'tag' => 'span' ) );
+                       $html = wfMessage( 'otherlanguages' )->text()
+                               . wfMessage( 'colon-separator' )->text()
+                               . $this->getSkin()->getLanguage()->pipeList( $s );
                }
 
-               return wfMessage( 'otherlanguages' )->text()
-                       . wfMessage( 'colon-separator' )->text()
-                       . $this->getSkin()->getLanguage()->pipeList( $s );
+               $html .= $this->renderAfterPortlet( 'lang' );
+
+               return $html;
+       }
+
+       /**
+        * @param string $name
+        */
+       protected function renderAfterPortlet( $name ) {
+               $content = '';
+               wfRunHooks( 'BaseTemplateAfterPortlet', array( $this, $name, &$content ) );
+
+               $html = $content !== '' ? "<div class='after-portlet after-portlet-$name'>$content</div>" : '';
+
+               return $html;
        }
 
        function pageTitleLinks() {
@@ -121,9 +139,9 @@ class CologneBlueTemplate extends BaseTemplate {
        /**
         * Used in bottomLinks() to eliminate repetitive code.
         *
-        * @param $key string Key to be passed to makeListItem()
-        * @param $navlink array Navlink suitable for processNavlinkForDocument()
-        * @param $message string Key of the message to use in place of standard text
+        * @param string $key Key to be passed to makeListItem()
+        * @param array $navlink Navlink suitable for processNavlinkForDocument()
+        * @param string $message Key of the message to use in place of standard text
         *
         * @return string
         */
@@ -241,8 +259,8 @@ class CologneBlueTemplate extends BaseTemplate {
         * and removes the accesskeys. This is necessary to be able to use the same navlink twice,
         * e.g. in sidebar and in footer.
         *
-        * @param $navlink array Navigational link generated by SkinTemplate
-        * @param $idPrefix mixed Prefix to add to id of this navlink. If false, id is removed entirely. Default is 'cb-'.
+        * @param array $navlink Navigational link generated by SkinTemplate
+        * @param mixed $idPrefix Prefix to add to id of this navlink. If false, id is removed entirely. Default is 'cb-'.
         */
        function processNavlinkForDocument( $navlink, $idPrefix = 'cb-' ) {
                if ( $navlink['id'] ) {
@@ -283,7 +301,7 @@ class CologneBlueTemplate extends BaseTemplate {
                        <?php } ?>
                </div>
        </div>
-       <div id="article" role="main">
+       <div id="article" class="mw-body" role="main">
                <?php if ( $this->getSkin()->getSiteNotice() ) { ?>
                <div id="siteNotice"><?php echo $this->getSkin()->getSiteNotice() ?></div>
                <?php } ?>
@@ -367,9 +385,10 @@ class CologneBlueTemplate extends BaseTemplate {
                                Title::newFromText( wfMessage( 'aboutpage' )->inContentLanguage()->text() ),
                                wfMessage( 'about' )->text()
                        ),
-                       Linker::linkKnown(
-                               Title::newFromText( wfMessage( 'helppage' )->inContentLanguage()->text() ),
-                               wfMessage( 'help' )->text()
+                       Linker::makeExternalLink(
+                               Skin::makeInternalOrExternalUrl( wfMessage( 'helppage' )->inContentLanguage()->text() ),
+                               wfMessage( 'help' )->text(),
+                               false
                        ),
                        Linker::linkKnown(
                                Title::newFromText( wfMessage( 'faqpage' )->inContentLanguage()->text() ),
@@ -390,8 +409,8 @@ class CologneBlueTemplate extends BaseTemplate {
        /**
         * Adds CologneBlue-specific items to the sidebar: qbedit, qbpageoptions and qbmyoptions menus.
         *
-        * @param $bar sidebar data
-        * @return array modified sidebar data
+        * @param array $bar Sidebar data
+        * @return array Modified sidebar data
         */
        function sidebarAdditions( $bar ) {
                // "This page" and "Edit" menus
@@ -517,6 +536,8 @@ class CologneBlueTemplate extends BaseTemplate {
                                $role = ( $heading == 'search' ) ? 'search' : 'navigation';
                                $s .= "<div class=\"portlet\" id=\"$portletId\" role=\"$role\">\n$headingHTML\n$listHTML\n</div>\n";
                        }
+
+                       $s .= $this->renderAfterPortlet( $heading );
                }
 
                $s .= "</div>\n";
@@ -524,7 +545,7 @@ class CologneBlueTemplate extends BaseTemplate {
        }
 
        /**
-        * @param $label string
+        * @param string $label
         * @return string
         */
        function searchForm( $which ) {