public $mText, # The output text
$mLanguageLinks, # List of the full text of language links, in the order they appear
$mCategories, # Map of category names to sort keys
+ $mIndicators = array(), # Page status indicators, usually displayed in top-right corner
$mTitleText, # title text of the chosen language variant
$mLinks = array(), # 2-D map of NS/DBK to ID for the links in the document. ID=zero for broken.
$mTemplates = array(), # 2-D map of NS/DBK to ID for the template references. ID=zero for broken.
$mTOCHTML = '', # HTML of the TOC
$mTimestamp, # Timestamp of the revision
$mTOCEnabled = true; # Whether TOC should be shown, can't override __NOTOC__
- private $mIndexPolicy = ''; # 'index' or 'noindex'? Any other value will result in no change.
- private $mAccessedOptions = array(); # List of ParserOptions (stored in the keys)
- private $mSecondaryDataUpdates = array(); # List of DataUpdate, used to save info from the page somewhere else.
- private $mExtensionData = array(); # extra data used by extensions
- private $mLimitReportData = array(); # Parser limit report data
- private $mParseStartTime = array(); # Timestamps for getTimeSinceStart()
- private $mPreventClickjacking = false; # Whether to emit X-Frame-Options: DENY
+ private $mIndexPolicy = ''; # 'index' or 'noindex'? Any other value will result in no change.
+ private $mAccessedOptions = array(); # List of ParserOptions (stored in the keys)
+ private $mSecondaryDataUpdates = array(); # List of DataUpdate, used to save info from the page somewhere else.
+ private $mExtensionData = array(); # extra data used by extensions
+ private $mLimitReportData = array(); # Parser limit report data
+ private $mParseStartTime = array(); # Timestamps for getTimeSinceStart()
+ private $mPreventClickjacking = false; # Whether to emit X-Frame-Options: DENY
const EDITSECTION_REGEX =
'#<(?:mw:)?editsection page="(.*?)" section="(.*?)"(?:/>|>(.*?)(</(?:mw:)?editsection>))#';
}
public function getText() {
- wfProfileIn( __METHOD__ );
$text = $this->mText;
if ( $this->mEditSectionTokens ) {
$text = preg_replace_callback(
$text
);
}
- wfProfileOut( __METHOD__ );
return $text;
}
return $this->mCategories;
}
+ /**
+ * @since 1.25
+ */
+ public function getIndicators() {
+ return $this->mIndicators;
+ }
+
public function getTitleText() {
return $this->mTitleText;
}
$this->mCategories[$c] = $sort;
}
+ /**
+ * @since 1.25
+ */
+ public function setIndicator( $id, $content ) {
+ $this->mIndicators[$id] = $content;
+ }
+
public function addLanguageLink( $t ) {
$this->mLanguageLinks[] = $t;
}
$this->mPreventClickjacking = $this->mPreventClickjacking || $out->getPreventClickjacking();
}
+ /**
+ * Add a tracking category, getting the title from a system message,
+ * or print a debug message if the title is invalid.
+ *
+ * Please add any message that you use with this function to
+ * $wgTrackingCategories. That way they will be listed on
+ * Special:TrackingCategories.
+ *
+ * @param string $msg Message key
+ * @param Title $title title of the page which is being tracked
+ * @return bool Whether the addition was successful
+ * @since 1.25
+ */
+ public function addTrackingCategory( $msg, $title ) {
+ if ( $title->getNamespace() === NS_SPECIAL ) {
+ wfDebug( __METHOD__ . ": Not adding tracking category $msg to special page!\n" );
+ return false;
+ }
+
+ // Important to parse with correct title (bug 31469)
+ $cat = wfMessage( $msg )
+ ->title( $title )
+ ->inContentLanguage()
+ ->text();
+
+ # Allow tracking categories to be disabled by setting them to "-"
+ if ( $cat === '-' ) {
+ return false;
+ }
+
+ $containerCategory = Title::makeTitleSafe( NS_CATEGORY, $cat );
+ if ( $containerCategory ) {
+ $this->addCategory( $containerCategory->getDBkey(), $this->getProperty( 'defaultsort' ) ?: '' );
+ return true;
+ } else {
+ wfDebug( __METHOD__ . ": [[MediaWiki:$msg]] is not a valid title!\n" );
+ return false;
+ }
+ }
+
/**
* Override the title to be used for display
* -- this is assumed to have been validated
}
/**
- * Save space for for serialization by removing useless values
+ * Save space for serialization by removing useless values
* @return array
*/
public function __sleep() {