From 782d7069b3d6cb1f9a0ea71f67b6d12172afeebb Mon Sep 17 00:00:00 2001 From: IgorA100 Date: Thu, 3 Jul 2025 00:52:42 +0300 Subject: [PATCH 01/16] Store the options menu tabs in a separate file, as this is used in the Left menu and Top menu. (options_menu_tabs.php) --- web/skins/classic/views/options_menu_tabs.php | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 web/skins/classic/views/options_menu_tabs.php diff --git a/web/skins/classic/views/options_menu_tabs.php b/web/skins/classic/views/options_menu_tabs.php new file mode 100644 index 00000000000..673a0caf357 --- /dev/null +++ b/web/skins/classic/views/options_menu_tabs.php @@ -0,0 +1,35 @@ + From ad650e8443732953108d1cfa38856fd64b264df6 Mon Sep 17 00:00:00 2001 From: IgorA100 Date: Sun, 6 Jul 2025 22:14:40 +0300 Subject: [PATCH 02/16] Added a class for assembling menus and submenus (functions.php) --- web/skins/classic/includes/functions.php | 122 +++++++++++++++++------ 1 file changed, 89 insertions(+), 33 deletions(-) diff --git a/web/skins/classic/includes/functions.php b/web/skins/classic/includes/functions.php index 5dc16fe931e..0354ab49a61 100644 --- a/web/skins/classic/includes/functions.php +++ b/web/skins/classic/includes/functions.php @@ -965,44 +965,40 @@ function getConsoleHTML($forLeftBar = false) { // Returns the html representing the Options menu item function getOptionsHTML($forLeftBar = false) { + global $zmMenu; $result = ''; + $zmMenu::buildSubMenuOptions($categoryDisplayOrder = [ + 'skins', + 'system', + 'auth', + 'config', + 'dnsmasq', + 'API', + 'web', + 'storage', + 'images', + 'logging', + 'network', + 'mail', + 'upload', + 'x10', + 'highband', + 'medband', + 'lowband', + 'users', + 'groups', + 'control', + 'privacy', + 'MQTT', + 'telemetry', + 'version' + ]); + if ( canView('System') ) { if ($forLeftBar) { - // Copied from web/skins/classic/views/options.php - // When using the old top menu, the list of options pages is still generated in the views/options.php file. global $view; - $tabs = array(); - if (!defined('ZM_FORCE_CSS_DEFAULT') or !defined('ZM_FORCE_SKIN_DEFAULT')) - $tabs['skins'] = translate('Display'); - $tabs['system'] = translate('System'); - $tabs['auth'] = translate('Authentication'); - $tabs['config'] = translate('Config'); - if (defined('ZM_PATH_DNSMASQ_CONF') and ZM_PATH_DNSMASQ_CONF) { - $tabs['dnsmasq'] = translate('DHCP'); - } - $tabs['API'] = translate('API'); - $tabs['servers'] = translate('Servers'); - $tabs['storage'] = translate('Storage'); - $tabs['web'] = translate('Web'); - $tabs['images'] = translate('Images'); - $tabs['logging'] = translate('Logging'); - $tabs['network'] = translate('Network'); - $tabs['mail'] = translate('Email'); - $tabs['upload'] = translate('Upload'); - $tabs['x10'] = translate('X10'); - $tabs['highband'] = translate('HighBW'); - $tabs['medband'] = translate('MediumBW'); - $tabs['lowband'] = translate('LowBW'); - $tabs['users'] = translate('Users'); - $tabs['groups'] = translate('Groups'); - $tabs['control'] = translate('Control'); - $tabs['privacy'] = translate('Privacy'); - $tabs['MQTT'] = translate('MQTT'); - $tabs['telemetry'] = translate('Telemetry'); - $tabs['version'] = translate('Versions'); - $view_ = 'options'; //$tab = isset($_REQUEST['tab']) ? validHtmlStr($_REQUEST['tab']) : 'system'; $tab = isset($_REQUEST['tab']) ? validHtmlStr($_REQUEST['tab']) : ''; @@ -1011,7 +1007,7 @@ function getOptionsHTML($forLeftBar = false) {