Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -3697,10 +3697,7 @@ |
3698 | 3698 | $showEditLink = $this->mOptions->getEditSection(); |
3699 | 3699 | } |
3700 | 3700 | if ( $showEditLink ) { |
3701 | | - $editLinkAsToken = $this->mOptions->getEditSectionTokens(); |
3702 | | - if ( $editLinkAsToken ) { |
3703 | | - $this->mOutput->setEditSectionTokens( true ); |
3704 | | - } |
| 3701 | + $this->mOutput->setEditSectionTokens( true ); |
3705 | 3702 | } |
3706 | 3703 | |
3707 | 3704 | # Get all headlines for numbering them and adding funky stuff like [edit] |
— | — | @@ -3955,39 +3952,28 @@ |
3956 | 3953 | |
3957 | 3954 | # give headline the correct <h#> tag |
3958 | 3955 | if ( $showEditLink && $sectionIndex !== false ) { |
3959 | | - if ( $editLinkAsToken ) { |
3960 | | - // Output edit section links as markers with styles that can be customized by skins |
3961 | | - if ( $isTemplate ) { |
3962 | | - # Put a T flag in the section identifier, to indicate to extractSections() |
3963 | | - # that sections inside <includeonly> should be counted. |
3964 | | - $editlinkArgs = array( $titleText, "T-$sectionIndex"/*, null */ ); |
3965 | | - } else { |
3966 | | - $editlinkArgs = array( $this->mTitle->getPrefixedText(), $sectionIndex, $headlineHint ); |
3967 | | - } |
3968 | | - // We use a bit of pesudo-xml for editsection markers. The language converter is run later on |
3969 | | - // Using a UNIQ style marker leads to the converter screwing up the tokens when it converts stuff |
3970 | | - // And trying to insert strip tags fails too. At this point all real inputted tags have already been escaped |
3971 | | - // so we don't have to worry about a user trying to input one of these markers directly. |
3972 | | - // We use a page and section attribute to stop the language converter from converting these important bits |
3973 | | - // of data, but put the headline hint inside a content block because the language converter is supposed to |
3974 | | - // be able to convert that piece of data. |
3975 | | - $editlink = '<editsection page="' . htmlspecialchars($editlinkArgs[0]); |
3976 | | - $editlink .= '" section="' . htmlspecialchars($editlinkArgs[1]) .'"'; |
3977 | | - if ( isset($editlinkArgs[2]) ) { |
3978 | | - $editlink .= '>' . $editlinkArgs[2] . '</editsection>'; |
3979 | | - } else { |
3980 | | - $editlink .= '/>'; |
3981 | | - } |
| 3956 | + // Output edit section links as markers with styles that can be customized by skins |
| 3957 | + if ( $isTemplate ) { |
| 3958 | + # Put a T flag in the section identifier, to indicate to extractSections() |
| 3959 | + # that sections inside <includeonly> should be counted. |
| 3960 | + $editlinkArgs = array( $titleText, "T-$sectionIndex"/*, null */ ); |
3982 | 3961 | } else { |
3983 | | - // Output edit section links directly as markup like we used to |
3984 | | - if ( $isTemplate ) { |
3985 | | - # Put a T flag in the section identifier, to indicate to extractSections() |
3986 | | - # that sections inside <includeonly> should be counted. |
3987 | | - $editlink = $sk->doEditSectionLink( Title::newFromText( $titleText ), "T-$sectionIndex", null, $this->mOptions->getUserLang() ); |
3988 | | - } else { |
3989 | | - $editlink = $sk->doEditSectionLink( $this->mTitle, $sectionIndex, $headlineHint, $this->mOptions->getUserLang() ); |
3990 | | - } |
| 3962 | + $editlinkArgs = array( $this->mTitle->getPrefixedText(), $sectionIndex, $headlineHint ); |
3991 | 3963 | } |
| 3964 | + // We use a bit of pesudo-xml for editsection markers. The language converter is run later on |
| 3965 | + // Using a UNIQ style marker leads to the converter screwing up the tokens when it converts stuff |
| 3966 | + // And trying to insert strip tags fails too. At this point all real inputted tags have already been escaped |
| 3967 | + // so we don't have to worry about a user trying to input one of these markers directly. |
| 3968 | + // We use a page and section attribute to stop the language converter from converting these important bits |
| 3969 | + // of data, but put the headline hint inside a content block because the language converter is supposed to |
| 3970 | + // be able to convert that piece of data. |
| 3971 | + $editlink = '<editsection page="' . htmlspecialchars($editlinkArgs[0]); |
| 3972 | + $editlink .= '" section="' . htmlspecialchars($editlinkArgs[1]) .'"'; |
| 3973 | + if ( isset($editlinkArgs[2]) ) { |
| 3974 | + $editlink .= '>' . $editlinkArgs[2] . '</editsection>'; |
| 3975 | + } else { |
| 3976 | + $editlink .= '/>'; |
| 3977 | + } |
3992 | 3978 | } else { |
3993 | 3979 | $editlink = ''; |
3994 | 3980 | } |
Index: trunk/phase3/includes/parser/ParserOptions.php |
— | — | @@ -21,7 +21,6 @@ |
22 | 22 | var $mSkin = null; # Reference to the preferred skin |
23 | 23 | var $mDateFormat = null; # Date format index |
24 | 24 | var $mEditSection = true; # Create "edit section" links |
25 | | - var $mEditSectionTokens = false; # Output replaceable tokens for editsections instead of markup |
26 | 25 | var $mAllowSpecialInclusion; # Allow inclusion of special pages |
27 | 26 | var $mTidy = false; # Ask for tidy cleanup |
28 | 27 | var $mInterfaceMessage = false; # Which lang to call for PLURAL and GRAMMAR |
— | — | @@ -57,10 +56,7 @@ |
58 | 57 | function getAllowExternalImages() { return $this->mAllowExternalImages; } |
59 | 58 | function getAllowExternalImagesFrom() { return $this->mAllowExternalImagesFrom; } |
60 | 59 | function getEnableImageWhitelist() { return $this->mEnableImageWhitelist; } |
61 | | - function getEditSection() { $this->optionUsed('editsection'); |
62 | | - return $this->mEditSection; } |
63 | | - function getEditSectionTokens() { $this->optionUsed('editsectiontokens'); |
64 | | - return $this->mEditSectionTokens; } |
| 60 | + function getEditSection() { return $this->mEditSection; } |
65 | 61 | function getNumberHeadings() { $this->optionUsed('numberheadings'); |
66 | 62 | return $this->mNumberHeadings; } |
67 | 63 | function getAllowSpecialInclusion() { return $this->mAllowSpecialInclusion; } |
— | — | @@ -126,7 +122,6 @@ |
127 | 123 | function setEnableImageWhitelist( $x ) { return wfSetVar( $this->mEnableImageWhitelist, $x ); } |
128 | 124 | function setDateFormat( $x ) { return wfSetVar( $this->mDateFormat, $x ); } |
129 | 125 | function setEditSection( $x ) { return wfSetVar( $this->mEditSection, $x ); } |
130 | | - function setEditSectionTokens( $x ) { return wfSetVar( $this->mEditSectionTokens, $x ); } |
131 | 126 | function setNumberHeadings( $x ) { return wfSetVar( $this->mNumberHeadings, $x ); } |
132 | 127 | function setAllowSpecialInclusion( $x ) { return wfSetVar( $this->mAllowSpecialInclusion, $x ); } |
133 | 128 | function setTidy( $x ) { return wfSetVar( $this->mTidy, $x); } |
— | — | @@ -175,7 +170,7 @@ |
176 | 171 | function initialiseFromUser( $userInput ) { |
177 | 172 | global $wgUseDynamicDates, $wgInterwikiMagic, $wgAllowExternalImages; |
178 | 173 | global $wgAllowExternalImagesFrom, $wgEnableImageWhitelist, $wgAllowSpecialInclusion, $wgMaxArticleSize; |
179 | | - global $wgMaxPPNodeCount, $wgMaxTemplateDepth, $wgMaxPPExpandDepth, $wgCleanSignatures, $wgUseEditSectionTokens; |
| 174 | + global $wgMaxPPNodeCount, $wgMaxTemplateDepth, $wgMaxPPExpandDepth, $wgCleanSignatures; |
180 | 175 | global $wgExternalLinkTarget, $wgLang; |
181 | 176 | |
182 | 177 | wfProfileIn( __METHOD__ ); |
— | — | @@ -205,7 +200,6 @@ |
206 | 201 | $this->mMaxTemplateDepth = $wgMaxTemplateDepth; |
207 | 202 | $this->mCleanSignatures = $wgCleanSignatures; |
208 | 203 | $this->mExternalLinkTarget = $wgExternalLinkTarget; |
209 | | - $this->mEditSectionTokens = $wgUseEditSectionTokens; |
210 | 204 | |
211 | 205 | $this->mNumberHeadings = $user->getOption( 'numberheadings' ); |
212 | 206 | $this->mMath = $user->getOption( 'math' ); |
— | — | @@ -310,10 +304,12 @@ |
311 | 305 | |
312 | 306 | $confstr .= $wgRenderHashAppend; |
313 | 307 | |
314 | | - if ( !$this->mEditSection && in_array( 'editsection', $forOptions ) ) |
| 308 | + if ( !in_array( 'editsection', $forOptions ) ) { |
| 309 | + $confstr .= '!*'; |
| 310 | + } elseif ( !$this->mEditSection ) { |
315 | 311 | $confstr .= '!edit=0'; |
316 | | - if ( $this->mEditSectionTokens && in_array( 'editsectiontokens', $forOptions ) ) |
317 | | - $confstr .= '!estok=1'; |
| 312 | + } |
| 313 | + |
318 | 314 | if ( $this->mIsPrintable && in_array( 'printable', $forOptions ) ) |
319 | 315 | $confstr .= '!printable=1'; |
320 | 316 | |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -2846,18 +2846,6 @@ |
2847 | 2847 | */ |
2848 | 2848 | $wgTranscludeCacheExpiry = 3600; |
2849 | 2849 | |
2850 | | -/** |
2851 | | - * Output edit section links as tokens in the parser output for articles instead |
2852 | | - * of directly as markup. |
2853 | | - * This feature changes the default parser cache key so it's presented with a |
2854 | | - * configuration option so that large installations with a large number of already |
2855 | | - * existing parser cache keys can retain them. |
2856 | | - * The purpose of this feature is to allow skins to customize the editsection |
2857 | | - * links, however it has the side effect of also removing the most common use of |
2858 | | - * the getUserLang parser option which causes cache fragmentation by user lang. |
2859 | | - */ |
2860 | | -$wgUseEditSectionTokens = true; |
2861 | | - |
2862 | 2850 | /** @} */ # end of parser settings } |
2863 | 2851 | |
2864 | 2852 | /************************************************************************//** |