Merge "Use {{int:}} on MediaWiki:Blockedtext and MediaWiki:Autoblockedtext"
[lhc/web/wiklou.git] / includes / specials / forms / UploadForm.php
index 44d91a8..e561fe5 100644 (file)
@@ -159,7 +159,7 @@ class UploadForm extends HTMLForm {
                }
 
                $descriptor['UploadFile'] = [
-                       'class' => 'UploadSourceField',
+                       'class' => UploadSourceField::class,
                        'section' => 'source',
                        'type' => 'file',
                        'id' => 'wpUploadFile',
@@ -174,7 +174,7 @@ class UploadForm extends HTMLForm {
                if ( $canUploadByUrl ) {
                        $this->mMaxUploadSize['url'] = UploadBase::getMaxUploadSize( 'url' );
                        $descriptor['UploadFileURL'] = [
-                               'class' => 'UploadSourceField',
+                               'class' => UploadSourceField::class,
                                'section' => 'source',
                                'id' => 'wpUploadFileURL',
                                'radio-id' => 'wpSourceTypeurl',
@@ -322,7 +322,7 @@ class UploadForm extends HTMLForm {
                } else {
                        $descriptor['License'] = [
                                'type' => 'select',
-                               'class' => 'Licenses',
+                               'class' => Licenses::class,
                                'section' => 'description',
                                'id' => 'wpLicense',
                                'label-message' => 'license',
@@ -406,14 +406,11 @@ class UploadForm extends HTMLForm {
        protected function addUploadJS() {
                $config = $this->getConfig();
 
-               $useAjaxDestCheck = $config->get( 'UseAjax' ) && $config->get( 'AjaxUploadDestCheck' );
-               $useAjaxLicensePreview = $config->get( 'UseAjax' ) &&
-                       $config->get( 'AjaxLicensePreview' ) && $config->get( 'EnableAPI' );
                $this->mMaxUploadSize['*'] = UploadBase::getMaxUploadSize();
 
                $scriptVars = [
-                       'wgAjaxUploadDestCheck' => $useAjaxDestCheck,
-                       'wgAjaxLicensePreview' => $useAjaxLicensePreview,
+                       'wgAjaxUploadDestCheck' => $config->get( 'AjaxUploadDestCheck' ),
+                       'wgAjaxLicensePreview' => $config->get( 'AjaxLicensePreview' ),
                        'wgUploadAutoFill' => !$this->mForReUpload &&
                                // If we received mDestFile from the request, don't autofill
                                // the wpDestFile textbox