Remove unused private "filterPage" function from specials/SpecialExport.php
[lhc/web/wiklou.git] / includes / Skin.php
index 17da161..e9b007b 100644 (file)
@@ -24,7 +24,7 @@ class Skin extends Linker {
        /**#@-*/
        protected $mRevisionId; // The revision ID we're looking at, null if not applicable.
        protected $skinname = 'standard';
-       // @fixme Should be protected :-\
+       // @todo Fixme: should be protected :-\
        var $mTitle = null;
 
        /** Constructor, call parent constructor */
@@ -361,9 +361,9 @@ class Skin extends Linker {
                global $wgBreakFrames, $wgRequest, $wgVariantArticlePath, $wgActionPaths;
                global $wgUseAjax, $wgAjaxWatch;
                global $wgVersion, $wgEnableAPI, $wgEnableWriteAPI;
-               global $wgRestrictionTypes, $wgLivePreview;
+               global $wgRestrictionTypes;
                global $wgMWSuggestTemplate, $wgDBname, $wgEnableMWSuggest;
-               global $wgSitename, $wgEnableIframeApiProxy, $wgEnableJS2system;
+               global $wgSitename;
 
                $ns = $wgTitle->getNamespace();
                $nsname = MWNamespace::exists( $ns ) ? MWNamespace::getCanonicalName( $ns ) : $wgTitle->getNsText();
@@ -401,8 +401,8 @@ class Skin extends Linker {
                        'wgAction' => $wgRequest->getText( 'action', 'view' ),
                        'wgArticleId' => $wgTitle->getArticleId(),
                        'wgIsArticle' => $wgOut->isArticle(),
-                       'wgUserName' => $wgUser->isAnon() ? NULL : $wgUser->getName(),
-                       'wgUserGroups' => $wgUser->isAnon() ? NULL : $wgUser->getEffectiveGroups(),
+                       'wgUserName' => $wgUser->isAnon() ? null : $wgUser->getName(),
+                       'wgUserGroups' => $wgUser->isAnon() ? null : $wgUser->getEffectiveGroups(),
                        'wgUserLanguage' => $wgLang->getCode(),
                        'wgContentLanguage' => $wgContLang->getCode(),
                        'wgBreakFrames' => $wgBreakFrames,
@@ -416,6 +416,7 @@ class Skin extends Linker {
                        'wgFormattedNamespaces' => $wgContLang->getFormattedNamespaces(),
                        'wgNamespaceIds' => $wgContLang->getNamespaceIds(),
                        'wgSiteName' => $wgSitename,
+                       'wgCategories' => $wgOut->getCategories(),
                );
                if ( $wgContLang->hasVariants() ) {
                        $vars['wgUserVariant'] = $wgContLang->getPreferredVariant();
@@ -425,7 +426,6 @@ class Skin extends Linker {
                if( SpecialPage::resolveAlias( $wgTitle->getDBkey() ) ==  "Upload" ) {
                        global $wgFileExtensions, $wgAjaxUploadInterface;
                        $vars['wgFileExtensions'] = $wgFileExtensions;
-                       $vars['wgAjaxUploadInterface'] = $wgAjaxUploadInterface;
                }
 
                if( $wgUseAjax && $wgEnableMWSuggest && !$wgUser->getOption( 'disablesuggest', false ) ){
@@ -438,27 +438,10 @@ class Skin extends Linker {
                foreach( $wgRestrictionTypes as $type )
                        $vars['wgRestriction' . ucfirst( $type )] = $wgTitle->getRestrictions( $type );
 
-               if ( $wgLivePreview && $wgUser->getOption( 'uselivepreview' ) ) {
-                       $vars['wgLivepreviewMessageLoading'] = wfMsg( 'livepreview-loading' );
-                       $vars['wgLivepreviewMessageReady']   = wfMsg( 'livepreview-ready' );
-                       $vars['wgLivepreviewMessageFailed']  = wfMsg( 'livepreview-failed' );
-                       $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 ) {
+                       foreach ( array( 'watch', 'unwatch', 'watching', 'unwatching', 
+                               'tooltip-ca-watch', 'tooltip-ca-unwatch' ) as $msgName ) {
                                $msgs->{$msgName . 'Msg'} = wfMsg( $msgName );
                        }
                        $vars['wgAjaxWatch'] = $msgs;
@@ -564,7 +547,7 @@ class Skin extends Linker {
                if( $wgUser->getOption( 'highlightbroken' ) ) {
                        $s .= "a.new, #quickbar a.new { color: #CC2200; }\n";
                } else {
-                       $s .= <<<END
+                       $s .= <<<CSS
 a.new, #quickbar a.new,
 a.stub, #quickbar a.stub {
        color: inherit;
@@ -577,7 +560,7 @@ a.stub:after, #quickbar a.stub:after {
        content: "!";
        color: #772233;
 }
-END;
+CSS;
                }
                if( $wgUser->getOption( 'justify' ) ) {
                        $s .= "#article, #bodyContent, #mw_content { text-align: justify; }\n";
@@ -2044,7 +2027,22 @@ END;
                }
 
                $bar = array();
-               $lines = explode( "\n", wfMsgForContent( 'sidebar' ) );
+               $this->addToSidebar( $bar, 'sidebar' );
+
+               wfRunHooks( 'SkinBuildSidebar', array( $this, &$bar ) );
+               if ( $wgEnableSidebarCache ) $parserMemc->set( $key, $bar, $wgSidebarCacheExpiry );
+               wfProfileOut( __METHOD__ );
+               return $bar;
+       }
+       /**
+        * Add content from a sidebar system message
+        * Currently only used for MediaWiki:Sidebar (but may be used by Extensions)
+        * 
+        * @param &$bar array
+        * @param $message String
+        */
+       function addToSidebar( &$bar, $message ) {
+               $lines = explode( "\n", wfMsgForContent( $message ) );
                $heading = '';
                foreach( $lines as $line ) {
                        if( strpos( $line, '*' ) !== 0 )
@@ -2086,10 +2084,6 @@ END;
                                } else { continue; }
                        }
                }
-               wfRunHooks( 'SkinBuildSidebar', array( $this, &$bar ) );
-               if ( $wgEnableSidebarCache ) $parserMemc->set( $key, $bar, $wgSidebarCacheExpiry );
-               wfProfileOut( __METHOD__ );
-               return $bar;
        }
 
        /**