Followup r87340: Post-hook swap bodytext into a new bodycontent key and append printf...
[lhc/web/wiklou.git] / includes / FileDeleteForm.php
index 54c19f0..e2c95c2 100644 (file)
@@ -37,7 +37,7 @@ class FileDeleteForm {
                        return;
                }
                $permission_errors = $this->title->getUserPermissionsErrors('delete', $wgUser);
-               if (count($permission_errors)>0) {
+               if ( count( $permission_errors ) > 0 ) {
                        $wgOut->showPermissionsErrorPage( $permission_errors );
                        return;
                }
@@ -74,8 +74,12 @@ class FileDeleteForm {
 
                        $status = self::doDelete( $this->title, $this->file, $this->oldimage, $reason, $suppress );
 
-                       if( !$status->isGood() )
+                       if( !$status->isGood() ) {
+                               $wgOut->addHTML( '<h2>' . $this->prepareMessage( 'filedeleteerror-short' ) . "</h2>\n" );
+                               $wgOut->addHTML( '<span class="error">' );
                                $wgOut->addWikiText( $status->getWikiText( 'filedeleteerror-short', 'filedeleteerror-long' ) );
+                               $wgOut->addHTML( '</span>' );
+                       }
                        if( $status->ok ) {
                                $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) );
                                $wgOut->addHTML( $this->prepareMessage( 'filedelete-success' ) );
@@ -141,7 +145,7 @@ class FileDeleteForm {
                                throw $e;
                        }
                }
-               if( $status->isGood() ) 
+               if( $status->isGood() )
                        wfRunHooks('FileDeleteComplete', array( &$file, &$oldimage, &$article, &$wgUser, &$reason));
 
                return $status;
@@ -193,7 +197,7 @@ class FileDeleteForm {
                                "</td>
                        </tr>
                        {$suppress}";
-               if( $wgUser->isLoggedIn() ) {   
+               if( $wgUser->isLoggedIn() ) {
                        $form .= "
                        <tr>
                                <td></td>
@@ -256,7 +260,7 @@ class FileDeleteForm {
                                wfEscapeWikiText( $this->title->getText() ),
                                $wgLang->date( $this->getTimestamp(), true ),
                                $wgLang->time( $this->getTimestamp(), true ),
-                               wfExpandUrl( $this->file->getArchiveUrl( $this->oldimage ) ) );
+                               wfExpandUrl( $this->file->getArchiveUrl( $this->oldimage ), PROTO_CURRENT ) );
                } else {
                        return wfMsgExt(
                                $message,