r108581 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108580‎ | r108581 | r108582 >
Date:00:53, 11 January 2012
Author:demon
Status:ok
Tags:
Comment:
Revert r102624, r104262 (user display name stuff). Per CR there isn't consensus on this yet.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/SkinTemplate.php (modified) (history)
  • /trunk/phase3/includes/User.php (modified) (history)

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
@@ -2074,10 +2074,6 @@
20752075 hashing method
20762076 &$hash: If the hook returns false, this String will be used as the hash
20772077
2078 -'UserDisplayName': Called in User::getDisplayName()
2079 -$user: The user object to fetch the display name for
2080 -&$displayName: The display name. Will be null. Set to a name to override default name.
2081 -
20822078 'UserEffectiveGroups': Called in User::getEffectiveGroups()
20832079 $user: User to get groups for
20842080 &$groups: Current effective groups
Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -82,8 +82,6 @@
8383 * The default user signature now contains a talk link in addition to the user link.
8484 * (bug 25306) Add link of old page title to MediaWiki:Delete_and_move_reason.
8585 * Added hook BitmapHandlerCheckImageArea.
86 -* (experimental) $wgRealNameInInterface can be enabled to display a user's
87 - real name in some parts of the interface instead of a username.
8886 * (bug 30062) Add $wgDBprefix option to cli installer.
8987 * getUserPermissionsErrors and getUserPermissionsErrorsExpensive hooks are now
9088 also called when checking for 'read' permission.
Index: trunk/phase3/includes/User.php
@@ -197,7 +197,7 @@
198198 */
199199 var $mNewtalk, $mDatePreference, $mBlockedby, $mHash, $mRights,
200200 $mBlockreason, $mEffectiveGroups, $mImplicitGroups, $mFormerGroups, $mBlockedGlobally,
201 - $mLocked, $mHideName, $mOptions, $mDisplayName;
 201+ $mLocked, $mHideName, $mOptions;
202202
203203 /**
204204 * @var WebRequest
@@ -1191,7 +1191,6 @@
11921192 $this->mEffectiveGroups = null;
11931193 $this->mImplicitGroups = null;
11941194 $this->mOptions = null;
1195 - $this->mDisplayName = null;
11961195
11971196 if ( $reloadFrom ) {
11981197 $this->mLoadedItems = array();
@@ -2141,32 +2140,6 @@
21422141 }
21432142
21442143 /**
2145 - * Return the name of this user we should used to display in the user interface
2146 - * @return String The user's display name
2147 - */
2148 - public function getDisplayName() {
2149 - global $wgRealNameInInterface;
2150 - if ( is_null( $this->mDisplayName ) ) {
2151 - $displayName = null;
2152 -
2153 - // Allow hooks to set a display name
2154 - wfRunHooks( 'UserDisplayName', array( $this, &$displayName ) );
2155 -
2156 - if ( is_null( $displayName ) && $wgRealNameInInterface && $this->getRealName() ) {
2157 - // If $wgRealNameInInterface is true use the real name as the display name if it's set
2158 - $displayName = $this->getRealName();
2159 - }
2160 -
2161 - if ( is_null( $displayName ) ) {
2162 - $displayName = $this->getName();
2163 - }
2164 -
2165 - $this->mDisplayName = $displayName;
2166 - }
2167 - return $this->mDisplayName;
2168 - }
2169 -
2170 - /**
21712144 * Get the user's current setting for a given option.
21722145 *
21732146 * @param $oname String The option to check
Index: trunk/phase3/includes/SkinTemplate.php
@@ -177,7 +177,6 @@
178178 $this->thisquery = wfArrayToCGI( $query );
179179 $this->loggedin = $user->isLoggedIn();
180180 $this->username = $user->getName();
181 - $this->userdisplayname = $user->getDisplayName();
182181
183182 if ( $this->loggedin || $this->showIPinHeader() ) {
184183 $this->userpageUrlDetails = self::makeUrlDetails( $this->userpage );
@@ -288,7 +287,6 @@
289288 $tpl->set( 'capitalizeallnouns', $lang->capitalizeAllNouns() ? ' capitalize-all-nouns' : '' );
290289 $tpl->set( 'showjumplinks', $user->getOption( 'showjumplinks' ) );
291290 $tpl->set( 'username', $this->loggedin ? $this->username : null );
292 - $tpl->set( 'userdisplayname', $this->loggedin ? $this->userdisplayname : null );
293291 $tpl->setRef( 'userpage', $this->userpage );
294292 $tpl->setRef( 'userpageurl', $this->userpageUrlDetails['href'] );
295293 $tpl->set( 'userlang', $userlang );
@@ -551,7 +549,7 @@
552550 $returnto = wfArrayToCGI( $a );
553551 if( $this->loggedin ) {
554552 $personal_urls['userpage'] = array(
555 - 'text' => $this->userdisplayname,
 553+ 'text' => $this->username,
556554 'href' => &$this->userpageUrlDetails['href'],
557555 'class' => $this->userpageUrlDetails['exists'] ? false : 'new',
558556 'active' => ( $this->userpageUrlDetails['href'] == $pageurl )
@@ -646,7 +644,7 @@
647645 if( $this->showIPinHeader() ) {
648646 $href = &$this->userpageUrlDetails['href'];
649647 $personal_urls['anonuserpage'] = array(
650 - 'text' => $this->userdisplayname,
 648+ 'text' => $this->username,
651649 'href' => $href,
652650 'class' => $this->userpageUrlDetails['exists'] ? false : 'new',
653651 'active' => ( $pageurl == $href )
@@ -871,7 +869,7 @@
872870 'href' => $title->getLocalURL( $this->editUrlOptions() ),
873871 'primary' => true, // don't collapse this in vector
874872 );
875 -
 873+
876874 // section link
877875 if ( $showNewSection ) {
878876 // Adds new section link
@@ -980,7 +978,7 @@
981979 // Checks that language conversion is enabled and variants exist
982980 // And if it is not in the special namespace
983981 if( count( $variants ) > 1 ) {
984 - // Gets preferred variant (note that user preference is
 982+ // Gets preferred variant (note that user preference is
985983 // only possible for wiki content language variant)
986984 $preferred = $pageLang->getPreferredVariant();
987985 // Loops over each variant
@@ -1431,7 +1429,6 @@
14321430 * This is in reality the same list as already stored in personal_urls
14331431 * however it is reformatted so that you can just pass the individual items
14341432 * to makeListItem instead of hardcoding the element creation boilerplate.
1435 - * @return array
14361433 */
14371434 function getPersonalTools() {
14381435 $personal_tools = array();
@@ -1465,7 +1462,7 @@
14661463 if ( !isset( $sidebar['LANGUAGES'] ) ) {
14671464 $sidebar['LANGUAGES'] = true;
14681465 }
1469 -
 1466+
14701467 if ( !isset( $options['search'] ) || $options['search'] !== true ) {
14711468 unset( $sidebar['SEARCH'] );
14721469 }
@@ -1475,7 +1472,7 @@
14761473 if ( isset( $options['languages'] ) && $options['languages'] === false ) {
14771474 unset( $sidebar['LANGUAGES'] );
14781475 }
1479 -
 1476+
14801477 $boxes = array();
14811478 foreach ( $sidebar as $boxName => $content ) {
14821479 if ( $content === false ) {
@@ -1509,7 +1506,7 @@
15101507 'generated' => false,
15111508 'content' => $this->data['language_urls'],
15121509 );
1513 - }
 1510+ }
