r40799 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40798‎ | r40799 | r40800 >
Date:23:59, 13 September 2008
Author:siebrand
Status:old
Tags:
Comment:
* split time and date in 'emailauthenticated', and 'undelete-revision', retaiming the old parameter for backward compatibility
* move some code in SpecialUndelete.php a little lower as that seems a more logical place.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialConfirmemail.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialPreferences.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUndelete.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialUndelete.php
@@ -748,8 +748,6 @@
749749 SpecialPage::getTitleFor( 'Undelete', $this->mTargetObj->getPrefixedDBkey() ),
750750 htmlspecialchars( $this->mTargetObj->getPrefixedText() )
751751 );
752 - $time = htmlspecialchars( $wgLang->timeAndDate( $timestamp, true ) );
753 - $user = $skin->revUserTools( $rev );
754752
755753 if( $this->mDiff ) {
756754 $previousRev = $archive->getPreviousRevision( $timestamp );
@@ -765,8 +763,15 @@
766764 }
767765 }
768766
769 - $wgOut->addHtml( '<p>' . wfMsgHtml( 'undelete-revision', $link, $time, $user ) . '</p>' );
 767+ // date and time are separate parameters to facilitate localisation.
 768+ // $time is kept for backward compat reasons.
 769+ $time = htmlspecialchars( $wgLang->timeAndDate( $timestamp, true ) );
 770+ $d = htmlspecialchars( $wgLang->date( $timestamp, true ) );
 771+ $t = htmlspecialchars( $wgLang->time( $timestamp, true ) );
 772+ $user = $skin->revUserTools( $rev );
770773
 774+ $wgOut->addHtml( '<p>' . wfMsgHtml( 'undelete-revision', $link, $time, $user, $t, $d ) . '</p>' );
 775+
771776 wfRunHooks( 'UndeleteShowRevision', array( $this->mTargetObj, $rev ) );
772777
773778 if( $this->mPreview ) {
Index: trunk/phase3/includes/specials/SpecialPreferences.php
@@ -558,7 +558,13 @@
559559
560560 if ($wgEmailAuthentication && ($this->mUserEmail != '') ) {
561561 if( $wgUser->getEmailAuthenticationTimestamp() ) {
562 - $emailauthenticated = wfMsg('emailauthenticated',$wgLang->timeanddate($wgUser->getEmailAuthenticationTimestamp(), true ) ).'<br />';
 562+ // date and time are separate parameters to facilitate localisation.
 563+ // $time is kept for backward compat reasons.
 564+ // 'emailauthenticated' is also used in SpecialConfirmemail.php
 565+ $time = $wgLang->timeAndDate( $wgUser->getEmailAuthenticationTimestamp(), true );
 566+ $d = $wgLang->date( $wgUser->getEmailAuthenticationTimestamp(), true );
 567+ $t = $wgLang->time( $wgUser->getEmailAuthenticationTimestamp(), true );
 568+ $emailauthenticated = wfMsg('emailauthenticated', $time, $d, $t ).'<br />';
563569 $disableEmailPrefs = false;
564570 } else {
565571 $disableEmailPrefs = true;
@@ -618,7 +624,7 @@
619625 $toolLinks = array();
620626 $toolLinks[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'ListGroupRights' ), wfMsg( 'listgrouprights' ) );
621627 # At the moment one tool link only but be prepared for the future...
622 - # FIXME: Add a link to Special:Userrights for users who are allowed to use it.
 628+ # FIXME: Add a link to Special:Userrights for users who are allowed to use it.
623629 # $wgUser->isAllowed( 'userrights' ) seems to strict in some cases
624630
625631 $userInformationHtml =
@@ -627,7 +633,7 @@
628634
629635 $this->tableRow(
630636 wfMsgExt( 'prefs-memberingroups', array( 'parseinline' ), count( $userEffectiveGroupsArray ) ),
631 - implode( wfMsg( 'comma-separator' ), $userEffectiveGroupsArray ) .
 637+ implode( wfMsg( 'comma-separator' ), $userEffectiveGroupsArray ) .
632638 '<br />(' . implode( ' | ', $toolLinks ) . ')'
633639 ) .
634640
@@ -732,7 +738,7 @@
733739 )
734740 );
735741 }
736 -
 742+
737743 if(count($variantArray) > 1 && !$wgDisableLangConversion && !$wgDisableTitleConversion) {
738744 $wgOut->addHtml(
739745 Xml::tags( 'tr', null,
Index: trunk/phase3/includes/specials/SpecialConfirmemail.php
@@ -58,8 +58,13 @@
5959 }
6060 } else {
6161 if( $wgUser->isEmailConfirmed() ) {
 62+ // date and time are separate parameters to facilitate localisation.
 63+ // $time is kept for backward compat reasons.
 64+ // 'emailauthenticated' is also used in SpecialPreferences.php
6265 $time = $wgLang->timeAndDate( $wgUser->mEmailAuthenticated, true );
63 - $wgOut->addWikiMsg( 'emailauthenticated', $time );
 66+ $d = $wgLang->date( $wgUser->mEmailAuthenticated, true );
 67+ $t = $wgLang->time( $wgUser->mEmailAuthenticated, true );
 68+ $wgOut->addWikiMsg( 'emailauthenticated', $time, $d, $t );
6469 }
6570 if( $wgUser->isEmailConfirmationPending() ) {
6671 $wgOut->addWikiMsg( 'confirmemail_pending' );
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -963,7 +963,7 @@
964964 'mailerror' => 'Error sending mail: $1',
965965 'acct_creation_throttle_hit' => 'Sorry, you have already created {{PLURAL:$1|1 account|$1 accounts}}.
966966 You cannot make any more.',
967 -'emailauthenticated' => 'Your e-mail address was authenticated on $1.',
 967+'emailauthenticated' => 'Your e-mail address was authenticated on $2 at $3.',
968968 'emailnotauthenticated' => 'Your e-mail address is not yet authenticated.
969969 No e-mail will be sent for any of the following features.',
970970 'noemailprefs' => 'Specify an e-mail address for these features to work.',
@@ -2364,7 +2364,7 @@
23652365 'undeletehistorynoadmin' => 'This page has been deleted.
23662366 The reason for deletion is shown in the summary below, along with details of the users who had edited this page before deletion.
23672367 The actual text of these deleted revisions is only available to administrators.',
2368 -'undelete-revision' => 'Deleted revision of $1 (as of $2) by $3:',
 2368+'undelete-revision' => 'Deleted revision of $1 (as of $5 on $4) by $3:',
23692369 'undeleterevision-missing' => 'Invalid or missing revision.
23702370 You may have a bad link, or the revision may have been restored or removed from the archive.',
23712371 'undelete-nodiff' => 'No previous revision found.',