r91346 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91345‎ | r91346 | r91347 >
Date:09:08, 2 July 2011
Author:aaron
Status:ok
Tags:
Comment:
Removed dead $undeletedRevisions code (useless since r87804)
Modified paths:
  • /trunk/phase3/includes/revisiondelete/RevisionDeleter.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/revisiondelete/RevisionDeleter.php
@@ -163,7 +163,7 @@
164164 public static function getLogLinks( $title, $paramArray, $skin, $messages ) {
165165 global $wgLang;
166166
167 - if( count($paramArray) >= 2 ) {
 167+ if ( count( $paramArray ) >= 2 ) {
168168 // Different revision types use different URL params...
169169 $originalKey = $key = $paramArray[0];
170170 // $paramArray[1] is a CSV of the IDs
@@ -171,19 +171,10 @@
172172
173173 $revert = array();
174174
175 - // For if undeleted revisions are found amidst deleted ones.
176 - $undeletedRevisions = array();
177 -
178 - // This is not going to work if some revs are deleted and some
179 - // aren't.
180 - if ($key == 'revision') {
181 - // Nothing to do; deleted revisions can still be looked up by ID.
182 - }
183 -
184175 // Diff link for single rev deletions
185 - if( count($Ids) == 1 && !count($undeletedRevisions) ) {
 176+ if ( count( $Ids ) == 1 ) {
186177 // Live revision diffs...
187 - if( in_array( $key, array( 'oldid', 'revision' ) ) ) {
 178+ if ( in_array( $key, array( 'oldid', 'revision' ) ) ) {
188179 $revert[] = $skin->link(
189180 $title,
190181 $messages['diff'],
@@ -195,7 +186,7 @@
196187 array( 'known', 'noclasses' )
197188 );
198189 // Deleted revision diffs...
199 - } elseif( in_array( $key, array( 'artimestamp','archive' ) ) ) {
 190+ } elseif ( in_array( $key, array( 'artimestamp','archive' ) ) ) {
200191 $revert[] = $skin->link(
201192 SpecialPage::getTitleFor( 'Undelete' ),
202193 $messages['diff'],
@@ -211,53 +202,18 @@
212203 }
213204
214205 // View/modify link...
215 - if ( count( $undeletedRevisions ) ) {
216 - // @todo FIXME: THIS IS A HORRIBLE HORRIBLE HACK AND SHOULD DIE
217 - // It's not possible to pass a list of both deleted and
218 - // undeleted revisions to SpecialRevisionDelete, so we're
219 - // stuck with two links. See bug 23363.
220 - $restoreLinks = array();
 206+ $revert[] = $skin->link(
 207+ SpecialPage::getTitleFor( 'Revisiondelete' ),
 208+ $messages['revdel-restore'],
 209+ array(),
 210+ array(
 211+ 'target' => $title->getPrefixedText(),
 212+ 'type' => $key,
 213+ 'ids' => implode(',', $Ids),
 214+ ),
 215+ array( 'known', 'noclasses' )
 216+ );
221217
222 - $restoreLinks[] = $skin->link(
223 - SpecialPage::getTitleFor( 'Revisiondelete' ),
224 - $messages['revdel-restore-visible'],
225 - array(),
226 - array(
227 - 'target' => $title->getPrefixedText(),
228 - 'type' => $originalKey,
229 - 'ids' => implode( ',', $undeletedRevisions ),
230 - ),
231 - array( 'known', 'noclasses' )
232 - );
233 -
234 - $restoreLinks[] = $skin->link(
235 - SpecialPage::getTitleFor( 'Revisiondelete' ),
236 - $messages['revdel-restore-deleted'],
237 - array(),
238 - array(
239 - 'target' => $title->getPrefixedText(),
240 - 'type' => $key,
241 - 'ids' => implode(',', $Ids),
242 - ),
243 - array( 'known', 'noclasses' )
244 - );
245 -
246 - $revert[] = $messages['revdel-restore'] . ' [' .
247 - $wgLang->pipeList( $restoreLinks ) . ']';
248 - } else {
249 - $revert[] = $skin->link(
250 - SpecialPage::getTitleFor( 'Revisiondelete' ),
251 - $messages['revdel-restore'],
252 - array(),
253 - array(
254 - 'target' => $title->getPrefixedText(),
255 - 'type' => $key,
256 - 'ids' => implode(',', $Ids),
257 - ),
258 - array( 'known', 'noclasses' )
259 - );
260 - }
261 -
262218 // Pipe links
263219 return wfMsg( 'parentheses', $wgLang->pipeList( $revert ) );
264220 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r87804* (bug 21279) Special:RevisionDelete now uses revision ID for deleted-page re...brion01:11, 10 May 2011

Status & tagging log