Revert "(bug 42337) Simplify "my talk" link logic in personal tools"
authorKrinkle <ttijhof@wikimedia.org>
Sat, 24 Nov 2012 23:15:12 +0000 (23:15 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 24 Nov 2012 23:15:12 +0000 (23:15 +0000)
For 2 reasons:
* The parentheses look (according to CologneBlue) weird in skins others than Monobook and Vector (where they are bulleted lists)
* The parentheses look (according to Krinkle) weird in Vector and Monobook as well.
* The casing changed from (talk) to (Talk), which is odd.

Please try again.

This reverts commit f31209dfb307ec2bac20107e788578b762f70e89

includes/DefaultSettings.php
includes/SkinTemplate.php
skins/Vector.php

index 77a9de1..60c3ab8 100644 (file)
@@ -2776,6 +2776,13 @@ $wgFooterIcons = array(
  */
 $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
index a24ece5..173d37a 100644 (file)
@@ -1777,13 +1777,6 @@ abstract class BaseTemplate extends QuickTemplate {
                        $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 );
        }
 
index 8d685bd..92eb3ad 100644 (file)
@@ -367,7 +367,7 @@ class VectorTemplate extends BaseTemplate {
         * @param $elements array
         */
        protected function renderNavigation( $elements ) {
-               global $wgVectorUseSimpleSearch;
+               global $wgVectorUseSimpleSearch, $wgVectorCombineUserTalk;
 
                // If only one element was given, wrap it in an array, allowing more
                // flexible arguments
@@ -452,6 +452,20 @@ class VectorTemplate extends BaseTemplate {
        <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 );
                                        }