Only whitespace changes
[lhc/web/wiklou.git] / includes / specials / SpecialRevisiondelete.php
index 554d025..cc4c8a4 100644 (file)
@@ -38,9 +38,6 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
        /** The RevDel_List object, storing the list of items to be deleted/undeleted */
        var $list;
 
-       /** New bitfield value, used for form display post-submit */
-       var $newBits;
-
        /**
         * Assorted information about each type, needed by the special page.
         * TODO Move some of this to the list class
@@ -170,11 +167,13 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                $qc = $this->getLogQueryCond();
                # Show relevant lines from the deletion log
                $wgOut->addHTML( "<h2>" . htmlspecialchars( LogPage::logName( 'delete' ) ) . "</h2>\n" );
-               LogEventsList::showLogExtract( $wgOut, 'delete', $this->targetObj->getPrefixedText(), '', 25, $qc );
+               LogEventsList::showLogExtract( $wgOut, 'delete',
+                       $this->targetObj->getPrefixedText(), '', 25, $qc );
                # Show relevant lines from the suppression log
                if( $wgUser->isAllowed( 'suppressionlog' ) ) {
                        $wgOut->addHTML( "<h2>" . htmlspecialchars( LogPage::logName( 'suppress' ) ) . "</h2>\n" );
-                       LogEventsList::showLogExtract( $wgOut, 'suppress', $this->targetObj->getPrefixedText(), '', 25, $qc );
+                       LogEventsList::showLogExtract( $wgOut, 'suppress',
+                               $this->targetObj->getPrefixedText(), '', 25, $qc );
                }
        }
 
@@ -187,16 +186,28 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                if( $this->targetObj ) {
                        $links = array();
                        $logtitle = SpecialPage::getTitleFor( 'Log' );
-                       $links[] = $this->skin->makeKnownLinkObj( $logtitle, wfMsgHtml( 'viewpagelogs' ),
-                               wfArrayToCGI( array( 'page' => $this->targetObj->getPrefixedUrl() ) ) );
+                       $links[] = $this->skin->linkKnown(
+                               $logtitle,
+                               wfMsgHtml( 'viewpagelogs' ),
+                               array(),
+                               array( 'page' => $this->targetObj->getPrefixedText() )
+                       );
                        # Give a link to the page history
-                       $links[] = $this->skin->makeKnownLinkObj( $this->targetObj, wfMsgHtml( 'pagehist' ),
-                               wfArrayToCGI( array( 'action' => 'history' ) ) );
+                       $links[] = $this->skin->linkKnown(
+                               $this->targetObj,
+                               wfMsgHtml( 'pagehist' ),
+                               array(),
+                               array( 'action' => 'history' )
+                       );
                        # Link to deleted edits
                        if( $wgUser->isAllowed('undelete') ) {
                                $undelete = SpecialPage::getTitleFor( 'Undelete' );
-                               $links[] = $this->skin->makeKnownLinkObj( $undelete, wfMsgHtml( 'deletedhist' ),
-                                       wfArrayToCGI( array( 'target' => $this->targetObj->getPrefixedDBkey() ) ) );
+                               $links[] = $this->skin->linkKnown(
+                                       $undelete,
+                                       wfMsgHtml( 'deletedhist' ),
+                                       array(),
+                                       array( 'target' => $this->targetObj->getPrefixedDBkey() )
+                               );
                        }
                        # Logs themselves don't have histories or archived revisions
                        $wgOut->setSubtitle( '<p>'.implode($links,' / ').'</p>' );
@@ -293,7 +304,8 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                if ( $this->typeName == 'logging' ) {
                        $wgOut->addWikiMsg( 'logdelete-selected', $wgLang->formatNum( count($this->ids) ) );
                } else {
-                       $wgOut->addWikiMsg( 'revdelete-selected', $this->targetObj->getPrefixedText(), count( $this->ids ) );
+                       $wgOut->addWikiMsg( 'revdelete-selected',
+                               $this->targetObj->getPrefixedText(), count( $this->ids ) );
                }
 
                $bitfields = 0;
@@ -322,10 +334,6 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                        $wgOut->showErrorPage( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
                        return;
                }
-
-               if ( !is_null( $this->newBits ) ) {
-                       $bitfields = $this->newBits;
-               }
                
                $wgOut->addHTML( "</ul>" );
                // Explanation text
@@ -336,7 +344,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
 
                $wgOut->addHTML(
                        Xml::openElement( 'form', array( 'method' => 'post',
-                               'action' => $this->getTitle()->getLocalUrl( 'action=submit' ), 
+                               'action' => $this->getTitle()->getLocalUrl( array( 'action' => 'submit' ) ), 
                                'id' => 'mw-revdel-form-revisions' ) ) .
                        Xml::openElement( 'fieldset' ) .
                        Xml::element( 'legend', null,  wfMsg( 'revdelete-legend' ) ) .
@@ -419,6 +427,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                global $wgOut;
                $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) );
                $wgOut->wrapWikiMsg( '<span class="success">$1</span>', $this->typeInfo['success'] );
+               $this->list->reloadFromMaster();
                $this->showForm();
        }
 
@@ -456,7 +465,6 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                if( $bitfield == Revision::DELETED_RESTRICTED ) {
                        return Status::newFatal( 'revdelete-only-restricted' );
                }
-               $this->newBits = $bitfield;
                return $this->getList()->setVisibility( array(
                        'value' => $bitfield,
                        'comment' => $reason ) );
@@ -709,6 +717,15 @@ abstract class RevDel_List {
                return $status;
        }
 
+       /**
+        * Reload the list data from the master DB. This can be done after setVisibility()
+        * to allow $item->getHTML() to show the new data.
+        */
+       function reloadFromMaster() {
+               $dbw = wfGetDB( DB_MASTER );
+               $this->res = $this->doQuery( $dbw );
+       }
+
        /**
         * Record a log entry on the action
         * @param $params Associative array of parameters:
@@ -734,7 +751,8 @@ abstract class RevDel_List {
                $logParams = $this->getLogParams( $params );
                // Actually add the deletion log entry
                $log = new LogPage( $logType );
-               $logid = $log->addEntry( $this->getLogAction(), $params['title'], $params['comment'], $logParams );
+               $logid = $log->addEntry( $this->getLogAction(), $params['title'],
+                       $params['comment'], $logParams );
                // Allow for easy searching of deletion log items for revision/log items
                $log->addRelations( $field, $params['ids'], $logid );
        }
@@ -1032,7 +1050,8 @@ class RevDel_RevisionItem extends RevDel_Item {
                        ),
                        array(
                                'rc_this_oldid' => $this->revision->getId(), // condition
-                               'rc_timestamp' => $dbw->timestamp( $this->revision->getTimestamp() ), // non-unique index
+                               // non-unique timestamp index
+                               'rc_timestamp' => $dbw->timestamp( $this->revision->getTimestamp() ),
                        ),
                        __METHOD__
                );
@@ -1058,8 +1077,15 @@ class RevDel_RevisionItem extends RevDel_Item {
                if ( $this->isDeleted() && !$this->canView() ) {
                        return $date;
                }
-               return $this->special->skin->makeLinkObj( $this->list->title, $date, 
-                       'oldid='.$this->revision->getId() . '&unhide=1' );
+               return $this->special->skin->link(
+                       $this->list->title,
+                       $date, 
+                       array(),
+                       array(
+                               'oldid' => $this->revision->getId(),
+                               'unhide' => 1
+                       )
+               );
        }
 
        /**
@@ -1071,10 +1097,19 @@ class RevDel_RevisionItem extends RevDel_Item {
                        return wfMsgHtml('diff');
                } else {
                        return 
-                               $this->special->skin->makeKnownLinkObj
+                               $this->special->skin->link
                                        $this->list->title, 
                                        wfMsgHtml('diff'),
-                                       'diff=' . $this->revision->getId() . '&oldid=prev&unhide=1' 
+                                       array(),
+                                       array(
+                                               'diff' => $this->revision->getId(),
+                                               'oldid' => 'prev',
+                                               'unhide' => 1
+                                       ),
+                                       array(
+                                               'known',
+                                               'noclasses'
+                                       )
                                );
                }
        }
@@ -1547,8 +1582,12 @@ class RevDel_LogItem extends RevDel_Item {
                $title = Title::makeTitle( $this->row->log_namespace, $this->row->log_title );
 
                $logtitle = SpecialPage::getTitleFor( 'Log' );
-               $loglink = $this->special->skin->link( $logtitle, wfMsgHtml( 'log' ), array(),
-                       array( 'page' => $title->getPrefixedUrl() ) );
+               $loglink = $this->special->skin->link(
+                       $logtitle,
+                       wfMsgHtml( 'log' ),
+                       array(),
+                       array( 'page' => $title->getPrefixedText() )
+               );
                // Action text
                if( !$this->canView() ) {
                        $action = '<span class="history-deleted">' . wfMsgHtml('rev-deleted-event') . '</span>';