summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialUpload.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/specials/SpecialUpload.php')
-rw-r--r--includes/specials/SpecialUpload.php254
1 files changed, 167 insertions, 87 deletions
diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php
index 09facf4f..55d09dd6 100644
--- a/includes/specials/SpecialUpload.php
+++ b/includes/specials/SpecialUpload.php
@@ -32,51 +32,57 @@ class SpecialUpload extends SpecialPage {
/**
* Constructor : initialise object
* Get data POSTed through the form and assign them to the object
- * @param $request WebRequest : data posted.
+ * @param WebRequest $request Data posted.
*/
public function __construct( $request = null ) {
parent::__construct( 'Upload', 'upload' );
}
/** Misc variables **/
- public $mRequest; // The WebRequest or FauxRequest this form is supposed to handle
+
+ /** @var WebRequest|FauxRequest The request this form is supposed to handle */
+ public $mRequest;
public $mSourceType;
- /**
- * @var UploadBase
- */
+ /** @var UploadBase */
public $mUpload;
- /**
- * @var LocalFile
- */
+ /** @var LocalFile */
public $mLocalFile;
public $mUploadClicked;
/** User input variables from the "description" section **/
- public $mDesiredDestName; // The requested target file name
+
+ /** @var string The requested target file name */
+ public $mDesiredDestName;
public $mComment;
public $mLicense;
/** User input variables from the root section **/
+
public $mIgnoreWarning;
- public $mWatchThis;
+ public $mWatchthis;
public $mCopyrightStatus;
public $mCopyrightSource;
/** Hidden variables **/
+
public $mDestWarningAck;
- public $mForReUpload; // The user followed an "overwrite this file" link
- public $mCancelUpload; // The user clicked "Cancel and return to upload form" button
+
+ /** @var bool The user followed an "overwrite this file" link */
+ public $mForReUpload;
+
+ /** @var bool The user clicked "Cancel and return to upload form" button */
+ public $mCancelUpload;
public $mTokenOk;
- public $mUploadSuccessful = false; // Subclasses can use this to determine whether a file was uploaded
+
+ /** @var bool Subclasses can use this to determine whether a file was uploaded */
+ public $mUploadSuccessful = false;
/** Text injection points for hooks not using HTMLForm **/
public $uploadFormTextTop;
public $uploadFormTextAfterSummary;
- public $mWatchthis;
-
/**
* Initialize instance variables from request and create an Upload handler
*/
@@ -127,8 +133,8 @@ class SpecialUpload extends SpecialPage {
* Handle permission checking elsewhere in order to be able to show
* custom error messages.
*
- * @param $user User object
- * @return Boolean
+ * @param User $user
+ * @return bool
*/
public function userCanExecute( User $user ) {
return UploadBase::isEnabled() && parent::userCanExecute( $user );
@@ -136,6 +142,7 @@ class SpecialUpload extends SpecialPage {
/**
* Special page entry point
+ * @param string $par
*/
public function execute( $par ) {
$this->setHeaders();
@@ -180,7 +187,8 @@ class SpecialUpload extends SpecialPage {
} else {
# Backwards compatibility hook
if ( !wfRunHooks( 'UploadForm:initial', array( &$this ) ) ) {
- wfDebug( "Hook 'UploadForm:initial' broke output of the upload form" );
+ wfDebug( "Hook 'UploadForm:initial' broke output of the upload form\n" );
+
return;
}
$this->showUploadForm( $this->getUploadForm() );
@@ -195,7 +203,7 @@ class SpecialUpload extends SpecialPage {
/**
* Show the main upload form
*
- * @param $form Mixed: an HTMLForm instance or HTML string to show
+ * @param HTMLForm|string $form An HTMLForm instance or HTML string to show
*/
protected function showUploadForm( $form ) {
# Add links if file was previously deleted
@@ -208,21 +216,20 @@ class SpecialUpload extends SpecialPage {
} else {
$this->getOutput()->addHTML( $form );
}
-
}
/**
* Get an UploadForm instance with title and text properly set.
*
* @param string $message HTML string to add to the form
- * @param string $sessionKey session key in case this is a stashed upload
- * @param $hideIgnoreWarning Boolean: whether to hide "ignore warning" check box
+ * @param string $sessionKey Session key in case this is a stashed upload
+ * @param bool $hideIgnoreWarning Whether to hide "ignore warning" check box
* @return UploadForm
*/
protected function getUploadForm( $message = '', $sessionKey = '', $hideIgnoreWarning = false ) {
# Initialize form
$context = new DerivativeContext( $this->getContext() );
- $context->setTitle( $this->getTitle() ); // Remove subpage
+ $context->setTitle( $this->getPageTitle() ); // Remove subpage
$form = new UploadForm( array(
'watch' => $this->getWatchCheck(),
'forreupload' => $this->mForReUpload,
@@ -317,23 +324,24 @@ class SpecialUpload extends SpecialPage {
$form->setSubmitText( $this->msg( 'upload-tryagain' )->escaped() );
$this->showUploadForm( $form );
}
+
/**
* Stashes the upload, shows the main form, but adds a "continue anyway button".
* Also checks whether there are actually warnings to display.
*
- * @param $warnings Array
- * @return boolean true if warnings were displayed, false if there are no
- * warnings and it should continue processing
+ * @param array $warnings
+ * @return bool True if warnings were displayed, false if there are no
+ * warnings and it should continue processing
*/
protected function showUploadWarning( $warnings ) {
# If there are no warnings, or warnings we can ignore, return early.
# mDestWarningAck is set when some javascript has shown the warning
# to the user. mForReUpload is set when the user clicks the "upload a
# new version" link.
- if ( !$warnings || ( count( $warnings ) == 1 &&
- isset( $warnings['exists'] ) &&
- ( $this->mDestWarningAck || $this->mForReUpload ) ) )
- {
+ if ( !$warnings || ( count( $warnings ) == 1
+ && isset( $warnings['exists'] )
+ && ( $this->mDestWarningAck || $this->mForReUpload ) )
+ ) {
return false;
}
@@ -350,9 +358,14 @@ class SpecialUpload extends SpecialPage {
} elseif ( $warning == 'duplicate' ) {
$msg = $this->getDupeWarning( $args );
} elseif ( $warning == 'duplicate-archive' ) {
- $msg = "\t<li>" . $this->msg( 'file-deleted-duplicate',
- Title::makeTitle( NS_FILE, $args )->getPrefixedText() )->parse()
- . "</li>\n";
+ if ( $args === '' ) {
+ $msg = "\t<li>" . $this->msg( 'file-deleted-duplicate-notitle' )->parse()
+ . "</li>\n";
+ } else {
+ $msg = "\t<li>" . $this->msg( 'file-deleted-duplicate',
+ Title::makeTitle( NS_FILE, $args )->getPrefixedText() )->parse()
+ . "</li>\n";
+ }
} else {
if ( $args === true ) {
$args = array();
@@ -397,6 +410,7 @@ class SpecialUpload extends SpecialPage {
$status = $this->mUpload->fetchFile();
if ( !$status->isOK() ) {
$this->showUploadError( $this->getOutput()->parse( $status->getWikiText() ) );
+
return;
}
@@ -414,6 +428,7 @@ class SpecialUpload extends SpecialPage {
$details = $this->mUpload->verifyUpload();
if ( $details['status'] != UploadBase::OK ) {
$this->processVerificationError( $details );
+
return;
}
@@ -422,6 +437,7 @@ class SpecialUpload extends SpecialPage {
if ( $permErrors !== true ) {
$code = array_shift( $permErrors[0] );
$this->showRecoverableUploadError( $this->msg( $code, $permErrors[0] )->parse() );
+
return;
}
@@ -442,9 +458,17 @@ class SpecialUpload extends SpecialPage {
} else {
$pageText = false;
}
- $status = $this->mUpload->performUpload( $this->mComment, $pageText, $this->mWatchthis, $this->getUser() );
+
+ $status = $this->mUpload->performUpload(
+ $this->mComment,
+ $pageText,
+ $this->mWatchthis,
+ $this->getUser()
+ );
+
if ( !$status->isGood() ) {
$this->showUploadError( $this->getOutput()->parse( $status->getWikiText() ) );
+
return;
}
@@ -456,13 +480,16 @@ class SpecialUpload extends SpecialPage {
/**
* Get the initial image page text based on a comment and optional file status information
- * @param $comment string
- * @param $license string
- * @param $copyStatus string
- * @param $source string
+ * @param string $comment
+ * @param string $license
+ * @param string $copyStatus
+ * @param string $source
* @return string
+ * @todo Use Config obj instead of globals
*/
- public static function getInitialPageText( $comment = '', $license = '', $copyStatus = '', $source = '' ) {
+ public static function getInitialPageText( $comment = '', $license = '',
+ $copyStatus = '', $source = ''
+ ) {
global $wgUseCopyrightUpload, $wgForceUIMsgAsContentMsg;
$msg = array();
@@ -496,6 +523,7 @@ class SpecialUpload extends SpecialPage {
$pageText = $comment;
}
}
+
return $pageText;
}
@@ -509,7 +537,7 @@ class SpecialUpload extends SpecialPage {
*
* Note that the page target can be changed *on the form*, so our check
* state can get out of sync.
- * @return Bool|String
+ * @return bool|string
*/
protected function getWatchCheck() {
if ( $this->getUser()->getOption( 'watchdefault' ) ) {
@@ -517,11 +545,17 @@ class SpecialUpload extends SpecialPage {
return true;
}
+ $desiredTitleObj = Title::makeTitleSafe( NS_FILE, $this->mDesiredDestName );
+ if ( $desiredTitleObj instanceof Title && $this->getUser()->isWatched( $desiredTitleObj ) ) {
+ // Already watched, don't change that
+ return true;
+ }
+
$local = wfLocalFile( $this->mDesiredDestName );
if ( $local && $local->exists() ) {
// We're uploading a new version of an existing file.
// No creation, so don't watch it if we're not already.
- return $this->getUser()->isWatched( $local->getTitle() );
+ return false;
} else {
// New page should get watched if that's our option.
return $this->getUser()->getOption( 'watchcreations' );
@@ -531,12 +565,10 @@ class SpecialUpload extends SpecialPage {
/**
* Provides output to the user for a result of UploadBase::verifyUpload
*
- * @param array $details result of UploadBase::verifyUpload
+ * @param array $details Result of UploadBase::verifyUpload
* @throws MWException
*/
protected function processVerificationError( $details ) {
- global $wgFileExtensions;
-
switch ( $details['status'] ) {
/** Statuses that only require name changing **/
@@ -571,7 +603,7 @@ class SpecialUpload extends SpecialPage {
} else {
$msg->params( $details['finalExt'] );
}
- $extensions = array_unique( $wgFileExtensions );
+ $extensions = array_unique( $this->getConfig()->get( 'FileExtensions' ) );
$msg->params( $this->getLanguage()->commaList( $extensions ),
count( $extensions ) );
@@ -610,7 +642,7 @@ class SpecialUpload extends SpecialPage {
/**
* Remove a temporarily kept file stashed by saveTempUploadedFile().
*
- * @return Boolean: success
+ * @return bool Success
*/
protected function unsaveUploadedFile() {
if ( !( $this->mUpload instanceof UploadFromStash ) ) {
@@ -619,6 +651,7 @@ class SpecialUpload extends SpecialPage {
$success = $this->mUpload->unsaveUploadedFile();
if ( !$success ) {
$this->getOutput()->showFileDeleteError( $this->mUpload->getTempPath() );
+
return false;
} else {
return true;
@@ -631,8 +664,8 @@ class SpecialUpload extends SpecialPage {
* Formats a result of UploadBase::getExistsWarning as HTML
* This check is static and can be done pre-upload via AJAX
*
- * @param array $exists the result of UploadBase::getExistsWarning
- * @return String: empty string if there is no warning or an HTML fragment
+ * @param array $exists The result of UploadBase::getExistsWarning
+ * @return string Empty string if there is no warning or an HTML fragment
*/
public static function getExistsWarning( $exists ) {
if ( !$exists ) {
@@ -683,7 +716,7 @@ class SpecialUpload extends SpecialPage {
/**
* Construct a warning and a gallery from an array of duplicate files.
- * @param $dupes array
+ * @param array $dupes
* @return string
*/
public function getDupeWarning( $dupes ) {
@@ -691,12 +724,12 @@ class SpecialUpload extends SpecialPage {
return '';
}
- $gallery = ImageGalleryBase::factory();
- $gallery->setContext( $this->getContext() );
+ $gallery = ImageGalleryBase::factory( false, $this->getContext() );
$gallery->setShowBytes( false );
foreach ( $dupes as $file ) {
$gallery->add( $file->getTitle() );
}
+
return '<li>' .
wfMessage( 'file-exists-duplicate' )->numParams( count( $dupes ) )->parse() .
$gallery->toHtml() . "</li>\n";
@@ -705,6 +738,18 @@ class SpecialUpload extends SpecialPage {
protected function getGroupName() {
return 'media';
}
+
+ /**
+ * Should we rotate images in the preview on Special:Upload.
+ *
+ * This controls js: mw.config.get( 'wgFileCanRotate' )
+ *
+ * @todo What about non-BitmapHandler handled files?
+ */
+ static public function rotationEnabled() {
+ $bitmapHandler = new BitmapHandler();
+ return $bitmapHandler->autoRotateEnabled();
+ }
}
/**
@@ -731,8 +776,7 @@ class UploadForm extends HTMLForm {
public function __construct( array $options = array(), IContextSource $context = null ) {
$this->mWatch = !empty( $options['watch'] );
$this->mForReUpload = !empty( $options['forreupload'] );
- $this->mSessionKey = isset( $options['sessionkey'] )
- ? $options['sessionkey'] : '';
+ $this->mSessionKey = isset( $options['sessionkey'] ) ? $options['sessionkey'] : '';
$this->mHideIgnoreWarning = !empty( $options['hideignorewarning'] );
$this->mDestWarningAck = !empty( $options['destwarningack'] );
$this->mDestFile = isset( $options['destfile'] ) ? $options['destfile'] : '';
@@ -754,6 +798,18 @@ class UploadForm extends HTMLForm {
wfRunHooks( 'UploadFormInitDescriptor', array( &$descriptor ) );
parent::__construct( $descriptor, $context, 'upload' );
+ # Add a link to edit MediaWik:Licenses
+ if ( $this->getUser()->isAllowed( 'editinterface' ) ) {
+ $licensesLink = Linker::link(
+ Title::makeTitle( NS_MEDIAWIKI, 'Licenses' ),
+ $this->msg( 'licenses-edit' )->escaped(),
+ array(),
+ array( 'action' => 'edit' )
+ );
+ $editLicenses = '<p class="mw-upload-editlicenses">' . $licensesLink . '</p>';
+ $this->addFooterText( $editLicenses, 'description' );
+ }
+
# Set some form properties
$this->setSubmitText( $this->msg( 'uploadbtn' )->text() );
$this->setSubmitName( 'wpUpload' );
@@ -768,18 +824,15 @@ class UploadForm extends HTMLForm {
$this->mSourceIds[] = $field['id'];
}
}
-
}
/**
* Get the descriptor of the fieldset that contains the file source
* selection. The section is 'source'
*
- * @return Array: descriptor array
+ * @return array Descriptor array
*/
protected function getSourceSection() {
- global $wgCopyUploadsFromSpecialUpload;
-
if ( $this->mSessionKey ) {
return array(
'SessionKey' => array(
@@ -794,8 +847,8 @@ class UploadForm extends HTMLForm {
}
$canUploadByUrl = UploadFromUrl::isEnabled()
- && UploadFromUrl::isAllowed( $this->getUser() )
- && $wgCopyUploadsFromSpecialUpload;
+ && ( UploadFromUrl::isAllowed( $this->getUser() ) === true )
+ && $this->getConfig()->get( 'CopyUploadsFromSpecialUpload' );
$radio = $canUploadByUrl;
$selectedSourceType = strtolower( $this->getRequest()->getText( 'wpSourceType', 'File' ) );
@@ -812,7 +865,7 @@ class UploadForm extends HTMLForm {
$this->mMaxUploadSize['file'] = UploadBase::getMaxUploadSize( 'file' );
# Limit to upload_max_filesize unless we are running under HipHop and
# that setting doesn't exist
- if ( !wfIsHipHop() ) {
+ if ( !wfIsHHVM() ) {
$this->mMaxUploadSize['file'] = min( $this->mMaxUploadSize['file'],
wfShorthandToInteger( ini_get( 'upload_max_filesize' ) ),
wfShorthandToInteger( ini_get( 'post_max_size' ) )
@@ -824,12 +877,13 @@ class UploadForm extends HTMLForm {
'section' => 'source',
'type' => 'file',
'id' => 'wpUploadFile',
+ 'radio-id' => 'wpSourceTypeFile',
'label-message' => 'sourcefilename',
'upload-type' => 'File',
'radio' => &$radio,
'help' => $this->msg( 'upload-maxfilesize',
- $this->getContext()->getLanguage()->formatSize( $this->mMaxUploadSize['file'] ) )
- ->parse() .
+ $this->getContext()->getLanguage()->formatSize( $this->mMaxUploadSize['file'] )
+ )->parse() .
$this->msg( 'word-separator' )->escaped() .
$this->msg( 'upload_source_file' )->escaped(),
'checked' => $selectedSourceType == 'file',
@@ -841,12 +895,13 @@ class UploadForm extends HTMLForm {
'class' => 'UploadSourceField',
'section' => 'source',
'id' => 'wpUploadFileURL',
+ 'radio-id' => 'wpSourceTypeurl',
'label-message' => 'sourceurl',
'upload-type' => 'url',
'radio' => &$radio,
'help' => $this->msg( 'upload-maxfilesize',
- $this->getContext()->getLanguage()->formatSize( $this->mMaxUploadSize['url'] ) )
- ->parse() .
+ $this->getContext()->getLanguage()->formatSize( $this->mMaxUploadSize['url'] )
+ )->parse() .
$this->msg( 'word-separator' )->escaped() .
$this->msg( 'upload_source_url' )->escaped(),
'checked' => $selectedSourceType == 'url',
@@ -860,41 +915,57 @@ class UploadForm extends HTMLForm {
'default' => $this->getExtensionsMessage(),
'raw' => true,
);
+
return $descriptor;
}
/**
* Get the messages indicating which extensions are preferred and prohibitted.
*
- * @return String: HTML string containing the message
+ * @return string HTML string containing the message
*/
protected function getExtensionsMessage() {
# Print a list of allowed file extensions, if so configured. We ignore
# MIME type here, it's incomprehensible to most people and too long.
- global $wgCheckFileExtensions, $wgStrictFileExtensions,
- $wgFileExtensions, $wgFileBlacklist;
+ $config = $this->getConfig();
- if ( $wgCheckFileExtensions ) {
- if ( $wgStrictFileExtensions ) {
+ if ( $config->get( 'CheckFileExtensions' ) ) {
+ if ( $config->get( 'StrictFileExtensions' ) ) {
# Everything not permitted is banned
$extensionsList =
'<div id="mw-upload-permitted">' .
- $this->msg( 'upload-permitted', $this->getContext()->getLanguage()->commaList( array_unique( $wgFileExtensions ) ) )->parseAsBlock() .
+ $this->msg(
+ 'upload-permitted',
+ $this->getContext()->getLanguage()->commaList(
+ array_unique( $config->get( 'FileExtensions' ) )
+ )
+ )->parseAsBlock() .
"</div>\n";
} else {
# We have to list both preferred and prohibited
$extensionsList =
'<div id="mw-upload-preferred">' .
- $this->msg( 'upload-preferred', $this->getContext()->getLanguage()->commaList( array_unique( $wgFileExtensions ) ) )->parseAsBlock() .
+ $this->msg(
+ 'upload-preferred',
+ $this->getContext()->getLanguage()->commaList(
+ array_unique( $config->get( 'FileExtensions' ) )
+ )
+ )->parseAsBlock() .
"</div>\n" .
'<div id="mw-upload-prohibited">' .
- $this->msg( 'upload-prohibited', $this->getContext()->getLanguage()->commaList( array_unique( $wgFileBlacklist ) ) )->parseAsBlock() .
+ $this->msg(
+ 'upload-prohibited',
+ $this->getContext()->getLanguage()->commaList(
+ array_unique( $config->get( 'FileBlacklist' ) )
+ )
+ )->parseAsBlock() .
"</div>\n";
}
} else {
# Everything is permitted.
$extensionsList = '';
}
+
return $extensionsList;
}
@@ -902,9 +973,10 @@ class UploadForm extends HTMLForm {
* Get the descriptor of the fieldset that contains the file description
* input. The section is 'description'
*
- * @return Array: descriptor array
+ * @return array Descriptor array
*/
protected function getDescriptionSection() {
+ $config = $this->getConfig();
if ( $this->mSessionKey ) {
$stash = RepoGroup::singleton()->getLocalRepo()->getUploadStash();
try {
@@ -977,8 +1049,7 @@ class UploadForm extends HTMLForm {
);
}
- global $wgUseCopyrightUpload;
- if ( $wgUseCopyrightUpload ) {
+ if ( $config->get( 'UseCopyrightUpload' ) ) {
$descriptor['UploadCopyStatus'] = array(
'type' => 'text',
'section' => 'description',
@@ -1000,7 +1071,7 @@ class UploadForm extends HTMLForm {
* Get the descriptor of the fieldset that contains the upload options,
* such as "watch this file". The section is 'options'
*
- * @return Array: descriptor array
+ * @return array Descriptor array
*/
protected function getOptionsSection() {
$user = $this->getUser();
@@ -1011,7 +1082,7 @@ class UploadForm extends HTMLForm {
'id' => 'wpWatchthis',
'label-message' => 'watchthisupload',
'section' => 'options',
- 'default' => $user->getOption( 'watchcreations' ),
+ 'default' => $this->mWatch,
)
);
}
@@ -1053,10 +1124,11 @@ class UploadForm extends HTMLForm {
* Add upload JS to the OutputPage
*/
protected function addUploadJS() {
- global $wgUseAjax, $wgAjaxUploadDestCheck, $wgAjaxLicensePreview, $wgEnableAPI, $wgStrictFileExtensions;
+ $config = $this->getConfig();
- $useAjaxDestCheck = $wgUseAjax && $wgAjaxUploadDestCheck;
- $useAjaxLicensePreview = $wgUseAjax && $wgAjaxLicensePreview && $wgEnableAPI;
+ $useAjaxDestCheck = $config->get( 'UseAjax' ) && $config->get( 'AjaxUploadDestCheck' );
+ $useAjaxLicensePreview = $config->get( 'UseAjax' ) &&
+ $config->get( 'AjaxLicensePreview' ) && $config->get( 'EnableAPI' );
$this->mMaxUploadSize['*'] = UploadBase::getMaxUploadSize();
$scriptVars = array(
@@ -1067,7 +1139,7 @@ class UploadForm extends HTMLForm {
// the wpDestFile textbox
$this->mDestFile === '',
'wgUploadSourceIds' => $this->mSourceIds,
- 'wgStrictFileExtensions' => $wgStrictFileExtensions,
+ 'wgStrictFileExtensions' => $config->get( 'StrictFileExtensions' ),
'wgCapitalizeUploads' => MWNamespace::isCapitalized( NS_FILE ),
'wgMaxUploadSize' => $this->mMaxUploadSize,
);
@@ -1077,20 +1149,18 @@ class UploadForm extends HTMLForm {
$out->addModules( array(
'mediawiki.action.edit', // For <charinsert> support
- 'mediawiki.legacy.upload', // Old form stuff...
- 'mediawiki.special.upload', // Newer extras for thumbnail preview.
+ 'mediawiki.special.upload', // Extras for thumbnail and license preview.
) );
}
/**
* Empty function; submission is handled elsewhere.
*
- * @return bool false
+ * @return bool False
*/
function trySubmit() {
return false;
}
-
}
/**
@@ -1099,7 +1169,7 @@ class UploadForm extends HTMLForm {
class UploadSourceField extends HTMLTextField {
/**
- * @param $cellAttributes array
+ * @param array $cellAttributes
* @return string
*/
function getLabelHtml( $cellAttributes = array() ) {
@@ -1107,15 +1177,25 @@ class UploadSourceField extends HTMLTextField {
$label = Html::rawElement( 'label', array( 'for' => $id ), $this->mLabel );
if ( !empty( $this->mParams['radio'] ) ) {
+ if ( isset( $this->mParams['radio-id'] ) ) {
+ $radioId = $this->mParams['radio-id'];
+ } else {
+ // Old way. For the benefit of extensions that do not define
+ // the 'radio-id' key.
+ $radioId = 'wpSourceType' . $this->mParams['upload-type'];
+ }
+
$attribs = array(
'name' => 'wpSourceType',
'type' => 'radio',
- 'id' => $id,
+ 'id' => $radioId,
'value' => $this->mParams['upload-type'],
);
+
if ( !empty( $this->mParams['checked'] ) ) {
$attribs['checked'] = 'checked';
}
+
$label .= Html::element( 'input', $attribs );
}