*/
static function &newFromKey( $key ) {
global $wgStyleDirectory;
-
+
$key = Skin::normalizeKey( $key );
$skinNames = Skin::getSkinNames();
if( false !== $wgFavicon ) {
$out->addLink( array( 'rel' => 'shortcut icon', 'href' => $wgFavicon ) );
}
-
+
if( false !== $wgAppleTouchIcon ) {
$out->addLink( array( 'rel' => 'apple-touch-icon', 'href' => $wgAppleTouchIcon ) );
- }
+ }
# OpenSearch description link
- $out->addLink( array(
- 'rel' => 'search',
+ $out->addLink( array(
+ 'rel' => 'search',
'type' => 'application/opensearchdescription+xml',
'href' => "$wgScriptPath/opensearch_desc{$wgScriptExtension}",
'title' => wfMsgForContent( 'opensearch-desc' ),
$this->addMetadataLinks($out);
$this->mRevisionId = $out->mRevisionId;
-
+
$this->preloadExistence();
wfProfileOut( __METHOD__ );
$lb = new LinkBatch( $titles );
$lb->execute();
}
-
+
function addMetadataLinks( &$out ) {
global $wgTitle, $wgEnableDublinCoreRdf, $wgEnableCreativeCommonsRdf;
global $wgRightsPage, $wgRightsUrl;
global $wgUseAjax, $wgAjaxWatch;
global $wgVersion, $wgEnableAPI, $wgEnableWriteAPI;
global $wgRestrictionTypes, $wgLivePreview;
+ global $wgMWSuggestTemplate, $wgDBname, $wgEnableMWSuggest;
$ns = $wgTitle->getNamespace();
$nsname = isset( $wgCanonicalNamespaceNames[ $ns ] ) ? $wgCanonicalNamespaceNames[ $ns ] : $wgTitle->getNsText();
- $vars = array(
+ $vars = array(
'skin' => $data['skinname'],
'stylepath' => $wgStylePath,
'wgArticlePath' => $wgArticlePath,
'wgEnableAPI' => $wgEnableAPI,
'wgEnableWriteAPI' => $wgEnableWriteAPI,
);
+
+ if( $wgUseAjax && $wgEnableMWSuggest && !$wgUser->getOption( 'disablesuggest', false )){
+ $vars['wgMWSuggestTemplate'] = SearchEngine::getMWSuggestTemplate();
+ $vars['wgDBname'] = $wgDBname;
+ $vars['wgSearchNamespaces'] = SearchEngine::userNamespaces( $wgUser );
+ $vars['wgMWSuggestMessages'] = array( wfMsg('search-mwsuggest-enabled'), wfMsg('search-mwsuggest-disabled'));
+ }
foreach( $wgRestrictionTypes as $type )
$vars['wgRestriction' . ucfirst( $type )] = $wgTitle->getRestrictions( $type );
$colon = wfMsgExt( 'colon-separator', 'escapenoentities' );
if ( !empty( $allCats['normal'] ) ) {
$t = $embed . implode ( "{$pop} {$sep} {$embed}" , $allCats['normal'] ) . $pop;
-
+
$msg = wfMsgExt( 'pagecategories', array( 'parsemag', 'escapenoentities' ), count( $allCats['normal'] ) );
$s .= '<div id="mw-normal-catlinks">' .
$this->makeLinkObj( Title::newFromText( wfMsgForContent('pagecategorieslink') ), $msg )
} else {
$class = 'mw-hidden-cats-hidden';
}
- $s .= "<div id=\"mw-hidden-catlinks\" class=\"$class\">" .
- wfMsgExt( 'hidden-categories', array( 'parsemag', 'escapenoentities' ), count( $allCats['hidden'] ) ) .
+ $s .= "<div id=\"mw-hidden-catlinks\" class=\"$class\">" .
+ wfMsgExt( 'hidden-categories', array( 'parsemag', 'escapenoentities' ), count( $allCats['hidden'] ) ) .
$colon . $embed . implode( "$pop $sep $embed", $allCats['hidden'] ) . $pop .
"</div>";
}
function getCategories() {
$catlinks=$this->getCategoryLinks();
+
+ $classes = 'catlinks';
+
+ if(FALSE === strpos($catlinks,'<div id="mw-normal-catlinks">')) {
+ $classes .= ' catlinks-allhidden';
+ }
+
if(!empty($catlinks)) {
- return "<div class='catlinks'>{$catlinks}</div>";
+ return "<div id='catlinks' class='$classes'>{$catlinks}</div>";
}
}
/**
* This gets called shortly before the \</body\> tag.
- * @return String HTML to be put before \</body\>
+ * @return String HTML to be put before \</body\>
*/
function afterContent() {
$printfooter = "<div class=\"printfooter\">\n" . $this->printFooter() . "</div>\n";
/**
* This gets called shortly before the \</body\> tag.
- * @return String HTML-wrapped JS code to be put before \</body\>
+ * @return String HTML-wrapped JS code to be put before \</body\>
*/
function bottomScripts() {
global $wgJsMimeType;
}
# Many people don't like this dropdown box
#$s .= $sep . $this->specialPagesList();
-
+
$s .= $this->variantLinks();
-
+
$s .= $this->extensionTabLinks();
return $s;
}
-
+
/**
* Compatibility for extensions adding functionality through tabs.
* Eventually these old skins should be replaced with SkinTemplate-based
}
return $s;
}
-
+
/**
* Language/charset variant links for classic-style skins
* @return string
}
function lastModified() {
- global $wgLang, $wgArticle, $wgLoadBalancer;
+ global $wgLang, $wgArticle;
$timestamp = $wgArticle->getTimestamp();
if ( $timestamp ) {
} else {
$s = '';
}
- if ( $wgLoadBalancer->getLaggedSlaveMode() ) {
+ if ( wfGetLB()->getLaggedSlaveMode() ) {
$s .= ' <strong>' . wfMsg( 'laggedslavemode' ) . '</strong>';
}
return $s;
function editThisPage() {
global $wgOut, $wgTitle;
- if ( ! $wgOut->isArticleRelated() ) {
+ if ( !$wgOut->isArticleRelated() ) {
$s = wfMsg( 'protectedpage' );
} else {
- if ( $wgTitle->userCan( 'edit' ) ) {
+ if( $wgTitle->userCan( 'edit' ) && $wgTitle->exists() ) {
$t = wfMsg( 'editthispage' );
+ } elseif( $wgTitle->userCan( 'create' ) && !$wgTitle->exists() ) {
+ $t = wfMsg( 'create-this-page' );
} else {
$t = wfMsg( 'viewsource' );
}
function whatLinksHere() {
global $wgTitle;
- return $this->makeKnownLinkObj(
- SpecialPage::getTitleFor( 'Whatlinkshere', $wgTitle->getPrefixedDBkey() ),
+ return $this->makeKnownLinkObj(
+ SpecialPage::getTitleFor( 'Whatlinkshere', $wgTitle->getPrefixedDBkey() ),
wfMsg( 'whatlinkshere' ) );
}
function userContribsLink() {
global $wgTitle;
- return $this->makeKnownLinkObj(
+ return $this->makeKnownLinkObj(
SpecialPage::getTitleFor( 'Contributions', $wgTitle->getDBkey() ),
wfMsg( 'contributions' ) );
}
function emailUserLink() {
global $wgTitle;
- return $this->makeKnownLinkObj(
+ return $this->makeKnownLinkObj(
SpecialPage::getTitleFor( 'Emailuser', $wgTitle->getDBkey() ),
wfMsg( 'emailuser' ) );
}
if ( ! $wgOut->isArticleRelated() ) {
return '(' . wfMsg( 'notanarticle' ) . ')';
} else {
- return $this->makeKnownLinkObj(
- SpecialPage::getTitleFor( 'Recentchangeslinked', $wgTitle->getPrefixedDBkey() ),
+ return $this->makeKnownLinkObj(
+ SpecialPage::getTitleFor( 'Recentchangeslinked', $wgTitle->getPrefixedDBkey() ),
wfMsg( 'recentchangeslinked' ) );
}
}
if ( $wgTitle->getNamespace() == NS_SPECIAL ) {
return '';
}
-
+
# __NEWSECTIONLINK___ changes behaviour here
# If it's present, the link points to this page, otherwise
# it points to the talk page
} else {
$title = $wgTitle->getTalkPage();
}
-
+
return $this->makeKnownLinkObj( $title, wfMsg( 'postcomment' ), 'action=edit§ion=new' );
}
$key = wfMemcKey( 'sidebar' );
$cacheSidebar = $wgEnableSidebarCache &&
($wgLang->getCode() == $wgContLang->getCode());
-
+
if ($cacheSidebar) {
$cachedsidebar = $parserMemc->get( $key );
if ($cachedsidebar!="") {
wfProfileOut( $fname );
return $bar;
}
-
}