Commit 60b4741c authored by Carsten  Rose's avatar Carsten Rose
Browse files

Feature: Upload Button - wrapped with Bootstrap Button. New option...

Feature: Upload Button - wrapped with Bootstrap Button. New option 'fileButtonText' to specify a button text.
parent fb6f3cab
......@@ -2339,6 +2339,8 @@ See also at specific *FormElement* definitions.
| sqlDelete | string | |
| sqlAfter | string | |
+------------------------+--------+----------------------------------------------------------------------------------------------------------+
| fileButtonText | string | Overwrite default 'Choose File' |
+------------------------+--------+----------------------------------------------------------------------------------------------------------+
Effect matrix
......
......@@ -2825,7 +2825,17 @@ abstract class AbstractBuildForm {
$attribute .= $this->getAttributeFeMode($formElement[FE_MODE]);
$attribute .= Support::doAttribute('class', $uploadClass, true);
$htmlInputFile = '<input ' . $attribute . '>' . $this->getHelpBlock();
// $htmlInputFile = '<input ' . $attribute . '>' . $this->getHelpBlock();
// <input type="file"> with BS3: https://stackoverflow.com/questions/11235206/twitter-bootstrap-form-file-element-upload-button/25053973#25053973
$attribute .= Support::doAttribute('style', "display:none;");
$htmlInputFile = '<input ' . $attribute . '>';
$attributeFileLabel = Support::doAttribute('for', $formElement[FE_HTML_ID]);
$attributeFileLabel .= Support::doAttribute('class', 'btn btn-default');
Support::setIfNotSet($formElement, FE_FILE_BUTTON_TEXT, FE_FILE_BUTTON_TEXT_DEFAULT);
$htmlInputFile = Support::wrapTag("<label $attributeFileLabel>", $htmlInputFile . $formElement[FE_FILE_BUTTON_TEXT]);
$deleteButton = Support::wrapTag("<button type='button' class='delete-file' data-sip='$sipUpload' name='delete-$htmlFormElementName'>", $this->symbol[SYMBOL_DELETE]);
......
......@@ -353,7 +353,7 @@ class BuildFormBootstrap extends AbstractBuildForm {
if ($icon === '') {
$element = $text;
} else {
$element = "<span class='glyphicon $icon'></span> " . $text;
$element = "<span class='glyphicon $icon'></span>" . ' ' . $text;
}
$class = Support::doAttribute('class', $class);
......
......@@ -910,6 +910,8 @@ const FE_EMPTY_MEANS_NULL = 'emptyMeansNull';
const FE_EMPTY_ITEM_AT_START = 'emptyItemAtStart';
const FE_EMPTY_ITEM_AT_END = 'emptyItemAtEnd';
const FE_SUBRECORD_TABLE_CLASS = 'subrecordTableClass';
const FE_FILE_BUTTON_TEXT = 'fileButtonText';
const FE_FILE_BUTTON_TEXT_DEFAULT = 'Choose File';
const FE_FLAG_ROW_OPEN_TAG = '_flagRowOpenTag'; // will be automatically computed during Formload: true | false
const FE_FLAG_ROW_CLOSE_TAG = '_flagRowCloseTag'; // will be automatically computed during Formload: true | false
......
......@@ -285,4 +285,5 @@ i.@{spinner_class} {
a.noclick {
pointer-events: none;
}
\ No newline at end of file
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment