Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -690,11 +690,13 @@ |
691 | 691 | ); |
692 | 692 | |
693 | 693 | if ( $istalk || $wgOut->showNewSectionLink() ) { |
694 | | - $content_actions['addsection'] = array( |
695 | | - 'class' => $section == 'new'?'selected':false, |
696 | | - 'text' => wfMsg('addsection'), |
697 | | - 'href' => $this->mTitle->getLocalUrl( 'action=edit§ion=new' ) |
698 | | - ); |
| 694 | + if ( !$wgOut->forceHideNewSectionLink() ) { |
| 695 | + $content_actions['addsection'] = array( |
| 696 | + 'class' => $section == 'new' ? 'selected' : false, |
| 697 | + 'text' => wfMsg('addsection'), |
| 698 | + 'href' => $this->mTitle->getLocalUrl( 'action=edit§ion=new' ) |
| 699 | + ); |
| 700 | + } |
699 | 701 | } |
700 | 702 | } elseif ( $this->mTitle->isKnown() ) { |
701 | 703 | $content_actions['viewsource'] = array( |
Index: trunk/phase3/includes/MagicWord.php |
— | — | @@ -92,6 +92,7 @@ |
93 | 93 | 'numberofusers', |
94 | 94 | 'numberofactiveusers', |
95 | 95 | 'newsectionlink', |
| 96 | + 'nonewsectionlink', |
96 | 97 | 'numberofpages', |
97 | 98 | 'currentversion', |
98 | 99 | 'basepagename', |
— | — | @@ -160,6 +161,7 @@ |
161 | 162 | 'toc', |
162 | 163 | 'noeditsection', |
163 | 164 | 'newsectionlink', |
| 165 | + 'nonewsectionlink', |
164 | 166 | 'hiddencat', |
165 | 167 | 'index', |
166 | 168 | 'noindex', |
Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -3388,6 +3388,12 @@ |
3389 | 3389 | $this->mOutput->setNewSection( true ); |
3390 | 3390 | } |
3391 | 3391 | |
| 3392 | + # Allow user to remove the "new section" |
| 3393 | + # link via __NONEWSECTIONLINK__ |
| 3394 | + if ( isset( $this->mDoubleUnderscores['nonewsectionlink'] ) ) { |
| 3395 | + $this->mOutput->hideNewSection( true ); |
| 3396 | + } |
| 3397 | + |
3392 | 3398 | # if the string __FORCETOC__ (not case-sensitive) occurs in the HTML, |
3393 | 3399 | # override above conditions and always show TOC above first header |
3394 | 3400 | if ( isset( $this->mDoubleUnderscores['forcetoc'] ) ) { |
Index: trunk/phase3/includes/parser/ParserOutput.php |
— | — | @@ -18,6 +18,7 @@ |
19 | 19 | $mImages = array(), # DB keys of the images used, in the array key only |
20 | 20 | $mExternalLinks = array(), # External link URLs, in the key only |
21 | 21 | $mNewSection = false, # Show a new section link? |
| 22 | + $mHideNewSection = false, # Hide the new section link? |
22 | 23 | $mNoGallery = false, # No gallery on category page? (__NOGALLERY__) |
23 | 24 | $mHeadItems = array(), # Items to put in the <head> section |
24 | 25 | $mOutputHooks = array(), # Hook tags as per $wgParserOutputHooks |
— | — | @@ -80,6 +81,12 @@ |
81 | 82 | function setNewSection( $value ) { |
82 | 83 | $this->mNewSection = (bool)$value; |
83 | 84 | } |
| 85 | + function hideNewSection ( $value ) { |
| 86 | + $this->mHideNewSection = (bool)$value; |
| 87 | + } |
| 88 | + function getHideNewSection () { |
| 89 | + return (bool)$this->mHideNewSection; |
| 90 | + } |
84 | 91 | function getNewSection() { |
85 | 92 | return (bool)$this->mNewSection; |
86 | 93 | } |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -29,6 +29,7 @@ |
30 | 30 | var $mArticleBodyOnly = false; |
31 | 31 | |
32 | 32 | var $mNewSectionLink = false; |
| 33 | + var $mHideNewSectionLink = false; |
33 | 34 | var $mNoGallery = false; |
34 | 35 | var $mPageTitleActionText = ''; |
35 | 36 | var $mParseWarnings = array(); |
— | — | @@ -516,6 +517,7 @@ |
517 | 518 | $this->mLanguageLinks += $parserOutput->getLanguageLinks(); |
518 | 519 | $this->addCategoryLinks( $parserOutput->getCategories() ); |
519 | 520 | $this->mNewSectionLink = $parserOutput->getNewSection(); |
| 521 | + $this->mHideNewSectionLink = $parserOutput->getHideNewSection(); |
520 | 522 | |
521 | 523 | if( is_null( $wgExemptFromUserRobotsControl ) ) { |
522 | 524 | $bannedNamespaces = $wgContentNamespaces; |
— | — | @@ -1778,6 +1780,15 @@ |
1779 | 1781 | } |
1780 | 1782 | |
1781 | 1783 | /** |
| 1784 | + * Forcibly hide the new section link? |
| 1785 | + * |
| 1786 | + * @return bool |
| 1787 | + */ |
| 1788 | + public function forceHideNewSectionLink() { |
| 1789 | + return $this->mHideNewSectionLink; |
| 1790 | + } |
| 1791 | + |
| 1792 | + /** |
1782 | 1793 | * Show a warning about slave lag |
1783 | 1794 | * |
1784 | 1795 | * If the lag is higher than $wgSlaveLagCritical seconds, |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -311,6 +311,7 @@ |
312 | 312 | 'displaytitle' => array( 1, 'DISPLAYTITLE' ), |
313 | 313 | 'rawsuffix' => array( 1, 'R' ), |
314 | 314 | 'newsectionlink' => array( 1, '__NEWSECTIONLINK__' ), |
| 315 | + 'nonewsectionlink' => array( 1, '__NONEWSECTIONLINK__' ), |
315 | 316 | 'currentversion' => array( 1, 'CURRENTVERSION' ), |
316 | 317 | 'urlencode' => array( 0, 'URLENCODE:' ), |
317 | 318 | 'anchorencode' => array( 0, 'ANCHORENCODE' ), |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -197,6 +197,7 @@ |
198 | 198 | * ForeignApiRepos now fetch MIME types, rather than trying to figure it locally |
199 | 199 | * (bug 17570) $wgMaxRedirects is now correctly respected when following |
200 | 200 | redirects (was previously one more than $wgMaxRedirects) |
| 201 | +* (bug 16335) __NONEWSECTIONLINK__ magic word to suppress new section link. |
201 | 202 | |
202 | 203 | == API changes in 1.15 == |
203 | 204 | * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions |
Index: trunk/phase3/CREDITS |
— | — | @@ -59,6 +59,7 @@ |
60 | 60 | * Brad Jorsch |
61 | 61 | * Brent G |
62 | 62 | * Brianna Laugher |
| 63 | +* Carlin |
63 | 64 | * Daniel Arnold |
64 | 65 | * Danny B. |
65 | 66 | * FunPika |