+
+ protected static function getTitleLink( $type, $skin, $title, &$params ) {
+ global $wgLang, $wgContLang, $wgUserrightsInterwikiDelimiter;
+ if( !$skin ) {
+ return $title->getPrefixedText();
+ }
+ switch( $type ) {
+ case 'move':
+ $titleLink = $skin->link(
+ $title,
+ htmlspecialchars( $title->getPrefixedText() ),
+ array(),
+ array( 'redirect' => 'no' )
+ );
+ $targetTitle = Title::newFromText( $params[0] );
+ if ( !$targetTitle ) {
+ # Workaround for broken database
+ $params[0] = htmlspecialchars( $params[0] );
+ } else {
+ $params[0] = $skin->link(
+ $targetTitle,
+ htmlspecialchars( $params[0] )
+ );
+ }
+ break;
+ case 'block':
+ if( substr( $title->getText(), 0, 1 ) == '#' ) {
+ $titleLink = $title->getText();
+ } else {
+ // TODO: Store the user identifier in the parameters
+ // to make this faster for future log entries
+ $id = User::idFromName( $title->getText() );
+ $titleLink = $skin->userLink( $id, $title->getText() )
+ . $skin->userToolLinks( $id, $title->getText(), false, Linker::TOOL_LINKS_NOBLOCK );
+ }
+ break;
+ case 'rights':
+ $text = $wgContLang->ucfirst( $title->getText() );
+ $parts = explode( $wgUserrightsInterwikiDelimiter, $text, 2 );
+ if ( count( $parts ) == 2 ) {
+ $titleLink = WikiMap::foreignUserLink( $parts[1], $parts[0],
+ htmlspecialchars( $title->getPrefixedText() ) );
+ if ( $titleLink !== false )
+ break;
+ }
+ $titleLink = $skin->link( Title::makeTitle( NS_USER, $text ) );
+ break;
+ case 'merge':
+ $titleLink = $skin->link(
+ $title,
+ $title->getPrefixedText(),
+ array(),
+ array( 'redirect' => 'no' )
+ );
+ $params[0] = $skin->link(
+ Title::newFromText( $params[0] ),
+ htmlspecialchars( $params[0] )
+ );
+ $params[1] = $wgLang->timeanddate( $params[1] );
+ break;
+ default:
+ if( $title->getNamespace() == NS_SPECIAL ) {
+ list( $name, $par ) = SpecialPage::resolveAliasWithSubpage( $title->getDBkey() );
+ # Use the language name for log titles, rather than Log/X
+ if( $name == 'Log' ) {
+ $titleLink = '('.$skin->link( $title, LogPage::logName( $par ) ).')';
+ } else {
+ $titleLink = $skin->link( $title );
+ }
+ } else {
+ $titleLink = $skin->link( $title );
+ }
+ }
+ return $titleLink;
+ }