Fix regression -- wfMkdirParents() started whining if target directory existed, inste...
[lhc/web/wiklou.git] / skins / CologneBlue.php
index 734f6d1..b066a1a 100644 (file)
@@ -3,34 +3,34 @@
  * See skin.txt
  *
  * @todo document
- * @package MediaWiki
- * @subpackage Skins
+ * @addtogroup Skins
  */
 
 if( !defined( 'MEDIAWIKI' ) )
-       die();
+       die( -1 );
 
 /**
  * @todo document
- * @package MediaWiki
- * @subpackage Skins
+ * @addtogroup Skins
  */
 class SkinCologneBlue extends Skin {
 
+       private $searchboxes = '';
+       // How many search boxes have we made?  Avoid duplicate id's.
+
        function getStylesheet() {
-               return "common/cologneblue.css?1";
+               return 'common/cologneblue.css';
        }
        function getSkinName() {
                return "cologneblue";
        }
 
        function doBeforeContent() {
-               global $wgOut, $wgTitle;
 
                $s = "";
                $qb = $this->qbSetting();
                $mainPageObj = Title::newMainPage();
-               
+
                $s .= "\n<div id='content'>\n<div id='topbar'>" .
                  "<table width='100%' border='0' cellspacing='0' cellpadding='8'><tr>";
 
@@ -82,7 +82,7 @@ class SkinCologneBlue extends Skin {
                $s .= "<td class='bottom' align='center' valign='top'>";
 
                $s .= $this->bottomLinks();
-               $s .= "\n<br />" . $this->makeKnownLink( wfMsgForContent( "mainpage" ) ) . " | "
+               $s .= "\n<br />" . $this->makeKnownLinkObj( Title::newMainPage() ) . " | "
                  . $this->aboutLink() . " | "
                  . $this->searchForm( wfMsg( "qbfind" ) );
 
@@ -97,9 +97,9 @@ class SkinCologneBlue extends Skin {
                if ( 0 != $qb ) { $s .= $this->quickBar(); }
                return $s;
        }
-       
+
        function doGetUserStyles() {
-               global $wgOut, $wgStyleSheetPath;
+               global $wgOut;
                $s = parent::doGetUserStyles();
                $qb = $this->qbSetting();
 
@@ -122,7 +122,7 @@ class SkinCologneBlue extends Skin {
                }
                return $s;
        }
-       
+
        function sysLinks() {
                global $wgUser, $wgContLang, $wgTitle;
                $li = $wgContLang->specialPage("Userlogin");
@@ -134,9 +134,9 @@ class SkinCologneBlue extends Skin {
                } else {
                        $q = "returnto={$rt}";
                }
-               
+
                $s = "" .
-                 $this->makeKnownLink( wfMsgForContent( "mainpage" ), wfMsg( "mainpage" ) )
+                 $this->mainPageLink()
                  . " | " .
                  $this->makeKnownLink( wfMsgForContent( "aboutpage" ), wfMsg( "about" ) )
                  . " | " .
@@ -144,29 +144,19 @@ class SkinCologneBlue extends Skin {
                  . " | " .
                  $this->makeKnownLink( wfMsgForContent( "faqpage" ), wfMsg("faq") )
                  . " | " .
-                 $this->specialLink( "specialpages" ) . " | ";
+                 $this->specialLink( "specialpages" );
 
+               /* show links to different language variants */
+               $s .= $this->variantLinks();
+               $s .= $this->extensionTabLinks();
+               
+               $s .= " | ";
                if ( $wgUser->isLoggedIn() ) {
                        $s .=  $this->makeKnownLink( $lo, wfMsg( "logout" ), $q );
                } else {
                        $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;
        }
 
@@ -198,7 +188,7 @@ class SkinCologneBlue extends Skin {
                                        htmlspecialchars( $link['text'] ) . '</a>' . $sep;
                        }
                }
-               
+
                if ( $wgOut->isArticle() ) {
                        $s .= $this->menuHead( "qbedit" );
                        $s .= "<strong>" . $this->editThisPage() . "</strong>";
@@ -236,7 +226,7 @@ class SkinCologneBlue extends Skin {
                          . $this->historyLink()
                          . $sep . $this->whatLinksHere()
                          . $sep . $this->watchPageLinksLink();
-                       
+
                        if( $tns == NS_USER || $tns == NS_USER_TALK ) {
                                $id=User::idFromName($wgTitle->getText());
                                if ($id != 0) {
@@ -262,8 +252,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 {
@@ -283,9 +273,9 @@ class SkinCologneBlue extends Skin {
                        $s .= $sep."<a href=\"".htmlspecialchars($wgSiteSupportPage)."\" class =\"internal\">"
                              .wfMsg( "sitesupport" )."</a>";
                }
-               
+
                $s .= $sep . $this->makeKnownLinkObj(
-                       Title::makeTitle( NS_SPECIAL, 'Specialpages' ),
+                       SpecialPage::getTitleFor( 'Specialpages' ),
                        wfMsg( 'moredotdotdot' ) );
 
                $s .= $sep . "\n</div>\n";
@@ -304,12 +294,16 @@ class SkinCologneBlue extends Skin {
 
                $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" ) ) . "\" />"
+                 . "<input type='submit' id=\"mw-searchButton{$this->searchboxes}\" class=\"searchButton\" name=\"fulltext\" value=\"" . htmlspecialchars( wfMsg( "search" ) ) . "\" /></form>";
+
+               // Ensure unique id's for search boxes made after the first
+               $this->searchboxes = $this->searchboxes == '' ? 2 : $this->searchboxes + 1;
 
                return $s;
        }