Follow-up 2c74b043568e: Restore use of 'clearyourcache' message
[lhc/web/wiklou.git] / includes / page / Article.php
index cd72267..48f2ab3 100644 (file)
@@ -577,7 +577,16 @@ class Article implements Page {
                                        # Preload timestamp to avoid a DB hit
                                        $outputPage->setRevisionTimestamp( $this->mPage->getTimestamp() );
 
-                                       if ( !Hooks::run( 'ArticleContentViewCustom',
+                                       # Pages containing custom CSS or JavaScript get special treatment
+                                       if ( $this->getTitle()->isSiteConfigPage() || $this->getTitle()->isUserConfigPage() ) {
+                                               $dir = $this->getContext()->getLanguage()->getDir();
+                                               $lang = $this->getContext()->getLanguage()->getHtmlCode();
+
+                                               $outputPage->wrapWikiMsg(
+                                                       "<div id='mw-clearyourcache' lang='$lang' dir='$dir' class='mw-content-$dir'>\n$1\n</div>",
+                                                       'clearyourcache'
+                                               );
+                                       } elseif ( !Hooks::run( 'ArticleContentViewCustom',
                                                [ $this->fetchContentObject(), $this->getTitle(), $outputPage ] )
                                        ) {
                                                # Allow extensions do their own custom view for certain pages
@@ -965,7 +974,7 @@ class Article implements Page {
         * @return bool
         */
        public function showPatrolFooter() {
-               global $wgUseNPPatrol, $wgUseRCPatrol, $wgUseFilePatrol, $wgEnableAPI, $wgEnableWriteAPI;
+               global $wgUseNPPatrol, $wgUseRCPatrol, $wgUseFilePatrol;
 
                $outputPage = $this->getContext()->getOutput();
                $user = $this->getContext()->getUser();
@@ -1100,7 +1109,7 @@ class Article implements Page {
                }
 
                $outputPage->preventClickjacking();
-               if ( $wgEnableAPI && $wgEnableWriteAPI && $user->isAllowed( 'writeapi' ) ) {
+               if ( $user->isAllowed( 'writeapi' ) ) {
                        $outputPage->addModules( 'mediawiki.page.patrol.ajax' );
                }
 
@@ -1249,7 +1258,7 @@ class Article implements Page {
                        }
 
                        $dir = $this->getContext()->getLanguage()->getDir();
-                       $lang = $this->getContext()->getLanguage()->getCode();
+                       $lang = $this->getContext()->getLanguage()->getHtmlCode();
                        $outputPage->addWikiText( Xml::openElement( 'div', [
                                'class' => "noarticletext mw-content-$dir",
                                'dir' => $dir,