hidden tools formatting

This commit is contained in:
Roland Gruber 2017-11-21 20:11:59 +01:00
parent bdcacc1d55
commit 1dea64098d
1 changed files with 12 additions and 18 deletions

View File

@ -377,7 +377,8 @@ if (isLAMProVersion()) {
// tool settings // tool settings
$row->add(new htmlSubTitle(_("Tool settings"), '../../graphics/tools.png'), 12); $row->add(new htmlSubTitle(_("Tool settings"), '../../graphics/tools.png'), 12);
$toolSettings = $conf->getToolSettings(); $toolSettings = $conf->getToolSettings();
$row->addLabel(new htmlOutputText(_('Hidden tools'))); $row->add(new htmlOutputText(_('Hidden tools')), 12);
$row->addVerticalSpacer('0.5rem');
$tools = getTools(); $tools = getTools();
for ($i = 0; $i < sizeof($tools); $i++) { for ($i = 0; $i < sizeof($tools); $i++) {
$tool = new $tools[$i](); $tool = new $tools[$i]();
@ -390,25 +391,18 @@ for ($i = 0; $i < sizeof($tools); $i++) {
$tools = array_values($tools); $tools = array_values($tools);
} }
} }
$toolSettingsContent = new htmlTable(); $toolSettingsContent = new htmlResponsiveRow();
for ($r = 0; $r < (sizeof($tools) / 2); $r++) { for ($r = 0; $r < (sizeof($tools)); $r++) {
for ($c = 0; $c < 2; $c++) { $tool = $tools[$r];
if (!isset($tools[($r * 2) + $c])) { $toolClass = get_class($tool);
break; $toolName = substr($toolClass, strrpos($toolClass, '\\') + 1);
} $selected = false;
$tool = $tools[($r * 2) + $c]; if (isset($toolSettings['tool_hide_' . $toolName]) && ($toolSettings['tool_hide_' . $toolName] === 'true')) {
$toolClass = get_class($tool); $selected = true;
$toolName = substr($toolClass, strrpos($toolClass, '\\') + 1);
$selected = false;
if (isset($toolSettings['tool_hide_' . $toolName]) && ($toolSettings['tool_hide_' . $toolName] === 'true')) {
$selected = true;
}
$toolSettingsContent->addElement(new htmlResponsiveInputCheckbox('tool_hide_' . $toolName, $selected, $tool->getName(), null, false));
$toolSettingsContent->addElement(new htmlSpacer('10px', null));
} }
$toolSettingsContent->addNewLine(); $toolSettingsContent->add(new htmlResponsiveInputCheckbox('tool_hide_' . $toolName, $selected, $tool->getName(), null, false), 12);
} }
$row->addField($toolSettingsContent); $row->add($toolSettingsContent, 12);
$row->addVerticalSpacer('2rem'); $row->addVerticalSpacer('2rem');