Commit 73181522 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Make the image shown for ExtraButtonInfo configureable.

Manual.rst: added documentation for new config.qfq.ini variables GFX_EXTRA_BUTTON_INFO_INLINE, GFX_EXTRA_BUTTON_INFO_BELOW.
parent 7ff80367
......@@ -297,6 +297,11 @@ 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_BELOW | <img src="info.png"> | Image for `extraButtonInfo`_ (below) |
+-----------------------------+-------------------------------------------------+----------------------------------------------------------------------------+
Example: *typo3conf/config.qfq.ini*
......
......@@ -377,6 +377,8 @@ const SYSTEM_SECURITY_ATTACK_DELAY = 'SECURITY_ATTACK_DELAY'; // Detected attack
const SYSTEM_SECURITY_ATTACK_DELAY_DEFAULT = 5; // Detected attack causes x seconds delay
const SYSTEM_SECURITY_SHOW_MESSAGE = 'SECURITY_SHOW_MESSAGE'; // Detected attack shows an error message
const SYSTEM_SECURITY_GET_MAX_LENGTH = 'SECURITY_GET_MAX_LENGTH'; // Trim every character (before conversion) to SECURITY_GET_MAX_LENGTH chars;
const SYSTEM_GFX_EXTRA_BUTTON_INFO_INLINE = 'GFX_EXTRA_BUTTON_INFO_INLINE';
const SYSTEM_GFX_EXTRA_BUTTON_INFO_BELOW = 'GFX_EXTRA_BUTTON_INFO_BELOW';
const GET_EXTRA_LENGTH_TOKEN = '_';
......@@ -395,7 +397,6 @@ const SYSTEM_REPORT_COLUMN_NAME = 'reportColumnName'; // Keyname of SQL-column p
const SYSTEM_REPORT_COLUMN_VALUE = 'reportColumnValue'; // Keyname of SQL-column processed at the moment.
const SYSTEM_REPORT_FULL_LEVEL = 'reportFullLevel'; // Keyname of SQL-column processed at the moment.
const SYSTEM_DOWNLOAD_POPUP = 'hasDownloadPopup'; // Marker which is set to 'true' if there is at least one Download Link rendered
const DOWNLOAD_POPUP_REQUEST = 'true';
const DOWNLOAD_POPUP_REPLACE_TEXT = '#downloadPopupReplaceText#';
const DOWNLOAD_POPUP_REPLACE_TITLE = '#downloadPopupReplaceTitle#';
......@@ -984,3 +985,4 @@ const TOKEN_CLASS_EXTERNAL = 'e';
const WKHTML_OPTION_VIEWPORT = '--viewport-size';
const WKHTML_OPTION_VIEWPORT_VALUE = '1280x1024';
......@@ -218,6 +218,10 @@ class HelperFormElement {
*/
public static function prepareExtraButton(array $formElement, $showInline) {
$store = Store::getInstance();
$infoSymbolInside = $store->getVar(SYSTEM_GFX_EXTRA_BUTTON_INFO_INLINE, STORE_SYSTEM);
$infoSymbolOutside = $store->getVar(SYSTEM_GFX_EXTRA_BUTTON_INFO_BELOW, STORE_SYSTEM);
$extraButton = '';
$id = $formElement[FE_HTML_ID];
$formElement[FE_TMP_EXTRA_BUTTON_HTML] = '';
......@@ -227,7 +231,7 @@ class HelperFormElement {
$extraButton .= <<<EOF
<div class="input-group-btn">
<button class="btn btn-info" onclick="$('#$id-extra-info').slideToggle('swing')">
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
$infoSymbolInside
</button>
</div>
EOF;
......@@ -240,10 +244,15 @@ EOF;
EOF;
}
// INFO: $showinline == FALSE (z.B. 'textarea' elemente)
// <span class="glyphicon glyphicon-info-sign text-info" aria-hidden="true" onclick="$('#$id-extra-info').slideToggle('swing')"></span>
$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) {
$extraButton .= <<<EOF
<span class="glyphicon glyphicon-info-sign text-info" aria-hidden="true" onclick="$('#$id-extra-info').slideToggle('swing')"></span>
$infoSymbolOutside
EOF;
$value = $formElement[FE_INPUT_EXTRA_BUTTON_INFO];
......
......@@ -89,9 +89,10 @@ class Support {
*
* Based on: http://www.w3schools.com/howto/howto_css_tooltip.asp
*
* @param string $before
* @param string $htmlId
* @param string $tooltipText
* @return string
* @internal param string $before
*/
public static function doTooltip($htmlId, $tooltipText) {
......
......@@ -136,7 +136,8 @@ class Config {
Support::setIfNotSet($config, SYSTEM_SECURITY_SHOW_MESSAGE, 'true');
Support::setIfNotSet($config, SYSTEM_SECURITY_GET_MAX_LENGTH, '50');
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>');
return $config;
}
......
Markdown is supported
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