Commit 466b1c8f authored by Georg Ringer's avatar Georg Ringer Committed by Wouter Wolters
Browse files

[TASK] Hide msg "Show hidden content elements" if none are hidden

To improve the usability the message and checkbox should only be
shown if there are elements actually hidden.

Change-Id: I0bb652ce915d1e8896b38bf3f94ae2a276cc3881
Resolves: #68037
Releases: master
Reviewed-on: http://review.typo3.org/41081


Reviewed-by: default avatarDavid Greiner <hallo@davidgreiner.de>
Tested-by: default avatarDavid Greiner <hallo@davidgreiner.de>
Reviewed-by: default avatarFrederic Gaus <frederic.gaus@flagbit.de>
Tested-by: default avatarFrederic Gaus <frederic.gaus@flagbit.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
parent 626f925f
......@@ -909,17 +909,18 @@ class PageLayoutController {
}
// Bottom controls (function menus):
$q_count = $this->getNumberOfHiddenElements();
if ($q_count) {
$h_func_b = '<div class="checkbox">' .
'<label for="checkTt_content_showHidden">' .
BackendUtility::getFuncCheck($this->id, 'SET[tt_content_showHidden]', $this->MOD_SETTINGS['tt_content_showHidden'], '', '', 'id="checkTt_content_showHidden"') .
(!$q_count ? ('<span class="text-muted">' . $lang->getLL('hiddenCE', TRUE) . '</span>') : $lang->getLL('hiddenCE', TRUE) . ' (' . $q_count . ')') .
'</label>' .
'</div>';
$content .= $this->doc->section('', $h_func_b, 0, 0);
$content .= $this->doc->spacer(10);
}
$h_func_b = '<div class="checkbox">' .
'<label for="checkTt_content_showHidden">' .
BackendUtility::getFuncCheck($this->id, 'SET[tt_content_showHidden]', $this->MOD_SETTINGS['tt_content_showHidden'], '', '', 'id="checkTt_content_showHidden"') .
(!$q_count ? ('<span class="text-muted">' . $lang->getLL('hiddenCE', TRUE) . '</span>') : $lang->getLL('hiddenCE', TRUE) . ' (' . $q_count . ')') .
'</label>' .
'</div>';
// Add the function menus to bottom:
$content .= $this->doc->section('', $h_func_b, 0, 0);
$content .= $this->doc->spacer(10);
// Select element matrix:
if ($this->eRParts[0] == 'tt_content' && MathUtility::canBeInterpretedAsInteger($this->eRParts[1])) {
$posMap = GeneralUtility::makeInstance(ContentLayoutPagePositionMap::class);
......@@ -978,14 +979,15 @@ class PageLayoutController {
if (!isset($dbList->externalTables[$table])) {
$q_count = $this->getNumberOfHiddenElements();
$h_func_b =
'<div class="checkbox">'
if ($q_count > 0) {
$h_func_b =
'<div class="checkbox">'
. '<label for="checkTt_content_showHidden">'
. '<input type="checkbox" id="checkTt_content_showHidden" class="checkbox" name="SET[tt_content_showHidden]" value="1" ' . ($this->MOD_SETTINGS['tt_content_showHidden'] ? 'checked="checked"' : '') . ' />'
. $this->getLanguageService()->getLL('hiddenCE', TRUE) . ' (<span class="t3js-hidden-counter">' . $q_count . '</span>)'
. '<input type="checkbox" id="checkTt_content_showHidden" class="checkbox" name="SET[tt_content_showHidden]" value="1" ' . ($this->MOD_SETTINGS['tt_content_showHidden'] ? 'checked="checked"' : '') . ' />'
. $this->getLanguageService()->getLL('hiddenCE', TRUE) . ' (<span class="t3js-hidden-counter">' . $q_count . '</span>)'
. '</label>'
. '</div>';
. '</div>';
}
// Boolean: Display up/down arrows and edit icons for tt_content records
$dbList->tt_contentConfig['showCommands'] = 1;
// Boolean: Display info-marks or not
......
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