From 1c3805d278491cc51371d22569ca3b1e4726bcb5 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Sat, 13 Sep 2008 23:59:43 +0000 Subject: [PATCH] * 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. --- includes/specials/SpecialConfirmemail.php | 7 ++++++- includes/specials/SpecialPreferences.php | 14 ++++++++++---- includes/specials/SpecialUndelete.php | 11 ++++++++--- languages/messages/MessagesEn.php | 4 ++-- 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/includes/specials/SpecialConfirmemail.php b/includes/specials/SpecialConfirmemail.php index 9075fb9573..7366bcc438 100644 --- a/includes/specials/SpecialConfirmemail.php +++ b/includes/specials/SpecialConfirmemail.php @@ -58,8 +58,13 @@ class EmailConfirmation extends UnlistedSpecialPage { } } else { if( $wgUser->isEmailConfirmed() ) { + // date and time are separate parameters to facilitate localisation. + // $time is kept for backward compat reasons. + // 'emailauthenticated' is also used in SpecialPreferences.php $time = $wgLang->timeAndDate( $wgUser->mEmailAuthenticated, true ); - $wgOut->addWikiMsg( 'emailauthenticated', $time ); + $d = $wgLang->date( $wgUser->mEmailAuthenticated, true ); + $t = $wgLang->time( $wgUser->mEmailAuthenticated, true ); + $wgOut->addWikiMsg( 'emailauthenticated', $time, $d, $t ); } if( $wgUser->isEmailConfirmationPending() ) { $wgOut->addWikiMsg( 'confirmemail_pending' ); diff --git a/includes/specials/SpecialPreferences.php b/includes/specials/SpecialPreferences.php index bc33f091fc..03f94ab82f 100644 --- a/includes/specials/SpecialPreferences.php +++ b/includes/specials/SpecialPreferences.php @@ -558,7 +558,13 @@ class PreferencesForm { if ($wgEmailAuthentication && ($this->mUserEmail != '') ) { if( $wgUser->getEmailAuthenticationTimestamp() ) { - $emailauthenticated = wfMsg('emailauthenticated',$wgLang->timeanddate($wgUser->getEmailAuthenticationTimestamp(), true ) ).'
'; + // date and time are separate parameters to facilitate localisation. + // $time is kept for backward compat reasons. + // 'emailauthenticated' is also used in SpecialConfirmemail.php + $time = $wgLang->timeAndDate( $wgUser->getEmailAuthenticationTimestamp(), true ); + $d = $wgLang->date( $wgUser->getEmailAuthenticationTimestamp(), true ); + $t = $wgLang->time( $wgUser->getEmailAuthenticationTimestamp(), true ); + $emailauthenticated = wfMsg('emailauthenticated', $time, $d, $t ).'
'; $disableEmailPrefs = false; } else { $disableEmailPrefs = true; @@ -618,7 +624,7 @@ class PreferencesForm { $toolLinks = array(); $toolLinks[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'ListGroupRights' ), wfMsg( 'listgrouprights' ) ); # At the moment one tool link only but be prepared for the future... - # FIXME: Add a link to Special:Userrights for users who are allowed to use it. + # FIXME: Add a link to Special:Userrights for users who are allowed to use it. # $wgUser->isAllowed( 'userrights' ) seems to strict in some cases $userInformationHtml = @@ -627,7 +633,7 @@ class PreferencesForm { $this->tableRow( wfMsgExt( 'prefs-memberingroups', array( 'parseinline' ), count( $userEffectiveGroupsArray ) ), - implode( wfMsg( 'comma-separator' ), $userEffectiveGroupsArray ) . + implode( wfMsg( 'comma-separator' ), $userEffectiveGroupsArray ) . '
(' . implode( ' | ', $toolLinks ) . ')' ) . @@ -732,7 +738,7 @@ class PreferencesForm { ) ); } - + if(count($variantArray) > 1 && !$wgDisableLangConversion && !$wgDisableTitleConversion) { $wgOut->addHtml( Xml::tags( 'tr', null, diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index fbbf89d687..25a75f971e 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -748,8 +748,6 @@ class UndeleteForm { SpecialPage::getTitleFor( 'Undelete', $this->mTargetObj->getPrefixedDBkey() ), htmlspecialchars( $this->mTargetObj->getPrefixedText() ) ); - $time = htmlspecialchars( $wgLang->timeAndDate( $timestamp, true ) ); - $user = $skin->revUserTools( $rev ); if( $this->mDiff ) { $previousRev = $archive->getPreviousRevision( $timestamp ); @@ -765,7 +763,14 @@ class UndeleteForm { } } - $wgOut->addHtml( '

' . wfMsgHtml( 'undelete-revision', $link, $time, $user ) . '

' ); + // date and time are separate parameters to facilitate localisation. + // $time is kept for backward compat reasons. + $time = htmlspecialchars( $wgLang->timeAndDate( $timestamp, true ) ); + $d = htmlspecialchars( $wgLang->date( $timestamp, true ) ); + $t = htmlspecialchars( $wgLang->time( $timestamp, true ) ); + $user = $skin->revUserTools( $rev ); + + $wgOut->addHtml( '

' . wfMsgHtml( 'undelete-revision', $link, $time, $user, $t, $d ) . '

' ); wfRunHooks( 'UndeleteShowRevision', array( $this->mTargetObj, $rev ) ); diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 563b514d9e..4928aec246 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -963,7 +963,7 @@ To prevent abuse, only one password reminder will be sent per {{PLURAL:$1|hour|$ 'mailerror' => 'Error sending mail: $1', 'acct_creation_throttle_hit' => 'Sorry, you have already created {{PLURAL:$1|1 account|$1 accounts}}. You cannot make any more.', -'emailauthenticated' => 'Your e-mail address was authenticated on $1.', +'emailauthenticated' => 'Your e-mail address was authenticated on $2 at $3.', 'emailnotauthenticated' => 'Your e-mail address is not yet authenticated. No e-mail will be sent for any of the following features.', 'noemailprefs' => 'Specify an e-mail address for these features to work.', @@ -2364,7 +2364,7 @@ In such cases, you must uncheck or unhide the newest deleted revision.', 'undeletehistorynoadmin' => 'This page has been deleted. The reason for deletion is shown in the summary below, along with details of the users who had edited this page before deletion. The actual text of these deleted revisions is only available to administrators.', -'undelete-revision' => 'Deleted revision of $1 (as of $2) by $3:', +'undelete-revision' => 'Deleted revision of $1 (as of $5 on $4) by $3:', 'undeleterevision-missing' => 'Invalid or missing revision. You may have a bad link, or the revision may have been restored or removed from the archive.', 'undelete-nodiff' => 'No previous revision found.', -- 2.20.1