15141511 break;
15151512 default:
15161513 $msgObj = $this->getMsg( $boxName );
@@ -1522,7 +1519,7 @@
15231520 break;
15241521 }
15251522 }
1526 -
 1523+
15271524 // HACK: Compatibility with extensions still using SkinTemplateToolboxEnd
15281525 $hookContents = null;
15291526 if ( isset( $boxes['TOOLBOX'] ) ) {
@@ -1537,7 +1534,7 @@
15381535 }
15391536 }
15401537 // END hack
1541 -
 1538+
15421539 if ( isset( $options['htmlOnly'] ) && $options['htmlOnly'] === true ) {
15431540 foreach ( $boxes as $boxName => $box ) {
15441541 if ( is_array( $box['content'] ) ) {
@@ -1547,7 +1544,7 @@
15481545 }
15491546 // HACK, shove the toolbox end onto the toolbox if we're rendering itself
15501547 if ( $hookContents ) {
1551 - $content .= "\n $hookContents";
 1548+ $content .= "\n $hookContents";
15521549 }
15531550 // END hack
15541551 $content .= "\n</ul>\n";
@@ -1577,7 +1574,7 @@
15781575 // END hack
15791576 }
15801577 }
1581 -
 1578+
15821579 return $boxes;
15831580 }
15841581
Index: trunk/phase3/includes/DefaultSettings.php
@@ -2281,12 +2281,6 @@
22822282 $wgShowIPinHeader = true;
22832283
22842284 /**
2285 - * Use a user's real name inside the user interface for display instead of the username
2286 - * (experimental)
2287 - */
2288 -$wgRealNameInInterface = false;
2289 -
2290 -/**
22912285 * Site notice shown at the top of each page
22922286 *
22932287 * MediaWiki:Sitenotice page, which will override this. You can also

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r102624Add a new User::getDisplayName() to return the name that should be displayed ...dantman06:55, 10 November 2011
r104262Followup r102624...reedy00:32, 26 November 2011

Status & tagging log