Fixes IE bug that causes lists in panel to show bullets.
[lhc/web/wiklou.git] / includes / FileDeleteForm.php
index ebab673..7480812 100644 (file)
@@ -67,7 +67,7 @@ class FileDeleteForm {
                        $reason = $this->DeleteReasonList;
                        if ( $reason != 'other' && $this->DeleteReason != '') {
                                // Entry from drop down menu + additional comment
-                               $reason .= ': ' . $this->DeleteReason;
+                               $reason .= wfMsgForContent( 'colon-separator' ) . $this->DeleteReason;
                        } elseif ( $reason == 'other' ) {
                                $reason = $this->DeleteReason;
                        }
@@ -108,9 +108,17 @@ class FileDeleteForm {
                                $id = $title->getArticleID( GAID_FOR_UPDATE );
                                // Need to delete the associated article
                                $article = new Article( $title );
-                               if( wfRunHooks('ArticleDelete', array(&$article, &$wgUser, &$reason)) ) {
-                                       if( $article->doDeleteArticle( $reason, $suppress, $id ) )
+                               $error = '';
+                               if( wfRunHooks('ArticleDelete', array(&$article, &$wgUser, &$reason, &$error)) ) {
+                                       if( $article->doDeleteArticle( $reason, $suppress, $id ) ) {
+                                               global $wgRequest;
+                                               if( $wgRequest->getCheck( 'wpWatch' ) ) {
+                                                       $article->doWatch();
+                                               } elseif( $title->userIsWatching() ) {
+                                                       $article->doUnwatch();
+                                               }
                                                wfRunHooks('ArticleDeleteComplete', array(&$article, &$wgUser, $reason, $id));
+                                       }
                                }
                        }
                }
@@ -127,7 +135,7 @@ class FileDeleteForm {
                global $wgOut, $wgUser, $wgRequest;
 
                if( $wgUser->isAllowed( 'suppressrevision' ) ) {
-                       $suppress = "<tr id=\"wpDeleteSuppressRow\" name=\"wpDeleteSuppressRow\">
+                       $suppress = "<tr id=\"wpDeleteSuppressRow\">
                                        <td></td>
                                        <td class='mw-input'>" .
                                                Xml::checkLabel( wfMsg( 'revdelete-suppress' ),
@@ -138,7 +146,9 @@ class FileDeleteForm {
                        $suppress = '';
                }
 
-               $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getAction(), 'id' => 'mw-img-deleteconfirm' ) ) .
+               $checkWatch = $wgUser->getBoolOption( 'watchdeletion' ) || $this->title->userIsWatching();
+               $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getAction(),
+                       'id' => 'mw-img-deleteconfirm' ) ) .
                        Xml::openElement( 'fieldset' ) .
                        Xml::element( 'legend', null, wfMsg( 'filedelete-legend' ) ) .
                        Xml::hidden( 'wpEditToken', $wgUser->editToken( $this->oldimage ) ) .
@@ -164,6 +174,13 @@ class FileDeleteForm {
                                "</td>
                        </tr>
                        {$suppress}
+                       <tr>
+                               <td></td>
+                               <td class='mw-input'>" .
+                                       Xml::checkLabel( wfMsg( 'watchthis' ),
+                                               'wpWatch', 'wpWatch', $checkWatch, array( 'tabindex' => '3' ) ) .
+                               "</td>
+                       </tr>
                        <tr>
                                <td></td>
                                <td class='mw-submit'>" .
@@ -177,7 +194,13 @@ class FileDeleteForm {
 
                        if ( $wgUser->isAllowed( 'editinterface' ) ) {
                                $skin = $wgUser->getSkin();
-                               $link = $skin->makeLink ( 'MediaWiki:Filedelete-reason-dropdown', wfMsgHtml( 'filedelete-edit-reasonlist' ) );
+                               $title = Title::makeTitle( NS_MEDIAWIKI, 'Filedelete-reason-dropdown' );
+                               $link = $skin->link(
+                                       $title,
+                                       wfMsgHtml( 'filedelete-edit-reasonlist' ),
+                                       array(),
+                                       array( 'action' => 'edit' )
+                               );
                                $form .= '<p class="mw-filedelete-editreasons">' . $link . '</p>';
                        }
 
@@ -228,7 +251,16 @@ class FileDeleteForm {
                global $wgOut, $wgUser;
                $wgOut->setPageTitle( wfMsg( 'filedelete', $this->title->getText() ) );
                $wgOut->setRobotPolicy( 'noindex,nofollow' );
-               $wgOut->setSubtitle( wfMsg( 'filedelete-backlink', $wgUser->getSkin()->makeKnownLinkObj( $this->title ) ) );
+               $wgOut->setSubtitle( wfMsg(
+                       'filedelete-backlink',
+                       $wgUser->getSkin()->link(
+                               $this->title,
+                               null,
+                               array(),
+                               array(),
+                               array( 'known', 'noclasses' )
+                       )
+               ) );
        }
 
        /**
@@ -262,10 +294,12 @@ class FileDeleteForm {
         */
        private function getAction() {
                $q = array();
-               $q[] = 'action=delete';
+               $q['action'] = 'delete';
+
                if( $this->oldimage )
-                       $q[] = 'oldimage=' . urlencode( $this->oldimage );
-               return $this->title->getLocalUrl( implode( '&', $q ) );
+                       $q['oldimage'] = $this->oldimage;
+
+               return $this->title->getLocalUrl( $q );
        }
 
        /**
@@ -276,5 +310,4 @@ class FileDeleteForm {
        private function getTimestamp() {
                return $this->oldfile->getTimestamp();
        }
-
 }