Remove hard coding of pipe separators in skins. Use Language::pipeList as much as...
[lhc/web/wiklou.git] / skins / CologneBlue.php
index 9cb3ef3..c650cbe 100644 (file)
@@ -1,10 +1,10 @@
 <?php
 /**
- * See skin.txt
+ * See docs/skin.txt
  *
  * @todo document
- * @package MediaWiki
- * @subpackage Skins
+ * @file
+ * @ingroup Skins
  */
 
 if( !defined( 'MEDIAWIKI' ) )
@@ -12,13 +12,12 @@ if( !defined( 'MEDIAWIKI' ) )
 
 /**
  * @todo document
- * @package MediaWiki
- * @subpackage Skins
+ * @ingroup Skins
  */
 class SkinCologneBlue extends Skin {
 
        function getStylesheet() {
-               return "common/cologneblue.css?1";
+               return 'common/cologneblue.css';
        }
        function getSkinName() {
                return "cologneblue";
@@ -67,7 +66,7 @@ class SkinCologneBlue extends Skin {
 
        function doAfterContent()
        {
-               global $wgOut;
+               global $wgOut, $wgLang;
 
                $s = "\n</div><br clear='all' />\n";
 
@@ -81,9 +80,11 @@ class SkinCologneBlue extends Skin {
                $s .= "<td class='bottom' align='center' valign='top'>";
 
                $s .= $this->bottomLinks();
-               $s .= "\n<br />" . $this->makeKnownLink( wfMsgForContent( "mainpage" ) ) . " | "
-                 . $this->aboutLink() . " | "
-                 . $this->searchForm( wfMsg( "qbfind" ) );
+               $s .= $wgLang->pipeList( array(
+                       "\n<br />" . $this->makeKnownLinkObj( Title::newMainPage() ),
+                       $this->aboutLink(),
+                       $this->searchForm( wfMsg( "qbfind" ) )
+               ) );
 
                $s .= "\n<br />" . $this->pageStats();
 
@@ -97,9 +98,8 @@ class SkinCologneBlue extends Skin {
                return $s;
        }
 
-       function doGetUserStyles() {
-               global $wgOut;
-               $s = parent::doGetUserStyles();
+       function reallyGenerateUserStylesheet() {
+               $s = parent::reallyGenerateUserStylesheet();
                $qb = $this->qbSetting();
 
                if ( 2 == $qb ) { # Right
@@ -123,7 +123,7 @@ class SkinCologneBlue extends Skin {
        }
 
        function sysLinks() {
-               global $wgUser, $wgContLang, $wgTitle;
+               global $wgUser, $wgLang, $wgContLang, $wgTitle;
                $li = $wgContLang->specialPage("Userlogin");
                $lo = $wgContLang->specialPage("Userlogout");
 
@@ -134,37 +134,28 @@ class SkinCologneBlue extends Skin {
                        $q = "returnto={$rt}";
                }
 
-               $s = "" .
-                 $this->makeKnownLink( wfMsgForContent( "mainpage" ), wfMsg( "mainpage" ) )
-                 . " | " .
-                 $this->makeKnownLink( wfMsgForContent( "aboutpage" ), wfMsg( "about" ) )
-                 . " | " .
-                 $this->makeKnownLink( wfMsgForContent( "helppage" ), wfMsg( "help" ) )
-                 . " | " .
-                 $this->makeKnownLink( wfMsgForContent( "faqpage" ), wfMsg("faq") )
-                 . " | " .
-                 $this->specialLink( "specialpages" ) . " | ";
+               $s = array(
+                       $this->mainPageLink(),
+                       $this->makeKnownLink( wfMsgForContent( "aboutpage" ), wfMsg( "about" ) ),
+                       $this->makeKnownLink( wfMsgForContent( "helppage" ), wfMsg( "help" ) ),
+                       $this->makeKnownLink( wfMsgForContent( "faqpage" ), wfMsg("faq") ),
+                       $this->specialLink( "specialpages" )
+               );
 
+               /* show links to different language variants */
+               if( $this->variantLinks() ) {
+                       $s[] = $this->variantLinks();
+               }
+               if( $this->extensionTabLinks() ) {
+                       $s[] = $this->extensionTabLinks();
+               }
                if ( $wgUser->isLoggedIn() ) {
-                       $s .=  $this->makeKnownLink( $lo, wfMsg( "logout" ), $q );
+                       $s[] = $this->makeKnownLink( $lo, wfMsg( "logout" ), $q );
                } else {
-                       $s .=  $this->makeKnownLink( $li, wfMsg( "login" ), $q );
+                       $s[] = $this->makeKnownLink( $li, wfMsg( "login" ), $q );
                }
 
-               /* show links to different language variants */
-               global $wgDisableLangConversion;
-               $variants = $wgContLang->getVariants();
-               if( !$wgDisableLangConversion && sizeof( $variants ) > 1 ) {
-                       $actstr = '';
-                       foreach( $variants as $code ) {
-                               $varname = $wgContLang->getVariantname( $code );
-                               if( $varname == 'disable' )
-                                       continue;
-                               $s .= ' | <a href="' . $wgTitle->getLocalUrl( 'variant=' . $code ) . '">' . $varname . '</a>';
-                       }
-               }
-
-               return $s;
+               return $wgLang->pipeList( $s );
        }
 
        /**
@@ -187,6 +178,9 @@ class SkinCologneBlue extends Skin {
 
                # Use the first heading from the Monobook sidebar as the "browse" section
                $bar = $this->buildSidebar();
+               unset( $bar['SEARCH'] );
+               unset( $bar['LANGUAGES'] );
+               unset( $bar['TOOLBOX'] );
                $browseLinks = reset( $bar );
 
                foreach ( $browseLinks as $link ) {
@@ -259,8 +253,8 @@ class SkinCologneBlue extends Skin {
                                wfMsg( "mypage" ) )
                          . $sep . $tl
                          . $sep . $this->specialLink( "watchlist" )
-                         . $sep . $this->makeKnownLinkObj( Title::makeTitle( NS_SPECIAL, "Contributions" ),
-                               wfMsg( "mycontris" ), "target=" . wfUrlencode($wgUser->getName() ) )
+                         . $sep . $this->makeKnownLinkObj( SpecialPage::getSafeTitleFor( "Contributions", $wgUser->getName() ),
+                               wfMsg( "mycontris" ) )
                          . $sep . $this->specialLink( "preferences" )
                          . $sep . $this->specialLink( "userlogout" );
                } else {
@@ -269,9 +263,8 @@ class SkinCologneBlue extends Skin {
 
                $s .= $this->menuHead( "qbspecialpages" )
                  . $this->specialLink( "newpages" )
-                 . $sep . $this->specialLink( "imagelist" )
-                 . $sep . $this->specialLink( "statistics" )
-                 . $sep . $this->bugReportsLink();
+                 . $sep . $this->specialLink( "listfiles" )
+                 . $sep . $this->specialLink( "statistics" );
                if ( $wgUser->isLoggedIn() && $wgEnableUploads ) {
                        $s .= $sep . $this->specialLink( "upload" );
                }
@@ -282,7 +275,7 @@ class SkinCologneBlue extends Skin {
                }
 
                $s .= $sep . $this->makeKnownLinkObj(
-                       Title::makeTitle( NS_SPECIAL, 'Specialpages' ),
+                       SpecialPage::getTitleFor( 'Specialpages' ),
                        wfMsg( 'moredotdotdot' ) );
 
                $s .= $sep . "\n</div>\n";
@@ -297,19 +290,29 @@ class SkinCologneBlue extends Skin {
 
        function searchForm( $label = "" )
        {
-               global $wgRequest;
+               global $wgRequest, $wgUseTwoButtonsSearchForm;
 
                $search = $wgRequest->getText( 'search' );
                $action = $this->escapeSearchLink();
-               $s = "<form id=\"search\" method=\"get\" class=\"inline\" action=\"$action\">";
+               $s = "<form id=\"searchform{$this->searchboxes}\" method=\"get\" class=\"inline\" action=\"$action\">";
                if ( "" != $label ) { $s .= "{$label}: "; }
 
-               $s .= "<input type='text' name=\"search\" size='14' value=\""
-                 . htmlspecialchars(substr($search,0,256)) . "\" />"
-                 . "<br /><input type='submit' name=\"go\" value=\"" . htmlspecialchars( wfMsg( "go" ) ) . "\" /> <input type='submit' name=\"fulltext\" value=\"" . htmlspecialchars( wfMsg( "search" ) ) . "\" /></form>";
+               $s .= "<input type='text' id=\"searchInput{$this->searchboxes}\" class=\"mw-searchInput\" name=\"search\" size=\"14\" value=\""
+                 . htmlspecialchars(substr($search,0,256)) . "\" /><br />"
+                 . "<input type='submit' id=\"searchGoButton{$this->searchboxes}\" class=\"searchButton\" name=\"go\" value=\"" . htmlspecialchars( wfMsg( "searcharticle" ) ) . "\" />";
+
+               if ($wgUseTwoButtonsSearchForm) 
+                       $s .= "<input type='submit' id=\"mw-searchButton{$this->searchboxes}\" class=\"searchButton\" name=\"fulltext\" value=\"" . htmlspecialchars( wfMsg( "search" ) ) . "\" />\n";
+               else
+                       $s .= '<div><a href="$action" rel="search">' . wfMsg ('powersearch-legend') . "</a></div>\n";
+               
+               $s .= '</form>';
+
+               // Ensure unique id's for search boxes made after the first
+               $this->searchboxes = $this->searchboxes == '' ? 2 : $this->searchboxes + 1;
 
                return $s;
        }
 }
 
-?>
+