r43273 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43272‎ | r43273 | r43274 >
Date:09:15, 7 November 2008
Author:werdna
Status:old
Tags:
Comment:
Miscellaneous cleanup.
Modified paths:
  • /trunk/extensions/DeleteQueue/DeleteQueue.hooks.php (modified) (history)
  • /trunk/extensions/DeleteQueue/DeleteQueue.php (modified) (history)
  • /trunk/extensions/DeleteQueue/DeleteQueueItem.php (modified) (history)
  • /trunk/extensions/DeleteQueue/ReviewForm.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DeleteQueue/DeleteQueue.hooks.php
@@ -43,9 +43,9 @@
4444 'class' => $selected ? 'selected' : false );
4545 }
4646
47 - $actions['delvote'] = array(
48 - 'text' => wfMsg('deletequeue-vote-tab'),
49 - 'href' => $st->mTitle->getLocalUrl( 'action=delvote' ),
 47+ $actions['deletequeue'] = array(
 48+ 'text' => wfMsg('deletequeue-action-queued'),
 49+ 'href' => $st->mTitle->getLocalUrl( 'action=deletequeue' ),
5050 'class' => ($action == 'delvote') ? 'selected' : false );
5151 }
5252
@@ -65,7 +65,15 @@
6666 global $wgOut;
6767
6868 $wgOut->setPageTitle( wfMsg( 'deletequeue-action-title', $article->mTitle->getPrefixedText() ) );
69 - $wgOut->addWikitext( wfMsg( 'deletequeue-action-text' ) );
 69+
 70+ $dqi = DeleteQueueItem::newFromArticle( $article );
 71+
 72+ if ( $dqi->getQueue() == '' )
 73+ $wgOut->addWikiMsg('deletequeue-action-text' );
 74+ else {
 75+ self::onArticleViewHeader( $article );
 76+ $wgOut->addWikiMsg( 'deletequeue-action-text-queued' );
 77+ }
7078 return false;
7179 } elseif ( $action == 'delreview' ) {
7280 wfLoadExtensionMessages( 'DeleteQueue' );
Index: trunk/extensions/DeleteQueue/ReviewForm.php
@@ -78,7 +78,7 @@
7979 if ($processed) {
8080 // Delete from the DB
8181 $dqi->deQueue( );
82 -
 82+
8383 // Redirect to the page
8484 $wgOut->redirect( $article->mTitle->getLocalURL() );
8585
Index: trunk/extensions/DeleteQueue/DeleteQueueItem.php
@@ -300,6 +300,9 @@
301301 * @param User $user The user to assign to that role. Optional.
302302 */
303303 public function addRole( $role, $user=null ) {
 304+ if (!$this->getCaseID())
 305+ return; // Case doesn't exist anymore.
 306+
304307 if ( $user == null ) {
305308 global $wgUser;
306309 $user = $wgUser;
@@ -322,6 +325,9 @@
323326 * @param string $user The user who's voted (Optional)
324327 */
325328 public function addVote( $action, $comments, $user = null ) {
 329+ if (!$this->getCaseID())
 330+ return; // Case doesn't exist anymore.
 331+
326332 if ( $user == null ) {
327333 global $wgUser;
328334 $user = $wgUser;
@@ -355,6 +361,10 @@
356362 * @param string $timestamp Timestamp in database format. Optional.
357363 */
358364 public function setQueue( $queue, $reason, $timestamp = null ) {
 365+
 366+ if (!$this->getCaseID())
 367+ return; // Case doesn't exist anymore.
 368+
359369 $dbw = wfGetDB( DB_MASTER );
360370
361371 if ($timestamp == null) {
@@ -405,15 +415,20 @@
406416 // Reload new data from the master.
407417 $this->loadData(true);
408418
409 - $this->getArticle()->mTitle->invalidateCache();
410 - $this->getArticle()->mTitle->purgeSquid();
 419+ if ($this->getArticle()->mTitle) {
 420+ $this->getArticle()->mTitle->invalidateCache();
 421+ $this->getArticle()->mTitle->purgeSquid();
 422+ }
411423 }
412424
413425 /**
414426 * Remove this page from all queues
415427 */
416 - public function deQueue( $article ) {
 428+ public function deQueue( ) {
417429 $dbw = wfGetDB( DB_MASTER );
 430+
 431+ if (!$this->getCaseID())
 432+ return; // Case doesn't exist anymore.
418433
419434 $dbw->update( 'delete_queue', array( 'dq_active' => 0 ), array( 'dq_case' => $this->getCaseID() ), __METHOD__ );
420435
Index: trunk/extensions/DeleteQueue/DeleteQueue.php
@@ -45,14 +45,14 @@
4646 $wgAvailableRights[] = 'deletediscuss-review';
4747 $wgAvailableRights[] = 'deletequeue-vote';
4848
49 -$wgGroupPermissions['sysop']['prod-admin'] = true;
5049 $wgGroupPermissions['sysop']['speedy-review'] = true;
5150 $wgGroupPermissions['sysop']['deletediscuss-review'] = true;
 51+$wgGroupPermissions['sysop']['prod-review'] = true;
5252
53 -$wgGroupPermissions['autoconfirmed']['prod-review'] = true;
5453 $wgGroupPermissions['autoconfirmed']['deletequeue-vote'] = true;
5554 $wgGroupPermissions['autoconfirmed']['speedy-nominate'] = true;
5655 $wgGroupPermissions['autoconfirmed']['prod-nominate'] = true;
 56+$wgGroupPermissions['autoconfirmed']['deletediscuss-nominate'] = true;
5757
5858 $wgLogActions['delete/nominate'] = 'deletequeue-log-nominate';
5959 $wgLogActions['delete/dequeue'] = 'deletequeue-log-dequeue';

Status & tagging log