*/
public static function getTitleFor( $name, $subpage = false, $fragment = '' ) {
$name = SpecialPageFactory::getLocalNameFor( $name, $subpage );
+
return Title::makeTitle( NS_SPECIAL, $name, $fragment );
}
*/
function getFile() {
wfDeprecated( __METHOD__, '1.18' );
+
return $this->mFile;
}
function isListed() {
return $this->mListed;
}
+
/**
* Set whether this page is listed in Special:Specialpages, at run-time
* @since 1.3
function setListed( $listed ) {
return wfSetVar( $this->mListed, $listed );
}
+
/**
* Get or set whether this special page is listed in Special:SpecialPages
* @since 1.6
if ( !isset( $this->mLocalName ) ) {
$this->mLocalName = SpecialPageFactory::getLocalNameFor( $this->mName );
}
+
return $this->mLocalName;
}
function setHeaders() {
$out = $this->getOutput();
$out->setArticleRelated( false );
- $out->setRobotPolicy( "noindex,nofollow" );
+ $out->setRobotPolicy( $this->getRobotPolicy() );
$out->setPageTitle( $this->getDescription() );
}
$this->getOutput()->wrapWikiMsg(
"<div class='mw-specialpage-summary'>\n$1\n</div>", $msg );
}
-
}
/**
* @deprecated in 1.23, use SpecialPage::getPageTitle
*/
function getTitle( $subpage = false ) {
- wfDeprecated( __METHOD__, '1.23' );
return $this->getPageTitle( $subpage );
}
} else {
wfDebug( __METHOD__ . " called and \$mContext is null. " .
"Return RequestContext::getMain(); for sanity\n" );
+
return RequestContext::getMain();
}
}
*/
public function getLang() {
wfDeprecated( __METHOD__, '1.19' );
+
return $this->getLanguage();
}
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.
*
if ( $this->including() ) {
$message->setInterfaceMessageFlag( false );
}
+
return $message;
}