From 144872bedbb556c659fe99e47ff836228b1e4b75 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Tue, 11 Oct 2016 12:04:03 -0400 Subject: [PATCH] Fix issue processwire/processwire-issues#38 --- .../InputfieldFile/InputfieldFile.module | 27 +++++++++++++------ .../ProcessModule/ProcessModule.module | 1 + 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/wire/modules/Inputfield/InputfieldFile/InputfieldFile.module b/wire/modules/Inputfield/InputfieldFile/InputfieldFile.module index cce14a75..2d51b3a7 100644 --- a/wire/modules/Inputfield/InputfieldFile/InputfieldFile.module +++ b/wire/modules/Inputfield/InputfieldFile/InputfieldFile.module @@ -18,6 +18,7 @@ * @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 $noShortName Set to true to disable shortened filenames in output + * @property bool|int $noCustomButton Set to true to disable use of the styled * */ 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('noCollapseItem', 0); $this->set('noShortName', 0); + $this->set('noCustomButton', false); $this->attr('type', 'file'); $this->labels = array( @@ -406,14 +408,23 @@ class InputfieldFile extends Inputfield implements InputfieldItemList { "data-extensions='$extensions' " . "data-fieldname='$attrs[name]' " . "class='InputfieldFileUpload'> - -
- - $chooseLabel - - -
- + "; + + if($this->getSetting('noCustomButton')) { + $out .= ""; + + } else { + $out .= " +
+ + $chooseLabel + + +
+ "; + } + + $out .= " $formatExtensions "; diff --git a/wire/modules/Process/ProcessModule/ProcessModule.module b/wire/modules/Process/ProcessModule/ProcessModule.module index 1da40e3e..7c4de3d3 100644 --- a/wire/modules/Process/ProcessModule/ProcessModule.module +++ b/wire/modules/Process/ProcessModule/ProcessModule.module @@ -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->notes = $trustNote; $f->required = false; + $f->noCustomButton = true; $fieldset->add($f); $f = $this->modules->get('InputfieldSubmit'); $f->attr('id+name', 'upload');