}
/**
- * Make appropriate markup for a link to the current article. This is
- * currently rendered as the bold link text. The calling sequence is the
- * same as the other make*LinkObj static functions, despite $query not
- * being used.
+ * Make appropriate markup for a link to the current article. This is since
+ * MediaWiki 1.29.0 rendered as an <a> tag without an href and with a class
+ * showing the link text. The calling sequence is the same as for the other
+ * make*LinkObj static functions, but $query is not used.
*
* @since 1.16.3
* @param Title $nt
* @return string
*/
public static function makeSelfLinkObj( $nt, $html = '', $query = '', $trail = '', $prefix = '' ) {
- $ret = "<strong class=\"selflink\">{$prefix}{$html}</strong>{$trail}";
+ $ret = "<a class=\"mw-selflink selflink\">{$prefix}{$html}</a>{$trail}";
if ( !Hooks::run( 'SelfLinkBegin', [ $nt, &$html, &$trail, &$prefix, &$ret ] ) ) {
return $ret;
}
$html = htmlspecialchars( $nt->getPrefixedText() );
}
list( $inside, $trail ) = self::splitTrail( $trail );
- return "<strong class=\"selflink\">{$prefix}{$html}{$inside}</strong>{$trail}";
+ return "<a class=\"mw-selflink selflink\">{$prefix}{$html}{$inside}</a>{$trail}";
}
/**
if ( $userId ) {
// check if the user has an edit
$attribs = [];
+ $attribs['class'] = 'mw-usertoollinks-contribs';
if ( $redContribsWhenNoEdits ) {
if ( intval( $edits ) === 0 && $edits !== 0 ) {
$user = User::newFromId( $userId );
$edits = $user->getEditCount();
}
if ( $edits === 0 ) {
- $attribs['class'] = 'new';
+ $attribs['class'] .= ' new';
}
}
$contribsPage = SpecialPage::getTitleFor( 'Contributions', $userText );
*/
public static function userTalkLink( $userId, $userText ) {
$userTalkPage = Title::makeTitle( NS_USER_TALK, $userText );
- $userTalkLink = self::link( $userTalkPage, wfMessage( 'talkpagelinktext' )->escaped() );
+ $moreLinkAttribs['class'] = 'mw-usertoollinks-talk';
+ $userTalkLink = self::link( $userTalkPage,
+ wfMessage( 'talkpagelinktext' )->escaped(),
+ $moreLinkAttribs );
return $userTalkLink;
}
*/
public static function blockLink( $userId, $userText ) {
$blockPage = SpecialPage::getTitleFor( 'Block', $userText );
- $blockLink = self::link( $blockPage, wfMessage( 'blocklink' )->escaped() );
+ $moreLinkAttribs['class'] = 'mw-usertoollinks-block';
+ $blockLink = self::link( $blockPage,
+ wfMessage( 'blocklink' )->escaped(),
+ $moreLinkAttribs );
return $blockLink;
}
*/
public static function emailLink( $userId, $userText ) {
$emailPage = SpecialPage::getTitleFor( 'Emailuser', $userText );
- $emailLink = self::link( $emailPage, wfMessage( 'emaillink' )->escaped() );
+ $moreLinkAttribs['class'] = 'mw-usertoollinks-mail';
+ $emailLink = self::link( $emailPage,
+ wfMessage( 'emaillink' )->escaped(),
+ $moreLinkAttribs );
return $emailLink;
}
$link = Linker::makeExternalLink(
WikiMap::getForeignURL(
$wikiId,
- $title->getPrefixedText(),
+ $title->getNamespace() === 0
+ ? $title->getDBkey()
+ : MWNamespace::getCanonicalName( $title->getNamespace() ) . ':'
+ . $title->getDBkey(),
$title->getFragment()
),
$text,
$title = wfMessage( 'toc' )->inLanguage( $lang )->escaped();
return '<div id="toc" class="toc">'
- . '<div id="toctitle"><h2>' . $title . "</h2></div>\n"
+ . '<div class="toctitle"><h2>' . $title . "</h2></div>\n"
. $toc
. "</ul>\n</div>\n";
}
* @return string HTML output
*/
public static function formatHiddenCategories( $hiddencats ) {
-
$outText = '';
if ( count( $hiddencats ) > 0 ) {
# Construct the HTML
* @return array
*/
public static function tooltipAndAccesskeyAttribs( $name, array $msgParams = [] ) {
- # @todo FIXME: If Sanitizer::expandAttributes() treated "false" as "output
- # no attribute" instead of "output '' as value for attribute", this
- # would be three lines.
$attribs = [
'title' => self::titleAttrib( $name, 'withaccess', $msgParams ),
'accesskey' => self::accesskey( $name )
* @return null|string
*/
public static function tooltip( $name, $options = null ) {
- # @todo FIXME: If Sanitizer::expandAttributes() treated "false" as "output
- # no attribute" instead of "output '' as value for attribute", this
- # would be two lines.
$tooltip = self::titleAttrib( $name, $options );
if ( $tooltip === false ) {
return '';