$wgOut->addPrimaryWikiText( $text, $this );
} else {
# Display content, don't attempt to save to parser cache
-
# Don't show section-edit links on old revisions... this way lies madness.
if( !$this->isCurrent() ) {
$oldEditSectionSetting = $wgOut->mParserOptions->setEditSection( false );
if( empty( $t ) ) {
$wgOut->setPageTitle( $this->mTitle->getPrefixedText() );
}
-
+
# check if we're displaying a [[User talk:x.x.x.x]] anonymous talk page
if( $ns == NS_USER_TALK &&
User::isIP( $this->mTitle->getText() ) ) {
global $wgOut, $wgRequest;
$from = $wgRequest->getVal( 'from' );
$until = $wgRequest->getVal( 'until' );
+
+ global $wgCategoryMagicGallery;
+ $cmg = $wgCategoryMagicGallery;
+ $wgCategoryMagicGallery = !$wgOut->mNoGallery;
$wgOut->addHTML( $this->doCategoryMagic( $from, $until ) );
+ $wgCategoryMagicGallery = $cmg;
}
/**
'MAG_LANGUAGE',
'MAG_CONTENTLANGUAGE',
'MAG_PAGESINNAMESPACE',
+ 'MAG_NOGALLERY',
);
if ( ! defined( 'MEDIAWIKI_INSTALL' ) )
wfRunHooks( 'MagicWordMagicWords', array( &$magicWords ) );
$this->addParserOutputNoText( $parserOutput );
$text = $parserOutput->getText();
+ $this->mNoGallery = $parserOutput->getNoGallery();
wfRunHooks( 'OutputPageBeforeHTML',array( &$this, &$text ) );
$parserOutput->setText( $text );
$this->addHTML( $parserOutput->getText() );
$this->addCategoryLinks( $parserOutput->getCategories() );
$this->addKeywords( $parserOutput );
$this->mNewSectionLink = $parserOutput->getNewSection();
+ $this->mNoGallery = $parserOutput->getNoGallery();
$text = $parserOutput->getText();
wfRunHooks( 'OutputPageBeforeHTML', array( &$this, &$text ) );
$this->addHTML( $text );
$text = preg_replace( '/(^|\n)-----*/', '\\1<hr />', $text );
$text = $this->stripToc( $text );
+ $this->stripNoGallery( $text );
$text = $this->doHeadings( $text );
if($this->mOptions->getUseDynamicDates()) {
$df =& DateFormatter::getInstance();
}
}
+ /**
+ * Detect __NOGALLERY__ magic word and set a placeholder
+ */
+ function stripNoGallery( &$text ) {
+ # if the string __NOGALLERY__ (not case-sensitive) occurs in the HTML,
+ # do not add TOC
+ $mw = MagicWord::get( MAG_NOGALLERY );
+ $this->mOutput->mNoGallery = $mw->matchAndRemove( $text ) ;
+ }
+
/**
* Detect __TOC__ magic word and set a placeholder
*/
$mExternalLinks, # External link URLs, in the key only
$mHTMLtitle, # Display HTML title
$mSubtitle, # Additional subtitle
- $mNewSection; # Show a new section link?
+ $mNewSection, # Show a new section link?
+ $mNoGallery; # No gallery on category page? (__NOGALLERY__)
function ParserOutput( $text = '', $languageLinks = array(), $categoryLinks = array(),
$containsOldMagic = false, $titletext = '' )
$this->mHTMLtitle = "" ;
$this->mSubtitle = "" ;
$this->mNewSection = false;
+ $this->mNoGallery = false;
}
function getText() { return $this->mText; }
function &getTemplates() { return $this->mTemplates; }
function &getImages() { return $this->mImages; }
function &getExternalLinks() { return $this->mExternalLinks; }
+ function getNoGallery() { return $this->mNoGallery; }
function containsOldMagic() { return $this->mContainsOldMagic; }
function setText( $text ) { return wfSetVar( $this->mText, $text ); }
# ID CASE SYNONYMS
MAG_REDIRECT => array( 0, '#REDIRECT' ),
MAG_NOTOC => array( 0, '__NOTOC__' ),
+ MAG_NOGALLERY => array( 0, '__NOGALLERY__' ),
MAG_FORCETOC => array( 0, '__FORCETOC__' ),
MAG_TOC => array( 0, '__TOC__' ),
MAG_NOEDITSECTION => array( 0, '__NOEDITSECTION__' ),