Index: trunk/phase3/includes/FileDeleteForm.php |
— | — | @@ -109,8 +109,15 @@ |
110 | 110 | // Need to delete the associated article |
111 | 111 | $article = new Article( $title ); |
112 | 112 | if( wfRunHooks('ArticleDelete', array(&$article, &$wgUser, &$reason)) ) { |
113 | | - if( $article->doDeleteArticle( $reason, $suppress, $id ) ) |
| 113 | + if( $article->doDeleteArticle( $reason, $suppress, $id ) ) { |
| 114 | + global $wgRequest; |
| 115 | + if( $wgRequest->getCheck( 'wpWatch' ) ) { |
| 116 | + $article->doWatch(); |
| 117 | + } elseif( $this->mTitle->userIsWatching() ) { |
| 118 | + $article->doUnwatch(); |
| 119 | + } |
114 | 120 | wfRunHooks('ArticleDeleteComplete', array(&$article, &$wgUser, $reason, $id)); |
| 121 | + } |
115 | 122 | } |
116 | 123 | } |
117 | 124 | } |
— | — | @@ -127,7 +134,7 @@ |
128 | 135 | global $wgOut, $wgUser, $wgRequest; |
129 | 136 | |
130 | 137 | if( $wgUser->isAllowed( 'suppressrevision' ) ) { |
131 | | - $suppress = "<tr id=\"wpDeleteSuppressRow\" name=\"wpDeleteSuppressRow\"> |
| 138 | + $suppress = "<tr id=\"wpDeleteSuppressRow\"> |
132 | 139 | <td></td> |
133 | 140 | <td class='mw-input'>" . |
134 | 141 | Xml::checkLabel( wfMsg( 'revdelete-suppress' ), |
— | — | @@ -138,7 +145,9 @@ |
139 | 146 | $suppress = ''; |
140 | 147 | } |
141 | 148 | |
142 | | - $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getAction(), 'id' => 'mw-img-deleteconfirm' ) ) . |
| 149 | + $checkWatch = $wgUser->getBoolOption( 'watchdeletion' ) || $this->title->userIsWatching(); |
| 150 | + $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getAction(), |
| 151 | + 'id' => 'mw-img-deleteconfirm' ) ) . |
143 | 152 | Xml::openElement( 'fieldset' ) . |
144 | 153 | Xml::element( 'legend', null, wfMsg( 'filedelete-legend' ) ) . |
145 | 154 | Xml::hidden( 'wpEditToken', $wgUser->editToken( $this->oldimage ) ) . |
— | — | @@ -166,6 +175,13 @@ |
167 | 176 | {$suppress} |
168 | 177 | <tr> |
169 | 178 | <td></td> |
| 179 | + <td class='mw-input'>" . |
| 180 | + Xml::checkLabel( wfMsg( 'watchthis' ), |
| 181 | + 'wpWatch', 'wpWatch', $checkWatch, array( 'tabindex' => '3' ) ) . |
| 182 | + "</td> |
| 183 | + </tr> |
| 184 | + <tr> |
| 185 | + <td></td> |
170 | 186 | <td class='mw-submit'>" . |
171 | 187 | Xml::submitButton( wfMsg( 'filedelete-submit' ), |
172 | 188 | array( 'name' => 'mw-filedelete-submit', 'id' => 'mw-filedelete-submit', 'tabindex' => '4' ) ) . |