Index: trunk/phase3/includes/FileRevertForm.php |
— | — | @@ -68,8 +68,8 @@ |
69 | 69 | $status = $this->file->upload( $source, $comment, $comment ); |
70 | 70 | if( $status->isGood() ) { |
71 | 71 | $wgOut->addHtml( wfMsgExt( 'filerevert-success', 'parse', $this->title->getText(), |
72 | | - $wgLang->date( $this->getTimestamp() ), |
73 | | - $wgLang->time( $this->getTimestamp() ), |
| 72 | + $wgLang->date( $this->getTimestamp(), true ), |
| 73 | + $wgLang->time( $this->getTimestamp(), true ), |
74 | 74 | $wgServer . $this->file->getArchiveUrl( $this->oldimage ) ) ); |
75 | 75 | $wgOut->returnToMain( false, $this->title ); |
76 | 76 | } else { |
— | — | @@ -87,37 +87,13 @@ |
88 | 88 | */ |
89 | 89 | private function showForm() { |
90 | 90 | global $wgOut, $wgUser, $wgRequest, $wgLang, $wgContLang, $wgServer; |
91 | | - |
92 | | - /* |
93 | | - $cur = wfFindFile( $this->title ); |
94 | | - $old = wfFindFile( $this->title, substr( $this->oldimage, 0, 14 ) ); |
95 | | - */ |
96 | 91 | $timestamp = $this->getTimestamp(); |
97 | 92 | |
98 | 93 | $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getAction() ) ); |
99 | 94 | $form .= Xml::hidden( 'wpEditToken', $wgUser->editToken( $this->oldimage ) ); |
100 | 95 | $form .= '<fieldset><legend>' . wfMsgHtml( 'filerevert-legend' ) . '</legend>'; |
101 | 96 | $form .= wfMsgExt( 'filerevert-intro', 'parse', $this->title->getText(), |
102 | | - $wgLang->date( $timestamp ), $wgLang->time( $timestamp ), $wgServer . $this->file->getArchiveUrl( $this->oldimage ) ); |
103 | | - |
104 | | - /* |
105 | | - * I was going to do a little comparison (current vs. old) here, |
106 | | - * but realised it wasn't too straightforward to do a media transform |
107 | | - * with an *old* file version using the current mechanism. Leaving |
108 | | - * this here in case it becomes possible in the future. -- RC |
109 | | - * |
110 | | - $form .= '<table class="compare-files">'; |
111 | | - $form .= '<tr>'; |
112 | | - $form .= '<th>' . wfMsgHtml( 'filerevert-current' ) . '</th>'; |
113 | | - $form .= '<th>' . wfMsgHtml( 'filerevert-old', $old->getTimestamp() ) . '</th>'; |
114 | | - $form .= '</tr><tr>'; |
115 | | - // FIXME: Hard-coding magic numbers makes baby Jesus cry... |
116 | | - $form .= '<td>' . $this->getThumbnail( $cur, 180 ) . '</td>'; |
117 | | - $form .= '<td>' . $this->getThumbnail( $old, 180 ) . '</td>'; |
118 | | - $form .= '</tr>'; |
119 | | - $form .= '</table>'; |
120 | | - */ |
121 | | - |
| 97 | + $wgLang->date( $timestamp, true ), $wgLang->time( $timestamp, true ), $wgServer . $this->file->getArchiveUrl( $this->oldimage ) ); |
122 | 98 | $form .= '<p>' . Xml::inputLabel( wfMsg( 'filerevert-comment' ), 'wpComment', 'wpComment', |
123 | 99 | 60, wfMsgForContent( 'filerevert-defaultcomment', |
124 | 100 | $wgContLang->date( $timestamp, false, false ), $wgContLang->time( $timestamp, false, false ) ) ) . '</p>'; |
— | — | @@ -177,7 +153,12 @@ |
178 | 154 | * @return string |
179 | 155 | */ |
180 | 156 | private function getTimestamp() { |
181 | | - return substr( $this->oldimage, 0, 14 ); |
| 157 | + static $timestamp = false; |
| 158 | + if( $timestamp === false ) { |
| 159 | + $file = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName( $this->title, $this->oldimage ); |
| 160 | + $timestamp = $file->getTimestamp(); |
| 161 | + } |
| 162 | + return $timestamp; |
182 | 163 | } |
183 | 164 | |
184 | 165 | } |
\ No newline at end of file |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1495,11 +1495,11 @@ |
1496 | 1496 | # File reversion |
1497 | 1497 | 'filerevert' => 'Revert $1', |
1498 | 1498 | 'filerevert-legend' => 'Revert file', |
1499 | | -'filerevert-intro' => "<span class=\"plainlinks\">You are reverting '''[[Media:$1|$1]]''' to the [$4 version as of $2, $3].</span>", |
| 1499 | +'filerevert-intro' => "<span class=\"plainlinks\">You are reverting '''[[Media:$1|$1]]''' to the [$4 version as of $3, $2].</span>", |
1500 | 1500 | 'filerevert-comment' => 'Comment:', |
1501 | | -'filerevert-defaultcomment' => 'Reverted to version as of $1, $2', |
| 1501 | +'filerevert-defaultcomment' => 'Reverted to version as of $2, $1', |
1502 | 1502 | 'filerevert-submit' => 'Revert', |
1503 | | -'filerevert-success' => "<span class=\"plainlinks\">'''[[Media:$1|$1]]''' has been reverted to the [$4 version as of $2, $3].</span>", |
| 1503 | +'filerevert-success' => "<span class=\"plainlinks\">'''[[Media:$1|$1]]''' has been reverted to the [$4 version as of $3, $2].</span>", |
1504 | 1504 | 'filerevert-badversion' => 'There is no previous local version of this file with the provided timestamp.', |
1505 | 1505 | |
1506 | 1506 | # File deletion |