$replaceHeadings = true;
}
# Register a template reference whether or not the template exists
- $this->mOutput->addTemplate( $title->getNamespace(), $title->getDBkey(),
- $article->getID() );
+ $this->mOutput->addTemplate( $title, $article->getID() );
}
}
$colours[$pdbk] = 1;
} elseif ( ( $id = $wgLinkCache->getGoodLinkID( $pdbk ) ) != 0 ) {
$colours[$pdbk] = 1;
- $this->mOutput->addLink( $ns, $this->mLinkHolders['dbkeys'][$key], $id );
+ $this->mOutput->addLink( $title, $id );
} elseif ( $wgLinkCache->isBadLink( $pdbk ) ) {
$colours[$pdbk] = 0;
} else {
$title = Title::makeTitle( $s->page_namespace, $s->page_title );
$pdbk = $title->getPrefixedDBkey();
$wgLinkCache->addGoodLinkObj( $s->page_id, $title );
- $this->mOutput->addLink( $s->page_namespace, $s->page_title, $s->page_id );
+ $this->mOutput->addLink( $title, $s->page_id );
if ( $threshold > 0 ) {
$size = $s->page_len;
if ( empty( $colours[$pdbk] ) ) {
$wgLinkCache->addBadLinkObj( $title );
$colours[$pdbk] = 0;
- $this->mOutput->addLink( $ns, $this->mLinkHolders['dbkeys'][$key], 0 );
+ $this->mOutput->addLink( $title, 0 );
$wgOutputReplace[$searchkey] = $sk->makeBrokenLinkObj( $title,
$this->mLinkHolders['texts'][$key],
$this->mLinkHolders['queries'][$key] );
function addImage( $name ) { $this->mImages[$name] = 1; }
function addLanguageLink( $t ) { $this->mLanguageLinks[] = $t; }
- function addLink( $ns, $t, $id ) {
+ function addLink( $title, $id ) {
+ $ns = $title->getNamespace();
+ $dbk = $title->getDBkey();
if ( !isset( $this->mLinks[$ns] ) ) {
$this->mLinks[$ns] = array();
}
- $this->mLinks[$ns][$t] = $id;
+ $this->mLinks[$ns][$dbk] = $id;
}
- function addTemplate( $ns, $t, $id ) {
+ function addTemplate( $title, $id ) {
+ $ns = $title->getNamespace();
+ $dbk = $title->getDBkey();
if ( !isset( $this->mTemplates[$ns] ) ) {
$this->mTemplates[$ns] = array();
}
- $this->mTemplates[$ns][$t] = $id;
+ $this->mTemplates[$ns][$dbk] = $id;
}
/**