*/
if( !defined( 'MEDIAWIKI' ) )
- die();
+ die( -1 );
/**
* @todo document
* @subpackage Skins
*/
class SkinCologneBlue extends Skin {
- # We have several search form. Make sure they have different id
- var $searchFormCount = '' ;
+
+ 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();
}
function doGetUserStyles() {
- global $wgOut, $wgStyleSheetPath;
+ global $wgOut;
$s = parent::doGetUserStyles();
$qb = $this->qbSetting();
}
/* 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>';
- }
- }
-
-
+ $s .= $this->variantLinks();
return $s;
}
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 {
}
$s .= $sep . $this->makeKnownLinkObj(
- Title::makeTitle( NS_SPECIAL, 'Specialpages' ),
+ SpecialPage::getTitleFor( 'Specialpages' ),
wfMsg( 'moredotdotdot' ) );
$s .= $sep . "\n</div>\n";
function searchForm( $label = "" )
{
- global $wgRequest, $searchFormCount;
+ global $wgRequest;
$search = $wgRequest->getText( 'search' );
$action = $this->escapeSearchLink();
- $s = "<form id=\"searchForm{$searchFormCount}\" 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=\"searchInput{$searchFormCount}\" 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>";
- $searchFormCount++;
+ $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;
}
}