Index: trunk/extensions/DeleteQueue/DeleteQueue.i18n.php |
— | — | @@ -15,18 +15,23 @@ |
16 | 16 | 'deletequeue-desc' => 'Creates a [[Special:DeleteQueue|queue-based system for managing deletion]]', |
17 | 17 | |
18 | 18 | // Landing page |
| 19 | + 'deletequeue-action-queued' => 'Deletion', |
19 | 20 | 'deletequeue-action' => 'Suggest deletion', |
20 | 21 | 'deletequeue-action-title' => "Suggest deletion of \"$1\"", |
21 | 22 | 'deletequeue-action-text' => "{{SITENAME}} has a number of processes for deleting pages: |
22 | 23 | *If you believe that this page warrants ''speedy deletion'', you may suggest that [{{fullurl:{{FULLPAGENAME}}|action=delnom&queue=speedy}} here]. |
23 | 24 | *If this page does not warrant speedy deletion, but ''deletion will likely be uncontroversial'', you should [{{fullurl:{{FULLPAGENAME}}|action=delnom&queue=prod}} propose uncontested deletion]. |
24 | 25 | *If this page's deletion is ''likely to be contested'', you should [{{fullurl:{{FULLPAGENAME}}|action=delnom&queue=deletediscuss}} open a discussion].", |
| 26 | + 'deletequeue-action-text-queued' => "You may view the following pages for this deletion case: |
| 27 | +* [{{fullurl:{{FULLPAGENAME}}|action=delviewvotes}} View current endorsements and objections]. |
| 28 | +* [{{fullurl:{{FULLPAGENAME}}|action=delvote}} Endorse or object to this page's deletion].", |
25 | 29 | |
26 | 30 | // Permissions errors |
27 | 31 | 'deletequeue-permissions-noedit' => "You must be able to edit a page to be able to affect its deletion status.", |
28 | 32 | |
29 | 33 | // Nomination forms |
30 | 34 | 'deletequeue-generic-reasons' => "* Generic reasons\n ** Vandalism\n ** Spam\n ** Maintenance\n ** Out of project scope", |
| 35 | + 'deletequeue-nom-alreadyqueued' => 'This page is already in a deletion queue.', |
31 | 36 | |
32 | 37 | // Speedy deletion |
33 | 38 | 'deletequeue-speedy-title' => 'Mark "$1" for speedy deletion', |
— | — | @@ -60,6 +65,7 @@ |
61 | 66 | 'right-prod-review' => 'Review uncontested deletion proposals', |
62 | 67 | 'right-deletediscuss-nominate' => 'Start deletion discussions', |
63 | 68 | 'right-deletediscuss-review' => 'Close deletion discussions', |
| 69 | + 'right-deletequeue-vote' => 'Endorse or object to deletions', |
64 | 70 | |
65 | 71 | // Queue names |
66 | 72 | 'deletequeue-queue-speedy' => 'Speedy deletion', |
— | — | @@ -126,7 +132,6 @@ |
127 | 133 | 'deletequeue-role-vote-object' => 'objector to deletion', |
128 | 134 | |
129 | 135 | // Endorsement and objection |
130 | | - 'deletequeue-vote-tab' => 'Endorse/Object to deletion', |
131 | 136 | 'deletequeue-vote-title' => 'Endorse or object to deletion of "$1"', |
132 | 137 | 'deletequeue-vote-text' => "You may use this form to endorse or object to the deletion of \"'''$1'''\". |
133 | 138 | This action will override any previous endorsements/objections you have given to deletion of this page. |
Index: trunk/extensions/DeleteQueue/DeleteQueueInterface.php |
— | — | @@ -90,19 +90,33 @@ |
91 | 91 | $reason2 = $wgRequest->getText( 'wpExtra' ); |
92 | 92 | |
93 | 93 | $reason = self::formatReason( $reason1, $reason2 ); |
| 94 | + |
| 95 | + // Allow hooks to terminate |
| 96 | + $error = ''; |
| 97 | + if (!wfRunHooks( 'AbortDeleteQueueNominate', array($wgUser, $article, $queue, $reason, &$error) ) ) { |
| 98 | + $wgOut->addWikitext( $error ); |
| 99 | + return false; |
| 100 | + } |
94 | 101 | |
95 | 102 | // Transaction |
96 | 103 | $dbw = wfGetDB( DB_MASTER ); |
97 | 104 | $dbw->begin(); |
98 | | - |
99 | | - $log = new LogPage( 'delete' ); |
100 | | - $log->addEntry( "nominate", $article->mTitle, $reason, wfMsgNoTrans( 'deletequeue-queue-'.$queue) ); |
101 | | - |
| 105 | + |
102 | 106 | // Set in database. |
103 | 107 | $dqi = DeleteQueueItem::newFromArticle( $article ); |
| 108 | + |
| 109 | + if ($dqi->getQueue()) { |
| 110 | + $dbw->rollback(); |
| 111 | + $wgOut->addWikiMsg( 'deletequeue-nom-alreadyqueued' ); |
| 112 | + return false; |
| 113 | + } |
| 114 | + |
104 | 115 | $dqi->setQueue( $queue, $reason ); |
105 | 116 | $dqi->addRole( 'nominator' ); |
106 | 117 | |
| 118 | + $log = new LogPage( 'delete' ); |
| 119 | + $log->addEntry( "nominate", $article->mTitle, $reason, wfMsgNoTrans( 'deletequeue-queue-'.$queue) ); |
| 120 | + |
107 | 121 | $dbw->commit(); |
108 | 122 | |
109 | 123 | $wgOut->redirect( $article->mTitle->getLocalUrl() ); |