From: Chad Horohoe Date: Wed, 11 Jan 2012 00:53:08 +0000 (+0000) Subject: Revert r102624, r104262 (user display name stuff). Per CR there isn't consensus on... X-Git-Tag: 1.31.0-rc.0~25358 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=f3a6fc1576eb8ea585995bd7e0bc203423db0e97;p=lhc%2Fweb%2Fwiklou.git Revert r102624, r104262 (user display name stuff). Per CR there isn't consensus on this yet. --- diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 6e45609a34..69861d6ebc 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -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. diff --git a/docs/hooks.txt b/docs/hooks.txt index 8302d2eaf4..8d80149dcd 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -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 diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index ee92d6bd2c..2984c7a0cb 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -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 * diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index ff76653f23..7ac1faf4a1 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -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\n"; @@ -1577,7 +1574,7 @@ abstract class BaseTemplate extends QuickTemplate { // END hack } } - + return $boxes; } diff --git a/includes/User.php b/includes/User.php index ab0a35b6d7..f8de2031f7 100644 --- a/includes/User.php +++ b/includes/User.php @@ -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. *