Revert r102624, r104262 (user display name stuff). Per CR there isn't consensus on...
authorChad Horohoe <demon@users.mediawiki.org>
Wed, 11 Jan 2012 00:53:08 +0000 (00:53 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Wed, 11 Jan 2012 00:53:08 +0000 (00:53 +0000)
RELEASE-NOTES-1.19
docs/hooks.txt
includes/DefaultSettings.php
includes/SkinTemplate.php
includes/User.php

index 6e45609..69861d6 100644 (file)
@@ -82,8 +82,6 @@ production.
 * The default user signature now contains a talk link in addition to the user link.
 * (bug 25306) Add link of old page title to MediaWiki:Delete_and_move_reason.
 * Added hook BitmapHandlerCheckImageArea.
-* (experimental) $wgRealNameInInterface can be enabled to display a user's
-  real name in some parts of the interface instead of a username.
 * (bug 30062) Add $wgDBprefix option to cli installer.
 * getUserPermissionsErrors and getUserPermissionsErrorsExpensive hooks are now
   also called when checking for 'read' permission.
index 8302d2e..8d80149 100644 (file)
@@ -2074,10 +2074,6 @@ your own hashing method
        hashing method
 &$hash: If the hook returns false, this String will be used as the hash
 
-'UserDisplayName': Called in User::getDisplayName()
-$user: The user object to fetch the display name for
-&$displayName: The display name. Will be null. Set to a name to override default name.
-
 'UserEffectiveGroups': Called in User::getEffectiveGroups()
 $user: User to get groups for
 &$groups: Current effective groups
index ee92d6b..2984c7a 100644 (file)
@@ -2280,12 +2280,6 @@ $wgXhtmlNamespaces = array();
  */
 $wgShowIPinHeader      = true;
 
-/**
- * Use a user's real name inside the user interface for display instead of the username
- * (experimental)
- */
-$wgRealNameInInterface = false;
-
 /**
  * Site notice shown at the top of each page
  *
index ff76653..7ac1faf 100644 (file)
@@ -177,7 +177,6 @@ class SkinTemplate extends Skin {
                $this->thisquery = wfArrayToCGI( $query );
                $this->loggedin = $user->isLoggedIn();
                $this->username = $user->getName();
-               $this->userdisplayname = $user->getDisplayName();
 
                if ( $this->loggedin || $this->showIPinHeader() ) {
                        $this->userpageUrlDetails = self::makeUrlDetails( $this->userpage );
@@ -288,7 +287,6 @@ class SkinTemplate extends Skin {
                $tpl->set( 'capitalizeallnouns', $lang->capitalizeAllNouns() ? ' capitalize-all-nouns' : '' );
                $tpl->set( 'showjumplinks', $user->getOption( 'showjumplinks' ) );
                $tpl->set( 'username', $this->loggedin ? $this->username : null );
-               $tpl->set( 'userdisplayname', $this->loggedin ? $this->userdisplayname : null );
                $tpl->setRef( 'userpage', $this->userpage );
                $tpl->setRef( 'userpageurl', $this->userpageUrlDetails['href'] );
                $tpl->set( 'userlang', $userlang );
@@ -551,7 +549,7 @@ class SkinTemplate extends Skin {
                $returnto = wfArrayToCGI( $a );
                if( $this->loggedin ) {
                        $personal_urls['userpage'] = array(
-                               'text' => $this->userdisplayname,
+                               'text' => $this->username,
                                'href' => &$this->userpageUrlDetails['href'],
                                'class' => $this->userpageUrlDetails['exists'] ? false : 'new',
                                'active' => ( $this->userpageUrlDetails['href'] == $pageurl )
@@ -646,7 +644,7 @@ class SkinTemplate extends Skin {
                        if( $this->showIPinHeader() ) {
                                $href = &$this->userpageUrlDetails['href'];
                                $personal_urls['anonuserpage'] = array(
-                                       'text' => $this->userdisplayname,
+                                       'text' => $this->username,
                                        'href' => $href,
                                        'class' => $this->userpageUrlDetails['exists'] ? false : 'new',
                                        'active' => ( $pageurl == $href )
@@ -871,7 +869,7 @@ class SkinTemplate extends Skin {
                                                'href' => $title->getLocalURL( $this->editUrlOptions() ),
                                                'primary' => true, // don't collapse this in vector
                                        );
-
+                                       
                                        // section link
                                        if ( $showNewSection ) {
                                                // Adds new section link
@@ -980,7 +978,7 @@ class SkinTemplate extends Skin {
                                // Checks that language conversion is enabled and variants exist
                                // And if it is not in the special namespace
                                if( count( $variants ) > 1 ) {
-                                       // Gets preferred variant (note that user preference is
+                                       // Gets preferred variant (note that user preference is 
                                        // only possible for wiki content language variant)
                                        $preferred = $pageLang->getPreferredVariant();
                                        // Loops over each variant
@@ -1431,7 +1429,6 @@ abstract class BaseTemplate extends QuickTemplate {
         * This is in reality the same list as already stored in personal_urls
         * however it is reformatted so that you can just pass the individual items
         * to makeListItem instead of hardcoding the element creation boilerplate.
-        * @return array
         */
        function getPersonalTools() {
                $personal_tools = array();
@@ -1465,7 +1462,7 @@ abstract class BaseTemplate extends QuickTemplate {
                if ( !isset( $sidebar['LANGUAGES'] ) ) {
                        $sidebar['LANGUAGES'] = true;
                }
-
+               
                if ( !isset( $options['search'] ) || $options['search'] !== true ) {
                        unset( $sidebar['SEARCH'] );
                }
@@ -1475,7 +1472,7 @@ abstract class BaseTemplate extends QuickTemplate {
                if ( isset( $options['languages'] ) && $options['languages'] === false ) {
                        unset( $sidebar['LANGUAGES'] );
                }
-
+               
                $boxes = array();
                foreach ( $sidebar as $boxName => $content ) {
                        if ( $content === false ) {
@@ -1509,7 +1506,7 @@ abstract class BaseTemplate extends QuickTemplate {
                                                'generated' => false,
                                                'content'   => $this->data['language_urls'],
                                        );
-                               }
+                               } 
                                break;
                        default:
                                $msgObj = $this->getMsg( $boxName );
@@ -1522,7 +1519,7 @@ abstract class BaseTemplate extends QuickTemplate {
                                break;
                        }
                }
-
+               
                // HACK: Compatibility with extensions still using SkinTemplateToolboxEnd
                $hookContents = null;
                if ( isset( $boxes['TOOLBOX'] ) ) {
@@ -1537,7 +1534,7 @@ abstract class BaseTemplate extends QuickTemplate {
                        }
                }
                // END hack
-
+               
                if ( isset( $options['htmlOnly'] ) && $options['htmlOnly'] === true ) {
                        foreach ( $boxes as $boxName => $box ) {
                                if ( is_array( $box['content'] ) ) {
@@ -1547,7 +1544,7 @@ abstract class BaseTemplate extends QuickTemplate {
                                        }
                                        // HACK, shove the toolbox end onto the toolbox if we're rendering itself
                                        if ( $hookContents ) {
-                                               $content .= "\n $hookContents";
+                                               $content .= "\n $hookContents"; 
                                        }
                                        // END hack
                                        $content .= "\n</ul>\n";
@@ -1577,7 +1574,7 @@ abstract class BaseTemplate extends QuickTemplate {
                                // END hack
                        }
                }
-
+               
                return $boxes;
        }
 
index ab0a35b..f8de203 100644 (file)
@@ -197,7 +197,7 @@ class User {
         */
        var $mNewtalk, $mDatePreference, $mBlockedby, $mHash, $mRights,
                $mBlockreason, $mEffectiveGroups, $mImplicitGroups, $mFormerGroups, $mBlockedGlobally,
-               $mLocked, $mHideName, $mOptions, $mDisplayName;
+               $mLocked, $mHideName, $mOptions;
 
        /**
         * @var WebRequest
@@ -1191,7 +1191,6 @@ class User {
                $this->mEffectiveGroups = null;
                $this->mImplicitGroups = null;
                $this->mOptions = null;
-               $this->mDisplayName = null;
 
                if ( $reloadFrom ) {
                        $this->mLoadedItems = array();
@@ -2140,32 +2139,6 @@ class User {
                $this->mRealName = $str;
        }
 
-       /**
-        * Return the name of this user we should used to display in the user interface
-        * @return String The user's display name
-        */
-       public function getDisplayName() {
-               global $wgRealNameInInterface;
-               if ( is_null( $this->mDisplayName ) ) {
-                       $displayName = null;
-
-                       // Allow hooks to set a display name
-                       wfRunHooks( 'UserDisplayName', array( $this, &$displayName ) );
-
-                       if ( is_null( $displayName ) && $wgRealNameInInterface && $this->getRealName() ) {
-                               // If $wgRealNameInInterface is true use the real name as the display name if it's set
-                               $displayName = $this->getRealName();
-                       }
-
-                       if ( is_null( $displayName ) ) {
-                               $displayName = $this->getName();
-                       }
-
-                       $this->mDisplayName = $displayName;
-               }
-               return $this->mDisplayName;
-       }
-
        /**
         * Get the user's current setting for a given option.
         *