* split time and date in 'emailauthenticated', and 'undelete-revision', retaiming...
authorSiebrand Mazeland <siebrand@users.mediawiki.org>
Sat, 13 Sep 2008 23:59:43 +0000 (23:59 +0000)
committerSiebrand Mazeland <siebrand@users.mediawiki.org>
Sat, 13 Sep 2008 23:59:43 +0000 (23:59 +0000)
* move some code in SpecialUndelete.php a little lower as that seems a more logical place.

includes/specials/SpecialConfirmemail.php
includes/specials/SpecialPreferences.php
includes/specials/SpecialUndelete.php
languages/messages/MessagesEn.php

index 9075fb9..7366bcc 100644 (file)
@@ -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' );
index bc33f09..03f94ab 100644 (file)
@@ -558,7 +558,13 @@ class PreferencesForm {
 
                if ($wgEmailAuthentication && ($this->mUserEmail != '') ) {
                        if( $wgUser->getEmailAuthenticationTimestamp() ) {
-                               $emailauthenticated = wfMsg('emailauthenticated',$wgLang->timeanddate($wgUser->getEmailAuthenticationTimestamp(), true ) ).'<br />';
+                               // 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 ).'<br />';
                                $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 ) .
                                '<br />(' . implode( ' | ', $toolLinks ) . ')'
                        ) .
 
@@ -732,7 +738,7 @@ class PreferencesForm {
                                        )
                                );
                        }
-                       
+
                        if(count($variantArray) > 1 && !$wgDisableLangConversion && !$wgDisableTitleConversion) {
                                $wgOut->addHtml(
                                        Xml::tags( 'tr', null,
index fbbf89d..25a75f9 100644 (file)
@@ -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( '<p>' . wfMsgHtml( 'undelete-revision', $link, $time, $user ) . '</p>' );
+               // 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( '<p>' . wfMsgHtml( 'undelete-revision', $link, $time, $user, $t, $d ) . '</p>' );
 
                wfRunHooks( 'UndeleteShowRevision', array( $this->mTargetObj, $rev ) );
 
index 563b514..4928aec 100644 (file)
@@ -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.',