$specialPageAliases: associative array of magic words synonyms
$lang: laguage code (string)
-'LinkerLinkAttributes': At the end of Linker::getLinkAttributesInternal() just before the return
-&$this: Linker object
-&$nt: Title object of link target, or null
-$title: 'title' attribute string
-$class: 'class' attribute string
-&$result: Final attribute string
-
'LinkerMakeExternalImage': At the end of Linker::makeExternalImage() just before the return
&$url: the image url
&$alt: the image's alt text
* string is passed, which is the default value, defaults to 'external'.
*/
function getExternalLinkAttributes( $title, $unused = null, $class='' ) {
- return $this->getLinkAttributesInternal( null, $title, $class, 'external' );
+ return $this->getLinkAttributesInternal( $title, $class, 'external' );
}
/**
$title = $wgContLang->checkTitleEncoding( $title );
$title = preg_replace( '/[\\x00-\\x1f]/', ' ', $title );
- return $this->getLinkAttributesInternal( null, $title, $class, 'external' );
+ return $this->getLinkAttributesInternal( $title, $class, 'external' );
}
/**
function getInternalLinkAttributes( $title, $unused = null, $class='' ) {
$title = urldecode( $title );
$title = str_replace( '_', ' ', $title );
- return $this->getLinkAttributesInternal( null, $title, $class );
+ return $this->getLinkAttributesInternal( $title, $class );
}
/**
if( $title === false ) {
$title = $nt->getPrefixedText();
}
- return $this->getLinkAttributesInternal( $nt, $title, $class );
+ return $this->getLinkAttributesInternal( $title, $class );
}
/**
* Common code for getLinkAttributesX functions
*/
- private function getLinkAttributesInternal( $nt, $title, $class, $classDefault = false ) {
+ private function getLinkAttributesInternal( $title, $class, $classDefault = false ) {
$title = htmlspecialchars( $title );
if( $class === '' and $classDefault !== false ) {
# FIXME: Parameter defaults the hard way! We should just have
$r .= " class=\"$class\"";
}
$r .= " title=\"$title\"";
- wfRunHooks( 'LinkerLinkAttributes', array( &$this, &$nt, $title, $class, &$r ) );
return $r;
}
$nt = $this->normaliseSpecialPage( $title );
- if ( $text == '' ) {
- $text = htmlspecialchars( $nt->getPrefixedText() );
- }
- if ( $style == '' ) {
- $style = $this->getInternalLinkAttributesObj( $nt, $text );
- }
$u = $nt->escapeLocalURL( $query );
if ( $nt->getFragment() != '' ) {
if( $nt->getPrefixedDbkey() == '' ) {
}
$u .= $nt->getFragmentForURL();
}
+ if ( $text == '' ) {
+ $text = htmlspecialchars( $nt->getPrefixedText() );
+ }
+ if ( $style == '' ) {
+ $style = $this->getInternalLinkAttributesObj( $nt, $text );
+ }
if ( $aprops !== '' ) $aprops = ' ' . $aprops;