* Brad Jorsch
* Brent G
* Brianna Laugher
+* Carlin
* Daniel Arnold
* Danny B.
* FunPika
* ForeignApiRepos now fetch MIME types, rather than trying to figure it locally
* (bug 17570) $wgMaxRedirects is now correctly respected when following
redirects (was previously one more than $wgMaxRedirects)
+* (bug 16335) __NONEWSECTIONLINK__ magic word to suppress new section link.
== API changes in 1.15 ==
* (bug 16858) Revamped list=deletedrevs to make listing deleted contributions
'numberofusers',
'numberofactiveusers',
'newsectionlink',
+ 'nonewsectionlink',
'numberofpages',
'currentversion',
'basepagename',
'toc',
'noeditsection',
'newsectionlink',
+ 'nonewsectionlink',
'hiddencat',
'index',
'noindex',
var $mArticleBodyOnly = false;
var $mNewSectionLink = false;
+ var $mHideNewSectionLink = false;
var $mNoGallery = false;
var $mPageTitleActionText = '';
var $mParseWarnings = array();
$this->mLanguageLinks += $parserOutput->getLanguageLinks();
$this->addCategoryLinks( $parserOutput->getCategories() );
$this->mNewSectionLink = $parserOutput->getNewSection();
+ $this->mHideNewSectionLink = $parserOutput->getHideNewSection();
if( is_null( $wgExemptFromUserRobotsControl ) ) {
$bannedNamespaces = $wgContentNamespaces;
return $this->mNewSectionLink;
}
+ /**
+ * Forcibly hide the new section link?
+ *
+ * @return bool
+ */
+ public function forceHideNewSectionLink() {
+ return $this->mHideNewSectionLink;
+ }
+
/**
* Show a warning about slave lag
*
);
if ( $istalk || $wgOut->showNewSectionLink() ) {
- $content_actions['addsection'] = array(
- 'class' => $section == 'new'?'selected':false,
- 'text' => wfMsg('addsection'),
- 'href' => $this->mTitle->getLocalUrl( 'action=edit§ion=new' )
- );
+ if ( !$wgOut->forceHideNewSectionLink() ) {
+ $content_actions['addsection'] = array(
+ 'class' => $section == 'new' ? 'selected' : false,
+ 'text' => wfMsg('addsection'),
+ 'href' => $this->mTitle->getLocalUrl( 'action=edit§ion=new' )
+ );
+ }
}
} elseif ( $this->mTitle->isKnown() ) {
$content_actions['viewsource'] = array(
$this->mOutput->setNewSection( true );
}
+ # Allow user to remove the "new section"
+ # link via __NONEWSECTIONLINK__
+ if ( isset( $this->mDoubleUnderscores['nonewsectionlink'] ) ) {
+ $this->mOutput->hideNewSection( true );
+ }
+
# if the string __FORCETOC__ (not case-sensitive) occurs in the HTML,
# override above conditions and always show TOC above first header
if ( isset( $this->mDoubleUnderscores['forcetoc'] ) ) {
$mImages = array(), # DB keys of the images used, in the array key only
$mExternalLinks = array(), # External link URLs, in the key only
$mNewSection = false, # Show a new section link?
+ $mHideNewSection = false, # Hide the new section link?
$mNoGallery = false, # No gallery on category page? (__NOGALLERY__)
$mHeadItems = array(), # Items to put in the <head> section
$mOutputHooks = array(), # Hook tags as per $wgParserOutputHooks
function setNewSection( $value ) {
$this->mNewSection = (bool)$value;
}
+ function hideNewSection ( $value ) {
+ $this->mHideNewSection = (bool)$value;
+ }
+ function getHideNewSection () {
+ return (bool)$this->mHideNewSection;
+ }
function getNewSection() {
return (bool)$this->mNewSection;
}
'displaytitle' => array( 1, 'DISPLAYTITLE' ),
'rawsuffix' => array( 1, 'R' ),
'newsectionlink' => array( 1, '__NEWSECTIONLINK__' ),
+ 'nonewsectionlink' => array( 1, '__NONEWSECTIONLINK__' ),
'currentversion' => array( 1, 'CURRENTVERSION' ),
'urlencode' => array( 0, 'URLENCODE:' ),
'anchorencode' => array( 0, 'ANCHORENCODE' ),