filebackend: use self:: instead of FileBackend:: for some constant uses
[lhc/web/wiklou.git] / includes / FileDeleteForm.php
index 75eedcc..1241e1c 100644 (file)
@@ -147,7 +147,7 @@ class FileDeleteForm {
         * Really delete the file
         *
         * @param Title &$title
-        * @param File &$file
+        * @param LocalFile &$file
         * @param string &$oldimage Archive name
         * @param string $reason Reason of the deletion
         * @param bool $suppress Whether to mark all deleted versions as restricted
@@ -167,7 +167,7 @@ class FileDeleteForm {
                if ( $oldimage ) {
                        $page = null;
                        $status = $file->deleteOld( $oldimage, $reason, $suppress, $user );
-                       if ( $status->ok ) {
+                       if ( $status->isOK() ) {
                                // Need to do a log item
                                $logComment = wfMessage( 'deletedrevision', $oldimage )->inContentLanguage()->text();
                                if ( trim( $reason ) != '' ) {
@@ -255,17 +255,18 @@ class FileDeleteForm {
 
                $wgOut->enableOOUI();
 
+               $fields = [];
+
+               $fields[] = new OOUI\LabelWidget( [ 'label' => new OOUI\HtmlSnippet(
+                       $this->prepareMessage( 'filedelete-intro' ) ) ]
+               );
+
                $options = Xml::listDropDownOptions(
                        $wgOut->msg( 'filedelete-reason-dropdown' )->inContentLanguage()->text(),
                        [ 'other' => $wgOut->msg( 'filedelete-reason-otherlist' )->inContentLanguage()->text() ]
                );
                $options = Xml::listDropDownOptionsOoui( $options );
 
-               $fields = [];
-               $fields[] = new OOUI\LabelWidget( [ 'label' => new OOUI\HtmlSnippet(
-                       $this->prepareMessage( 'filedelete-intro' ) ) ]
-               );
-
                $fields[] = new OOUI\FieldLayout(
                        new OOUI\DropdownInputWidget( [
                                'name' => 'wpDeleteReasonList',