Skip to content
Snippets Groups Projects
Commit bb73946f authored by Carsten  Rose's avatar Carsten Rose
Browse files

#4386 / extraButtonInfoClass='pull-right' to right align the extraButtonInfo icon.

parent 60dd4d9f
No related branches found
No related tags found
No related merge requests found
......@@ -298,11 +298,13 @@ config.qfq.ini
| SECURITY_GET_MAX_LENGTH | SECURITY_GET_MAX_LENGTH = 50 | GET vars longer than 'x' chars triggers an `attack-recognized`. |
| | | `ExceptionMaxLength`_ |
+-----------------------------+-------------------------------------------------+----------------------------------------------------------------------------+
|GFX_EXTRA_BUTTON_INFO_INLINE | <img src="info.png"> | Image for `extraButtonInfo`_ (inline) |
| GFX_EXTRA_BUTTON_INFO_INLINE| <img src="info.png"> | Image for `extraButtonInfo`_ (inline) |
+-----------------------------+-------------------------------------------------+----------------------------------------------------------------------------+
|GFX_EXTRA_BUTTON_INFO_BELOW | <img src="info.png"> | Image for `extraButtonInfo`_ (below) |
| GFX_EXTRA_BUTTON_INFO_BELOW | <img src="info.png"> | Image for `extraButtonInfo`_ (below) |
+-----------------------------+-------------------------------------------------+----------------------------------------------------------------------------+
|EXTRA_BUTTON_INFO_POSITION | SYSTEM_EXTRA_BUTTON_INFO_POSITION=below | 'auto' (default) or 'below'. See `extraButtonInfo`_ |
| EXTRA_BUTTON_INFO_POSITION | SYSTEM_EXTRA_BUTTON_INFO_POSITION=below | 'auto' (default) or 'below'. See `extraButtonInfo`_ |
+-----------------------------+-------------------------------------------------+----------------------------------------------------------------------------+
| EXTRA_BUTTON_INFO_CLASS | SYSTEM_EXTRA_BUTTON_INFO_CLASS=pull-right | '' (default) or 'pull-right'. See `extraButtonInfo`_ |
+-----------------------------+-------------------------------------------------+----------------------------------------------------------------------------+
| SAVE_BUTTON_TEXT | SAVE_BUTTON_TEXT = | Default text on the form save button. Typically none. |
+-----------------------------+-------------------------------------------------+----------------------------------------------------------------------------+
......@@ -444,6 +446,7 @@ Example: *typo3conf/config.qfq.ini*
;GFX_EXTRA_BUTTON_INFO_INLINE = <img src='info.png'>
;GFX_EXTRA_BUTTON_INFO_BELOW = <img src='info.png'>
;EXTRA_BUTTON_INFO_POSITION = auto | below
;EXTRA_BUTTON_INFO_CLASS = pull-right
.. _`CustomVariables`:
......@@ -1872,6 +1875,8 @@ parameter
+-----------------------------+--------+----------------------------------------------------------------------------------------------------------+
| newButtonGlyphIcon | string | Overwrite default from config.qfq.ini: NEW_BUTTON_GLYPH_ICON |
+-----------------------------+--------+----------------------------------------------------------------------------------------------------------+
| extraButtonInfoClass | string | Overwrite default from config.qfq.ini: EXTRA_BUTTON_INFO_CLASS |
+-----------------------------+--------+----------------------------------------------------------------------------------------------------------+
* Example:
......@@ -2237,6 +2242,8 @@ See also at specific *FormElement* definitions.
+------------------------+--------+----------------------------------------------------------------------------------------------------------+
| extraButtonInfo | string | Text. Show an 'i' on the right side of the input element. See `extraButtonInfo`_ |
+------------------------+--------+----------------------------------------------------------------------------------------------------------+
| extraButtonInfoClass | string | By default empty. Specify any class to be assigned to wrap extraButtonInfo |
+------------------------+--------+----------------------------------------------------------------------------------------------------------+
| autofocus | string | See `input-option-autofocus`_ |
+------------------------+--------+----------------------------------------------------------------------------------------------------------+
| checkBoxMode | string | See `input-checkbox`_, `input-radio`_, `input-select`_ |
......@@ -2441,11 +2448,17 @@ extraButtonInfo
* The user has to click on the `info` button/icon to see an additional message.
* After Form load, the information message is hidden.
* The value of this parameter is the text shown.
* Shows an `info` button/icon, depending of EXTRA_BUTTON_INFO_POSITION in `config.qfq.ini`_ or `FormElement` type:
* Shows an `info` button/icon, depending of EXTRA_BUTTON_INFO_POSITION in `config.qfq.ini`_
* `auto`, depending on `FormElement` type:
* on the right side of an input element for type `text`, `date`, `time` or `datetime`,
* below the FormElement for all other types.
* on the right side of an input element for type `text`, `date`, `time` or `datetime`,
* below the FormElement for all other types.
* `below`: below the FormElement for all types.
* With display `below`, a defined class in `extraButtonInfoClass` (FE, F, config.qfq.ini) will be applied. E.g. this
might be `pull-right` to align the grafic on the right side of the input element.
.. _`input-checkbox`:
......
......@@ -67,6 +67,11 @@ WKHTMLTOPDF = /opt/wkhtmltox/bin/wkhtmltopdf
;SECURITY_SHOW_MESSAGE=true
;SECURITY_GET_MAX_LENGTH=50
;GFX_EXTRA_BUTTON_INFO_INLINE = <img src="file.png">
;GFX_EXTRA_BUTTON_INFO_BELOW = <img src="file.png">
;EXTRA_BUTTON_INFO_POSITION = auto | below
;EXTRA_BUTTON_INFO_POSITION_CLASS = pull-right
;SAVE_BUTTON_TEXT =
;SAVE_BUTTON_TOOLTIP = save
;SAVE_BUTTON_CLASS = btn btn-default navbar-btn
......
......@@ -413,6 +413,7 @@ const SYSTEM_GFX_EXTRA_BUTTON_INFO_BELOW = 'GFX_EXTRA_BUTTON_INFO_BELOW';
const SYSTEM_EXTRA_BUTTON_INFO_POSITION = 'EXTRA_BUTTON_INFO_POSITION';
const SYSTEM_EXTRA_BUTTON_INFO_POSITION_AUTO = 'auto';
const SYSTEM_EXTRA_BUTTON_INFO_POSITION_BELOW = 'below';
const SYSTEM_EXTRA_BUTTON_INFO_CLASS = 'EXTRA_BUTTON_INFO_CLASS';
const SYSTEM_SAVE_BUTTON_TEXT = 'SAVE_BUTTON_TEXT';
const SYSTEM_SAVE_BUTTON_TOOLTIP = 'SAVE_BUTTON_TOOLTIP';
......@@ -898,6 +899,7 @@ const FE_CHARACTER_COUNT_WRAP = 'characterCountWrap';
const FE_INPUT_EXTRA_BUTTON_LOCK = 'extraButtonLock';
const FE_INPUT_EXTRA_BUTTON_PASSWORD = 'extraButtonPassword';
const FE_INPUT_EXTRA_BUTTON_INFO = 'extraButtonInfo';
const FE_INPUT_EXTRA_BUTTON_INFO_CLASS = 'extraButtonInfoClass';
const FE_TMP_EXTRA_BUTTON_HTML = '_extraButtonHtml'; // will be filled on the fly during building extrabutton
const FE_CHECKBOX_CHECKED = 'checked';
const FE_CHECKBOX_UNCHECKED = 'unchecked';
......
......@@ -775,7 +775,7 @@ class QuickFormQuery {
* STORE_SYSTEM if filled with the default values (config.qfq.ini or if note exist than QFQ hardcoded)
* Copying the 'Form' definition back to the system store helps to access the values
* by '{{ ...:Y}}' (system store). E.g. the value of bs-*-columns might be displayed as placeholder in the
* corresponding inputfield.
* corresponding input field.
*
* @param array $formSpec
*
......@@ -818,6 +818,7 @@ class QuickFormQuery {
F_RECORD_LOCK_TIMEOUT_SECONDS,
FE_INPUT_EXTRA_BUTTON_INFO_CLASS,
];
// By definition: existing vars which are empty, means: EMPTY - do not use any default!
......
......@@ -303,10 +303,12 @@ EOF;
$js = " onclick=\"$('#$id-extra-info').slideToggle('swing')\" ";
$arr = explode(' ', $infoSymbolOutside, 2);
$infoSymbolOutside = $arr[0] . $js . $arr[1];
// INFO: $showinline == FALSE (e.g. 'textarea' elemente)
if (isset($formElement[FE_INPUT_EXTRA_BUTTON_INFO]) && !$showInline) {
$class = $formElement[FE_INPUT_EXTRA_BUTTON_INFO_CLASS];
$extraButton .= <<<EOF
$infoSymbolOutside
<span class="$class">$infoSymbolOutside</span>
EOF;
$value = $formElement[FE_INPUT_EXTRA_BUTTON_INFO];
......
......@@ -753,6 +753,8 @@ class Support {
$formElement[FE_FLAG_ROW_CLOSE_TAG] = false;
}
self::setIfNotSet($formElement, FE_INPUT_EXTRA_BUTTON_INFO_CLASS, $store->getVar(FE_INPUT_EXTRA_BUTTON_INFO_CLASS, STORE_SYSTEM));
return $formElement;
}
......
......@@ -180,6 +180,8 @@ class Config {
Support::setIfNotSet($config, SYSTEM_ESCAPE_TYPE_DEFAULT, TOKEN_ESCAPE_SINGLE_TICK);
Support::setIfNotSet($config, SYSTEM_GFX_EXTRA_BUTTON_INFO_INLINE, '<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>');
Support::setIfNotSet($config, SYSTEM_GFX_EXTRA_BUTTON_INFO_BELOW, '<span class="glyphicon glyphicon-info-sign text-info" aria-hidden="true"></span>');
Support::setIfNotSet($config, SYSTEM_EXTRA_BUTTON_INFO_CLASS, '');
Support::setIfNotSet($config, SYSTEM_DB_UPDATE, SYSTEM_DB_UPDATE_AUTO);
Support::setIfNotSet($config, SYSTEM_RECORD_LOCK_TIMEOUT_SECONDS, SYSTEM_RECORD_LOCK_TIMEOUT_SECONDS_DEFAULT);
......@@ -238,6 +240,8 @@ class Config {
[SYSTEM_NEW_BUTTON_CLASS, F_NEW_BUTTON_CLASS],
[SYSTEM_NEW_BUTTON_GLYPH_ICON, F_NEW_BUTTON_GLYPH_ICON],
[SYSTEM_EXTRA_BUTTON_INFO_CLASS, FE_INPUT_EXTRA_BUTTON_INFO_CLASS],
];
foreach ($setting as $row) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment