use newer spec for html5 metadata
[lhc/web/wiklou.git] / includes / Skin.php
index 0e40140..17da161 100644 (file)
@@ -357,15 +357,16 @@ class Skin extends Linker {
                }
                global $wgScript, $wgTitle, $wgStylePath, $wgUser, $wgScriptExtension;
                global $wgArticlePath, $wgScriptPath, $wgServer, $wgContLang, $wgLang;
-               global $wgCanonicalNamespaceNames, $wgOut, $wgArticle;
+               global $wgOut, $wgArticle;
                global $wgBreakFrames, $wgRequest, $wgVariantArticlePath, $wgActionPaths;
                global $wgUseAjax, $wgAjaxWatch;
                global $wgVersion, $wgEnableAPI, $wgEnableWriteAPI;
                global $wgRestrictionTypes, $wgLivePreview;
                global $wgMWSuggestTemplate, $wgDBname, $wgEnableMWSuggest;
+               global $wgSitename, $wgEnableIframeApiProxy, $wgEnableJS2system;
 
                $ns = $wgTitle->getNamespace();
-               $nsname = isset( $wgCanonicalNamespaceNames[ $ns ] ) ? $wgCanonicalNamespaceNames[ $ns ] : $wgTitle->getNsText();
+               $nsname = MWNamespace::exists( $ns ) ? MWNamespace::getCanonicalName( $ns ) : $wgTitle->getNsText();
                $separatorTransTable = $wgContLang->separatorTransformTable();
                $separatorTransTable = $separatorTransTable ? $separatorTransTable : array();
                $compactSeparatorTransTable = array(
@@ -383,6 +384,7 @@ class Skin extends Linker {
                $vars = array(
                        'skin' => $skinName,
                        'stylepath' => $wgStylePath,
+                       'urlprotocols' => wfUrlProtocols(),
                        'wgArticlePath' => $wgArticlePath,
                        'wgScriptPath' => $wgScriptPath,
                        'wgScriptExtension' => $wgScriptExtension,
@@ -391,7 +393,8 @@ class Skin extends Linker {
                        'wgActionPaths' => (object)$wgActionPaths,
                        'wgServer' => $wgServer,
                        'wgCanonicalNamespace' => $nsname,
-                       'wgCanonicalSpecialPageName' => SpecialPage::resolveAlias( $wgTitle->getDBkey() ),
+                       'wgCanonicalSpecialPageName' => $ns == NS_SPECIAL ?
+                               SpecialPage::resolveAlias( $wgTitle->getDBkey() ) : false, # bug 21115
                        'wgNamespaceNumber' => $wgTitle->getNamespace(),
                        'wgPageName' => $wgTitle->getPrefixedDBKey(),
                        'wgTitle' => $wgTitle->getText(),
@@ -412,6 +415,7 @@ class Skin extends Linker {
                        'wgMainPageTitle' => $mainPage ? $mainPage->getPrefixedText() : null,
                        'wgFormattedNamespaces' => $wgContLang->getFormattedNamespaces(),
                        'wgNamespaceIds' => $wgContLang->getNamespaceIds(),
+                       'wgSiteName' => $wgSitename,
                );
                if ( $wgContLang->hasVariants() ) {
                        $vars['wgUserVariant'] = $wgContLang->getPreferredVariant();
@@ -441,6 +445,17 @@ class Skin extends Linker {
                        $vars['wgLivepreviewMessageError']   = wfMsg( 'livepreview-error' );
                }
 
+               //add api proxy var and script link if on the special proxy page:
+               if( $wgEnableJS2system &&
+                       $wgTitle->getNamespace() == NS_MEDIAWIKI &&
+                       $wgTitle->getDBKey() == 'ApiProxy' )
+               {
+                       $vars['wgEnableIframeApiProxy'] = $wgEnableIframeApiProxy;                      
+                       //also add the apiProxy Page script if we are on that page
+                       if( $wgEnableIframeApiProxy )
+                               $wgOut->addScriptClass( 'apiProxyPage' );
+               }
+
                if ( $wgOut->isArticleRelated() && $wgUseAjax && $wgAjaxWatch && $wgUser->isLoggedIn() ) {
                        $msgs = (object)array();
                        foreach ( array( 'watch', 'unwatch', 'watching', 'unwatching' ) as $msgName ) {
@@ -863,7 +878,7 @@ END;
                $catlinks = $this->getCategoryLinks();
 
                $classes = 'catlinks';
-               
+
                // Check what we're showing
                global $wgOut, $wgUser;
                $allCats = $wgOut->getCategoryLinks();
@@ -959,7 +974,7 @@ END;
                        else
                                $ret .= str_repeat( "<ul><li>\n", $diff );
                        $ret .= $display . "\n";
-                       
+
                        $curIdent = $ident;
                }
                $ret .= str_repeat( '</li></ul>', $curIdent ) . '</li>';