Merge "Suppress section edit links with action=render"
[lhc/web/wiklou.git] / includes / specialpage / SpecialPage.php
index e5ce48f..d9340b4 100644 (file)
@@ -74,6 +74,7 @@ class SpecialPage {
         */
        public static function getTitleFor( $name, $subpage = false, $fragment = '' ) {
                $name = SpecialPageFactory::getLocalNameFor( $name, $subpage );
+
                return Title::makeTitle( NS_SPECIAL, $name, $fragment );
        }
 
@@ -157,6 +158,7 @@ class SpecialPage {
         */
        function getFile() {
                wfDeprecated( __METHOD__, '1.18' );
+
                return $this->mFile;
        }
 
@@ -169,6 +171,7 @@ class SpecialPage {
        function isListed() {
                return $this->mListed;
        }
+
        /**
         * Set whether this page is listed in Special:Specialpages, at run-time
         * @since 1.3
@@ -178,6 +181,7 @@ class SpecialPage {
        function setListed( $listed ) {
                return wfSetVar( $this->mListed, $listed );
        }
+
        /**
         * Get or set whether this special page is listed in Special:SpecialPages
         * @since 1.6
@@ -213,6 +217,7 @@ class SpecialPage {
                if ( !isset( $this->mLocalName ) ) {
                        $this->mLocalName = SpecialPageFactory::getLocalNameFor( $this->mName );
                }
+
                return $this->mLocalName;
        }
 
@@ -348,7 +353,7 @@ class SpecialPage {
        function setHeaders() {
                $out = $this->getOutput();
                $out->setArticleRelated( false );
-               $out->setRobotPolicy( "noindex,nofollow" );
+               $out->setRobotPolicy( $this->getRobotPolicy() );
                $out->setPageTitle( $this->getDescription() );
        }
 
@@ -448,7 +453,6 @@ class SpecialPage {
                        $this->getOutput()->wrapWikiMsg(
                                "<div class='mw-specialpage-summary'>\n$1\n</div>", $msg );
                }
-
        }
 
        /**
@@ -473,6 +477,7 @@ class SpecialPage {
         */
        function getTitle( $subpage = false ) {
                wfDeprecated( __METHOD__, '1.23' );
+
                return $this->getPageTitle( $subpage );
        }
 
@@ -509,6 +514,7 @@ class SpecialPage {
                } else {
                        wfDebug( __METHOD__ . " called and \$mContext is null. " .
                                "Return RequestContext::getMain(); for sanity\n" );
+
                        return RequestContext::getMain();
                }
        }
@@ -562,6 +568,7 @@ class SpecialPage {
         */
        public function getLang() {
                wfDeprecated( __METHOD__, '1.19' );
+
                return $this->getLanguage();
        }
 
@@ -585,6 +592,17 @@ class SpecialPage {
                return $this->getContext()->getTitle();
        }
 
+       /**
+        * Return the robot policy. Derived classes that override this can change
+        * the robot policy set by setHeaders() from the default 'noindex,nofollow'.
+        *
+        * @return string
+        * @since 1.23
+        */
+       protected function getRobotPolicy() {
+               return 'noindex,nofollow';
+       }
+
        /**
         * Wrapper around wfMessage that sets the current context.
         *
@@ -603,6 +621,7 @@ class SpecialPage {
                if ( $this->including() ) {
                        $message->setInterfaceMessageFlag( false );
                }
+
                return $message;
        }