Fix NS_PROJECT_TALK (bug #7792)
[lhc/web/wiklou.git] / includes / OutputPage.php
index 25ff449..d83e1e1 100644 (file)
@@ -524,8 +524,8 @@ class OutputPage {
        public function output() {
                global $wgUser, $wgOutputEncoding, $wgRequest;
                global $wgContLanguageCode, $wgDebugRedirects, $wgMimeType;
-               global $wgJsMimeType, $wgStylePath, $wgUseAjax, $wgAjaxSearch, $wgServer;
-               global $wgStyleVersion;
+               global $wgJsMimeType, $wgStylePath, $wgUseAjax, $wgAjaxSearch, $wgAjaxWatch;
+               global $wgServer, $wgStyleVersion;
 
                if( $this->mDoNothing ){
                        return;
@@ -536,11 +536,14 @@ class OutputPage {
 
                if ( $wgUseAjax ) {
                        $this->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$wgStylePath}/common/ajax.js?$wgStyleVersion\"></script>\n" );
-               }
+                       if( $wgAjaxSearch ) {
+                               $this->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$wgStylePath}/common/ajaxsearch.js\"></script>\n" );
+                               $this->addScript( "<script type=\"{$wgJsMimeType}\">hookEvent(\"load\", sajax_onload);</script>\n" );
+                       }
 
-               if ( $wgUseAjax && $wgAjaxSearch ) {
-                       $this->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$wgStylePath}/common/ajaxsearch.js?$wgStyleVersion\"></script>\n" );
-                       $this->addScript( "<script type=\"{$wgJsMimeType}\">hookEvent(\"load\", sajax_onload);</script>\n" );
+                       if( $wgAjaxWatch && $wgUser->isLoggedIn() ) {
+                               $this->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$wgStylePath}/common/ajaxwatch.js\"></script>\n" );
+                       }
                }
 
                if ( '' != $this->mRedirect ) {
@@ -882,7 +885,7 @@ class OutputPage {
                        if( $wgTitle->getNamespace() == NS_MEDIAWIKI && !$wgUser->isAllowed( 'editinterface' ) ) {
                                $this->addWikiText( wfMsg( 'protectedinterface' ) );
                        } else {
-                               $this->addWikiText( wfMsg( 'protectedtext' ) );
+                               $this->addWikiText( wfMsg( 'protectedpagetext' ) );
                        }
                } else {
                        $this->setPageTitle( wfMsg( 'readonly' ) );