Make prompt text configurable
This commit is contained in:
parent
362acf63d6
commit
94ae0b7cbc
|
|
@ -31,6 +31,11 @@ class FileUpload extends FormWidgetBase
|
|||
// Configurable properties
|
||||
//
|
||||
|
||||
/**
|
||||
* @var string Prompt to display if no record is selected.
|
||||
*/
|
||||
public $prompt = 'Click the %s or drag a file here to upload';
|
||||
|
||||
/**
|
||||
* @var int Preview image width
|
||||
*/
|
||||
|
|
@ -79,6 +84,7 @@ class FileUpload extends FormWidgetBase
|
|||
public function init()
|
||||
{
|
||||
$this->fillFromConfig([
|
||||
'prompt',
|
||||
'imageWidth',
|
||||
'imageHeight',
|
||||
'previewNoFilesMessage',
|
||||
|
|
@ -113,6 +119,7 @@ class FileUpload extends FormWidgetBase
|
|||
$this->vars['acceptedFileTypes'] = $this->getAcceptedFileTypes(true);
|
||||
$this->vars['cssDimensions'] = $this->getCssDimensions();
|
||||
$this->vars['useCaption'] = $this->useCaption;
|
||||
$this->vars['prompt'] = str_replace('%s', '<i class="icon-upload"></i>', $this->prompt);
|
||||
}
|
||||
|
||||
protected function getFileList()
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
<!-- Empty message -->
|
||||
<div class="upload-empty-message">
|
||||
<span class="text-muted">Click the <i class="icon-upload"></i> or drag a file here to upload</span>
|
||||
<span class="text-muted"><?= $prompt ?></span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue