Change I822a7390 introduced a somewhat complex way to display
the "talk" link in parentheses after the username. It would only
work in Vector, and it broke the display in RTL wikis, because
it hacked into the personal links array.
This change attempts to make it more robust, by keeping the
array intact and adding the parentheses to the mytalk item
as a special case in SkinTemplate::makeListItem(). This fixes
the display in RTL wikis and allows the parentheses
to be displayed in all skins.
This commit also eliminates the global $wgVectorCombineUserTalk,
which is not needed any more.
Change-Id: I36ec3bec89a17cab3e4fc56ccf5038f7df93d213
*/
$wgUseCombinedLoginLink = false;
*/
$wgUseCombinedLoginLink = false;
-/**
- * Appearance of user page and talk page labels in personal tools.
- * - true = combine links into a single label
- * - false = keep links in separate labels
- */
-$wgVectorCombineUserTalk = false;
-
/**
* Search form look for Vector skin only.
* - true = use an icon search button
/**
* Search form look for Vector skin only.
* - true = use an icon search button
$attrs['class'] .= ' active';
$attrs['class'] = trim( $attrs['class'] );
}
$attrs['class'] .= ' active';
$attrs['class'] = trim( $attrs['class'] );
}
+
+ // A special case for the talk link in personal tools.
+ // See bug 41672 and 42337.
+ if ( $key === 'mytalk' ) {
+ $html = $this->getMsg( 'parentheses' )->rawParams( $html )->escaped();
+ }
+
return Html::rawElement( isset( $options['tag'] ) ? $options['tag'] : 'li', $attrs, $html );
}
return Html::rawElement( isset( $options['tag'] ) ? $options['tag'] : 'li', $attrs, $html );
}
* @param $elements array
*/
protected function renderNavigation( $elements ) {
* @param $elements array
*/
protected function renderNavigation( $elements ) {
- global $wgVectorUseSimpleSearch, $wgVectorCombineUserTalk;
+ global $wgVectorUseSimpleSearch;
// If only one element was given, wrap it in an array, allowing more
// flexible arguments
// If only one element was given, wrap it in an array, allowing more
// flexible arguments
<ul<?php $this->html( 'userlangattributes' ) ?>>
<?php
$personalTools = $this->getPersonalTools();
<ul<?php $this->html( 'userlangattributes' ) ?>>
<?php
$personalTools = $this->getPersonalTools();
- if ( $wgVectorCombineUserTalk && isset( $personalTools['userpage'] ) ) {
-?>
- <li>
-<?php
- echo $this->makeListItem( 'userpage', $personalTools['userpage'], array( 'tag' => 'span' ) );
-?> <?php
- $personalTools['mytalk']['links'][0]['text'] = $this->getMsg( 'mytalk-parenthetical' )->text();
- $talkItem = $this->makeListItem( 'mytalk', $personalTools['mytalk'], array( 'tag' => 'span' ) );
- echo $this->getMsg( 'parentheses' )->rawParams( $talkItem )->escaped();
- unset( $personalTools['userpage'], $personalTools['mytalk'] );
-?>
- </li>
-<?php
- }
foreach ( $personalTools as $key => $item ) {
echo $this->makeListItem( $key, $item );
}
foreach ( $personalTools as $key => $item ) {
echo $this->makeListItem( $key, $item );
}