For environments post r70783, they will need to rerender pages with __NOEDITSECTION__ or no headings (hopefully those will be simple pages).
There will be no extra parser cache misses for environments pre r70783.
*/
$wgTranscludeCacheExpiry = 3600;
-/**
- * Output edit section links as tokens in the parser output for articles instead
- * of directly as markup.
- * This feature changes the default parser cache key so it's presented with a
- * configuration option so that large installations with a large number of already
- * existing parser cache keys can retain them.
- * The purpose of this feature is to allow skins to customize the editsection
- * links, however it has the side effect of also removing the most common use of
- * the getUserLang parser option which causes cache fragmentation by user lang.
- */
-$wgUseEditSectionTokens = true;
-
/** @} */ # end of parser settings }
/************************************************************************//**
$showEditLink = $this->mOptions->getEditSection();
}
if ( $showEditLink ) {
- $editLinkAsToken = $this->mOptions->getEditSectionTokens();
- if ( $editLinkAsToken ) {
- $this->mOutput->setEditSectionTokens( true );
- }
+ $this->mOutput->setEditSectionTokens( true );
}
# Get all headlines for numbering them and adding funky stuff like [edit]
# give headline the correct <h#> tag
if ( $showEditLink && $sectionIndex !== false ) {
- if ( $editLinkAsToken ) {
- // Output edit section links as markers with styles that can be customized by skins
- if ( $isTemplate ) {
- # Put a T flag in the section identifier, to indicate to extractSections()
- # that sections inside <includeonly> should be counted.
- $editlinkArgs = array( $titleText, "T-$sectionIndex"/*, null */ );
- } else {
- $editlinkArgs = array( $this->mTitle->getPrefixedText(), $sectionIndex, $headlineHint );
- }
- // We use a bit of pesudo-xml for editsection markers. The language converter is run later on
- // Using a UNIQ style marker leads to the converter screwing up the tokens when it converts stuff
- // And trying to insert strip tags fails too. At this point all real inputted tags have already been escaped
- // so we don't have to worry about a user trying to input one of these markers directly.
- // We use a page and section attribute to stop the language converter from converting these important bits
- // of data, but put the headline hint inside a content block because the language converter is supposed to
- // be able to convert that piece of data.
- $editlink = '<editsection page="' . htmlspecialchars($editlinkArgs[0]);
- $editlink .= '" section="' . htmlspecialchars($editlinkArgs[1]) .'"';
- if ( isset($editlinkArgs[2]) ) {
- $editlink .= '>' . $editlinkArgs[2] . '</editsection>';
- } else {
- $editlink .= '/>';
- }
+ // Output edit section links as markers with styles that can be customized by skins
+ if ( $isTemplate ) {
+ # Put a T flag in the section identifier, to indicate to extractSections()
+ # that sections inside <includeonly> should be counted.
+ $editlinkArgs = array( $titleText, "T-$sectionIndex"/*, null */ );
} else {
- // Output edit section links directly as markup like we used to
- if ( $isTemplate ) {
- # Put a T flag in the section identifier, to indicate to extractSections()
- # that sections inside <includeonly> should be counted.
- $editlink = $sk->doEditSectionLink( Title::newFromText( $titleText ), "T-$sectionIndex", null, $this->mOptions->getUserLang() );
- } else {
- $editlink = $sk->doEditSectionLink( $this->mTitle, $sectionIndex, $headlineHint, $this->mOptions->getUserLang() );
- }
+ $editlinkArgs = array( $this->mTitle->getPrefixedText(), $sectionIndex, $headlineHint );
+ }
+ // We use a bit of pesudo-xml for editsection markers. The language converter is run later on
+ // Using a UNIQ style marker leads to the converter screwing up the tokens when it converts stuff
+ // And trying to insert strip tags fails too. At this point all real inputted tags have already been escaped
+ // so we don't have to worry about a user trying to input one of these markers directly.
+ // We use a page and section attribute to stop the language converter from converting these important bits
+ // of data, but put the headline hint inside a content block because the language converter is supposed to
+ // be able to convert that piece of data.
+ $editlink = '<editsection page="' . htmlspecialchars($editlinkArgs[0]);
+ $editlink .= '" section="' . htmlspecialchars($editlinkArgs[1]) .'"';
+ if ( isset($editlinkArgs[2]) ) {
+ $editlink .= '>' . $editlinkArgs[2] . '</editsection>';
+ } else {
+ $editlink .= '/>';
}
} else {
$editlink = '';
var $mSkin = null; # Reference to the preferred skin
var $mDateFormat = null; # Date format index
var $mEditSection = true; # Create "edit section" links
- var $mEditSectionTokens = false; # Output replaceable tokens for editsections instead of markup
var $mAllowSpecialInclusion; # Allow inclusion of special pages
var $mTidy = false; # Ask for tidy cleanup
var $mInterfaceMessage = false; # Which lang to call for PLURAL and GRAMMAR
function getAllowExternalImages() { return $this->mAllowExternalImages; }
function getAllowExternalImagesFrom() { return $this->mAllowExternalImagesFrom; }
function getEnableImageWhitelist() { return $this->mEnableImageWhitelist; }
- function getEditSection() { $this->optionUsed('editsection');
- return $this->mEditSection; }
- function getEditSectionTokens() { $this->optionUsed('editsectiontokens');
- return $this->mEditSectionTokens; }
+ function getEditSection() { return $this->mEditSection; }
function getNumberHeadings() { $this->optionUsed('numberheadings');
return $this->mNumberHeadings; }
function getAllowSpecialInclusion() { return $this->mAllowSpecialInclusion; }
function setEnableImageWhitelist( $x ) { return wfSetVar( $this->mEnableImageWhitelist, $x ); }
function setDateFormat( $x ) { return wfSetVar( $this->mDateFormat, $x ); }
function setEditSection( $x ) { return wfSetVar( $this->mEditSection, $x ); }
- function setEditSectionTokens( $x ) { return wfSetVar( $this->mEditSectionTokens, $x ); }
function setNumberHeadings( $x ) { return wfSetVar( $this->mNumberHeadings, $x ); }
function setAllowSpecialInclusion( $x ) { return wfSetVar( $this->mAllowSpecialInclusion, $x ); }
function setTidy( $x ) { return wfSetVar( $this->mTidy, $x); }
function initialiseFromUser( $userInput ) {
global $wgUseDynamicDates, $wgInterwikiMagic, $wgAllowExternalImages;
global $wgAllowExternalImagesFrom, $wgEnableImageWhitelist, $wgAllowSpecialInclusion, $wgMaxArticleSize;
- global $wgMaxPPNodeCount, $wgMaxTemplateDepth, $wgMaxPPExpandDepth, $wgCleanSignatures, $wgUseEditSectionTokens;
+ global $wgMaxPPNodeCount, $wgMaxTemplateDepth, $wgMaxPPExpandDepth, $wgCleanSignatures;
global $wgExternalLinkTarget, $wgLang;
wfProfileIn( __METHOD__ );
$this->mMaxTemplateDepth = $wgMaxTemplateDepth;
$this->mCleanSignatures = $wgCleanSignatures;
$this->mExternalLinkTarget = $wgExternalLinkTarget;
- $this->mEditSectionTokens = $wgUseEditSectionTokens;
$this->mNumberHeadings = $user->getOption( 'numberheadings' );
$this->mMath = $user->getOption( 'math' );
$confstr .= $wgRenderHashAppend;
- if ( !$this->mEditSection && in_array( 'editsection', $forOptions ) )
+ if ( !in_array( 'editsection', $forOptions ) ) {
+ $confstr .= '!*';
+ } elseif ( !$this->mEditSection ) {
$confstr .= '!edit=0';
- if ( $this->mEditSectionTokens && in_array( 'editsectiontokens', $forOptions ) )
- $confstr .= '!estok=1';
+ }
+
if ( $this->mIsPrintable && in_array( 'printable', $forOptions ) )
$confstr .= '!printable=1';