$mOutputHooks = array(), # Hook tags as per $wgParserOutputHooks
$mWarnings = array(), # Warning text to be returned to the user. Wikitext formatted, in the key only
$mSections = array(), # Table of contents
- $mProperties = array(); # Name/value pairs to be cached in the DB
+ $mProperties = array(), # Name/value pairs to be cached in the DB
+ $mTOCHTML = ''; # HTML of the TOC
private $mIndexPolicy = ''; # 'index' or 'noindex'? Any other value will result in no change.
/**
function getOutputHooks() { return (array)$this->mOutputHooks; }
function getWarnings() { return array_keys( $this->mWarnings ); }
function getIndexPolicy() { return $this->mIndexPolicy; }
+ function getTOCHTML() { return $this->mTOCHTML; }
function containsOldMagic() { return $this->mContainsOldMagic; }
function setText( $text ) { return wfSetVar( $this->mText, $text ); }
function setTitleText( $t ) { return wfSetVar( $this->mTitleText, $t ); }
function setSections( $toc ) { return wfSetVar( $this->mSections, $toc ); }
function setIndexPolicy( $policy ) { return wfSetVar( $this->mIndexPolicy, $policy ); }
+ function setTOCHTML( $tochtml ) { return wfSetVar( $this->mTOCHTML, $tochtml ); }
function addCategory( $c, $sort ) { $this->mCategories[$c] = $sort; }
function addLanguageLink( $t ) { $this->mLanguageLinks[] = $t; }
- function addExternalLink( $url ) { $this->mExternalLinks[$url] = 1; }
function addWarning( $s ) { $this->mWarnings[$s] = 1; }
function addOutputHook( $hook, $data = false ) {
return (bool)$this->mNewSection;
}
+ function addExternalLink( $url ) {
+ # We don't register links pointing to our own server, unless... :-)
+ global $wgServer, $wgRegisterInternalExternals;
+ if( $wgRegisterInternalExternals or stripos($url,$wgServer.'/')!==0)
+ $this->mExternalLinks[$url] = 1;
+ }
+
function addLink( $title, $id = null ) {
+ if ( $title->isExternal() ) {
+ // Don't record interwikis in pagelinks
+ return;
+ }
$ns = $title->getNamespace();
$dbk = $title->getDBkey();
if ( $ns == NS_MEDIA ) {