add advanced_mode flag to various settings; exclude from output and global-search when settings-mode is 'basic'

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-04-08 18:41:28 +02:00
parent 578b2811a5
commit 9272c15706
18 changed files with 175 additions and 82 deletions

View File

@@ -4,6 +4,7 @@ namespace Froxlor\Ajax;
use Froxlor\Froxlor;
use Froxlor\PhpHelper;
use Froxlor\Settings;
use Froxlor\UI\Collection;
/**
@@ -50,9 +51,15 @@ class GlobalSearch
$pk = explode(".", $pathkey);
if (count($pk) > 4) {
$settingkey = $pk[0] . '.' . $pk[1] . '.' . $pk[2] . '.' . $pk[3];
if (isset($settings_data[$pk[0]][$pk[1]]['advanced_mode']) && $settings_data[$pk[0]][$pk[1]]['advanced_mode'] && (int) Settings::Get('panel.settings_mode') == 0) {
continue;
}
if (is_array($processed['settings']) && !array_key_exists($settingkey, $processed['settings'])) {
$processed['settings'][$settingkey] = true;
$sresult = $settings_data[$pk[0]][$pk[1]][$pk[2]][$pk[3]];
if (isset($sresult['advanced_mode']) && $sresult['advanced_mode'] && (int) Settings::Get('panel.settings_mode') == 0) {
continue;
}
if ($sresult['type'] != 'hidden') {
if (!isset($result['settings'])) {
$result['settings'] = [];