public $mLanguageLinks;
/**
- * @var array $mCategoriesMap of category names to sort keys
+ * @var array $mCategories Map of category names to sort keys
*/
public $mCategories;
*/
public $mModules = [];
- /**
- * @var array $mModuleScripts Modules of which only the JS will be loaded by ResourceLoader.
- */
- public $mModuleScripts = [];
-
/**
* @var array $mModuleStyles Modules of which only the CSSS will be loaded by ResourceLoader.
*/
$text = preg_replace_callback(
self::EDITSECTION_REGEX,
function ( $m ) {
- global $wgOut, $wgLang;
$editsectionPage = Title::newFromText( htmlspecialchars_decode( $m[1] ) );
$editsectionSection = htmlspecialchars_decode( $m[2] );
$editsectionContent = isset( $m[4] ) ? Sanitizer::decodeCharReferences( $m[3] ) : null;
throw new MWException( "Bad parser output text." );
}
- $skin = $wgOut->getSkin();
- return $skin->doEditSectionLink( $editsectionPage,
+ $context = RequestContext::getMain();
+ return $context->getSkin()->doEditSectionLink(
+ $editsectionPage,
$editsectionSection,
$editsectionContent,
- $wgLang
+ $context->getLanguage()
);
},
$text
return $this->mSections;
}
- /**
- * @deprecated since 1.31 Use getText() options.
- */
- public function getEditSectionTokens() {
- wfDeprecated( __METHOD__, '1.31' );
- return true;
- }
-
public function &getLinks() {
return $this->mLinks;
}
public function setNoGallery( $value ) {
$this->mNoGallery = (bool)$value;
}
+
public function getNoGallery() {
return $this->mNoGallery;
}
return $this->mModules;
}
- public function getModuleScripts() {
- return $this->mModuleScripts;
- }
-
public function getModuleStyles() {
return $this->mModuleStyles;
}
return $this->mLimitReportJSData;
}
- /**
- * @deprecated since 1.31 Use getText() options.
- */
- public function getTOCEnabled() {
- wfDeprecated( __METHOD__, '1.31' );
- return true;
- }
-
public function getEnableOOUI() {
return $this->mEnableOOUI;
}
return wfSetVar( $this->mSections, $toc );
}
- /**
- * @deprecated since 1.31 Use getText() options.
- */
- public function setEditSectionTokens( $t ) {
- wfDeprecated( __METHOD__, '1.31' );
- return true;
- }
-
public function setIndexPolicy( $policy ) {
return wfSetVar( $this->mIndexPolicy, $policy );
}
return wfSetVar( $this->mTimestamp, $timestamp );
}
- /**
- * @deprecated since 1.31 Use getText() options.
- */
- public function setTOCEnabled( $flag ) {
- wfDeprecated( __METHOD__, '1.31' );
- return true;
- }
-
public function addCategory( $c, $sort ) {
$this->mCategories[$c] = $sort;
}
public function setNewSection( $value ) {
$this->mNewSection = (bool)$value;
}
+
public function hideNewSection( $value ) {
$this->mHideNewSection = (bool)$value;
}
+
public function getHideNewSection() {
return (bool)$this->mHideNewSection;
}
+
public function getNewSection() {
return (bool)$this->mNewSection;
}
$this->mModules = array_merge( $this->mModules, (array)$modules );
}
- /**
- * @deprecated since 1.31 Use addModules() instead.
- * @see OutputPage::addModuleScripts
- */
- public function addModuleScripts( $modules ) {
- $this->mModuleScripts = array_merge( $this->mModuleScripts, (array)$modules );
- }
-
/**
* @see OutputPage::addModuleStyles
*/
*/
public function addOutputPageMetadata( OutputPage $out ) {
$this->addModules( $out->getModules() );
- $this->addModuleScripts( $out->getModuleScripts() );
$this->addModuleStyles( $out->getModuleStyles() );
$this->addJsConfigVars( $out->getJsConfigVars() );
}
/**
- * Fairly generic flag setter thingy.
+ * Attach a flag to the output so that it can be checked later to handle special cases
+ *
* @param string $flag
*/
public function setFlag( $flag ) {
$this->mFlags[$flag] = true;
}
+ /**
+ * @param string $flag
+ * @return bool Whether the given flag was set to signify a special case
+ */
public function getFlag( $flag ) {
return isset( $this->mFlags[$flag] );
}
+ /**
+ * @return string[] List of flags signifying special cases
+ * @since 1.34
+ */
+ public function getAllFlags() {
+ return array_keys( $this->mFlags );
+ }
+
/**
* Set a property to be stored in the page_props database table.
*
* or null if no value was set for this key.
*/
public function getExtensionData( $key ) {
- if ( isset( $this->mExtensionData[$key] ) ) {
- return $this->mExtensionData[$key];
- }
-
- return null;
+ return $this->mExtensionData[$key] ?? null;
}
private static function getTimes( $clock = null ) {
// HTML and HTTP
$this->mHeadItems = self::mergeMixedList( $this->mHeadItems, $source->getHeadItems() );
$this->mModules = self::mergeList( $this->mModules, $source->getModules() );
- $this->mModuleScripts = self::mergeList( $this->mModuleScripts, $source->getModuleScripts() );
$this->mModuleStyles = self::mergeList( $this->mModuleStyles, $source->getModuleStyles() );
$this->mJsConfigVars = self::mergeMap( $this->mJsConfigVars, $source->getJsConfigVars() );
$this->mMaxAdaptiveExpiry = min( $this->mMaxAdaptiveExpiry, $source->mMaxAdaptiveExpiry );
// TODO: we'll have to be smarter about this!
$this->mSections = array_merge( $this->mSections, $source->getSections() );
- $this->mTOCHTML = $this->mTOCHTML . $source->mTOCHTML;
+ $this->mTOCHTML .= $source->mTOCHTML;
// XXX: we don't want to concatenate title text, so first write wins.
// We should use the first *modified* title text, but we don't have the original to check.