mirror of
https://github.com/processwire/processwire.git
synced 2025-08-09 00:06:55 +02:00
Fix issue processwire/processwire-issues#38
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
* @property bool|int $uploadOnlyMode Set to true or 1 to disable existing file list display
|
* @property bool|int $uploadOnlyMode Set to true or 1 to disable existing file list display
|
||||||
* @property bool|int $noCollapseItem Set to true to disable collapsed items (like for LanguageTranslator tool or other things that add tools to files)
|
* @property bool|int $noCollapseItem Set to true to disable collapsed items (like for LanguageTranslator tool or other things that add tools to files)
|
||||||
* @property bool|int $noShortName Set to true to disable shortened filenames in output
|
* @property bool|int $noShortName Set to true to disable shortened filenames in output
|
||||||
|
* @property bool|int $noCustomButton Set to true to disable use of the styled <input type='file'>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class InputfieldFile extends Inputfield implements InputfieldItemList {
|
class InputfieldFile extends Inputfield implements InputfieldItemList {
|
||||||
@@ -102,6 +103,7 @@ class InputfieldFile extends Inputfield implements InputfieldItemList {
|
|||||||
$this->set('noAjax', 0); // disable ajax uploading
|
$this->set('noAjax', 0); // disable ajax uploading
|
||||||
$this->set('noCollapseItem', 0);
|
$this->set('noCollapseItem', 0);
|
||||||
$this->set('noShortName', 0);
|
$this->set('noShortName', 0);
|
||||||
|
$this->set('noCustomButton', false);
|
||||||
$this->attr('type', 'file');
|
$this->attr('type', 'file');
|
||||||
|
|
||||||
$this->labels = array(
|
$this->labels = array(
|
||||||
@@ -406,14 +408,23 @@ class InputfieldFile extends Inputfield implements InputfieldItemList {
|
|||||||
"data-extensions='$extensions' " .
|
"data-extensions='$extensions' " .
|
||||||
"data-fieldname='$attrs[name]' " .
|
"data-fieldname='$attrs[name]' " .
|
||||||
"class='InputfieldFileUpload'>
|
"class='InputfieldFileUpload'>
|
||||||
|
";
|
||||||
|
|
||||||
|
if($this->getSetting('noCustomButton')) {
|
||||||
|
$out .= "<input $attrStr>";
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$out .= "
|
||||||
<div class='InputMask ui-button ui-state-default'>
|
<div class='InputMask ui-button ui-state-default'>
|
||||||
<span class='ui-button-text'>
|
<span class='ui-button-text'>
|
||||||
<i class='fa fa-fw fa-folder-open-o'></i>$chooseLabel
|
<i class='fa fa-fw fa-folder-open-o'></i>$chooseLabel
|
||||||
</span>
|
</span>
|
||||||
<input $attrStr>
|
<input $attrStr>
|
||||||
</div>
|
</div>
|
||||||
|
";
|
||||||
|
}
|
||||||
|
|
||||||
|
$out .= "
|
||||||
<span class='InputfieldFileValidExtensions detail'>$formatExtensions</span>
|
<span class='InputfieldFileValidExtensions detail'>$formatExtensions</span>
|
||||||
<input type='hidden' class='InputfieldFileMaxFiles' value='$this->maxFiles' />
|
<input type='hidden' class='InputfieldFileMaxFiles' value='$this->maxFiles' />
|
||||||
";
|
";
|
||||||
|
@@ -532,6 +532,7 @@ class ProcessModule extends Process {
|
|||||||
$f->description = $this->_('Upload a ZIP file containing module file(s). If you upload a module that is already installed, it will be overwritten with the one you upload.');
|
$f->description = $this->_('Upload a ZIP file containing module file(s). If you upload a module that is already installed, it will be overwritten with the one you upload.');
|
||||||
$f->notes = $trustNote;
|
$f->notes = $trustNote;
|
||||||
$f->required = false;
|
$f->required = false;
|
||||||
|
$f->noCustomButton = true;
|
||||||
$fieldset->add($f);
|
$fieldset->add($f);
|
||||||
$f = $this->modules->get('InputfieldSubmit');
|
$f = $this->modules->get('InputfieldSubmit');
|
||||||
$f->attr('id+name', 'upload');
|
$f->attr('id+name', 'upload');
|
||||||
|
Reference in New Issue
Block a user