*/
private $mEnableTOC = false;
- /**
- * @var bool Whether parser output should contain section edit links
- */
- private $mEnableSectionEditLinks = true;
-
/**
* @var string|null The URL to send in a <link> element with rel=license
*/
* Filter an array of modules to remove insufficiently trustworthy members, and modules
* which are no longer registered (eg a page is cached before an extension is disabled)
* @param array $modules
- * @param string|null $position If not null, only return modules with this position
+ * @param string|null $position Unused
* @param string $type
* @return array
*/
$module = $resourceLoader->getModule( $val );
if ( $module instanceof ResourceLoaderModule
&& $module->getOrigin() <= $this->getAllowedModules( $type )
- && ( is_null( $position ) || $module->getPosition() == $position )
) {
if ( $this->mTarget && !in_array( $this->mTarget, $module->getTargets() ) ) {
$this->warnModuleTargetFilter( $module->getName() );
* Get the list of modules to include on this page
*
* @param bool $filter Whether to filter out insufficiently trustworthy modules
- * @param string|null $position If not null, only return modules with this position
+ * @param string|null $position Unused
* @param string $param
* @param string $type
* @return array Array of module names
) {
$modules = array_values( array_unique( $this->$param ) );
return $filter
- ? $this->filterModules( $modules, $position, $type )
+ ? $this->filterModules( $modules, null, $type )
: $modules;
}
* Get the list of module JS to include on this page
*
* @param bool $filter
- * @param string|null $position
+ * @param string|null $position Unused
* @return array Array of module names
*/
public function getModuleScripts( $filter = false, $position = null ) {
- return $this->getModules( $filter, $position, 'mModuleScripts',
+ return $this->getModules( $filter, null, 'mModuleScripts',
ResourceLoaderModule::TYPE_SCRIPTS
);
}
* Get the list of module CSS to include on this page
*
* @param bool $filter
- * @param string|null $position
+ * @param string|null $position Unused
* @return array Array of module names
*/
public function getModuleStyles( $filter = false, $position = null ) {
- return $this->getModules( $filter, $position, 'mModuleStyles',
+ return $this->getModules( $filter, null, 'mModuleStyles',
ResourceLoaderModule::TYPE_STYLES
);
}
// Someone is trying to set a bogus pre-$wgUser PO. Check if it has
// been changed somehow, and keep it if so.
$anonPO = ParserOptions::newFromAnon();
- $anonPO->setEditSection( false );
$anonPO->setAllowUnsafeRawHtml( false );
if ( !$options->matches( $anonPO ) ) {
wfLogWarning( __METHOD__ . ': Setting a changed bogus ParserOptions: ' . wfGetAllCallers( 5 ) );
// ParserOptions for it. And don't cache this ParserOptions
// either.
$po = ParserOptions::newFromAnon();
- $po->setEditSection( false );
$po->setAllowUnsafeRawHtml( false );
$po->isBogus = true;
if ( $options !== null ) {
}
$this->mParserOptions = ParserOptions::newFromContext( $this->getContext() );
- $this->mParserOptions->setEditSection( false );
$this->mParserOptions->setAllowUnsafeRawHtml( false );
}
// so that extensions may modify ParserOutput to toggle TOC.
// This cannot be moved to addParserOutputText because that is not
// called by EditPage for Preview.
- if ( $parserOutput->getTOCEnabled() && $parserOutput->getTOCHTML() ) {
+ if ( $parserOutput->getTOCHTML() ) {
$this->mEnableTOC = true;
}
}
*/
function addParserOutput( $parserOutput, $poOptions = [] ) {
$this->addParserOutputMetadata( $parserOutput );
-
- // Touch section edit links only if not previously disabled
- if ( $parserOutput->getEditSectionTokens() ) {
- $parserOutput->setEditSectionTokens( $this->mEnableSectionEditLinks );
- }
- if ( !$this->mEnableSectionEditLinks
- && !array_key_exists( 'enableSectionEditLinks', $poOptions )
- ) {
- $poOptions['enableSectionEditLinks'] = false;
- }
-
$this->addParserOutputText( $parserOutput, $poOptions );
}
}
/**
- * JS stuff to put at the bottom of the `<body>`. These are modules with position 'bottom',
- * legacy scripts ($this->mScripts), and user JS.
+ * JS stuff to put at the bottom of the `<body>`.
+ * These are legacy scripts ($this->mScripts), and user JS.
*
* @return string|WrappedStringList HTML
*/
* @deprecated since 1.31, use $poOptions to addParserOutput() instead.
*/
public function enableSectionEditLinks( $flag = true ) {
- $this->mEnableSectionEditLinks = $flag;
+ wfDeprecated( __METHOD__, '1.31' );
}
/**
* @deprecated since 1.31, use $poOptions to addParserOutput() instead.
*/
public function sectionEditLinksEnabled() {
- return $this->mEnableSectionEditLinks;
+ wfDeprecated( __METHOD__, '1.31' );
+ return true;
}
/**