From 5956a3a17f317a1d98df4f2be6270e98a151cd62 Mon Sep 17 00:00:00 2001 From: reliberate Date: Mon, 2 May 2016 14:42:06 -0600 Subject: [PATCH] Menu Manager: Add ability to customize main and sub menu icons. --- app/adminer/app_menu.php | 1 + app/dialplan/app_menu.php | 3 +- app/edit/app_menu.php | 5 + core/apps/app_menu.php | 1 + core/menu/app_config.php | 5 +- core/menu/app_languages.php | 10 + core/menu/app_menu.php | 129 ++-- core/menu/menu_item_edit.php | 50 ++ resources/bootstrap/glyphicons.json | 1040 +++++++++++++++++++++++++++ resources/classes/menu.php | 8 +- themes/default/template.php | 29 +- 11 files changed, 1193 insertions(+), 88 deletions(-) create mode 100644 resources/bootstrap/glyphicons.json diff --git a/app/adminer/app_menu.php b/app/adminer/app_menu.php index 38d96bab49..8758f7ecbf 100644 --- a/app/adminer/app_menu.php +++ b/app/adminer/app_menu.php @@ -13,6 +13,7 @@ $apps[$x]['menu'][0]['uuid'] = "1f59d07b-b4f7-4f9e-bde9-312cf491d66e"; $apps[$x]['menu'][0]['parent_uuid'] = "594d99c5-6128-9c88-ca35-4b33392cec0f"; $apps[$x]['menu'][0]['category'] = "external"; + $apps[$x]['menu'][0]['icon'] = "glyphicon-new-window"; $apps[$x]['menu'][0]['path'] = "/app/adminer/index.php"; $apps[$x]['menu'][0]['groups'][] = "superadmin"; diff --git a/app/dialplan/app_menu.php b/app/dialplan/app_menu.php index 07861704be..05bcd0ad07 100644 --- a/app/dialplan/app_menu.php +++ b/app/dialplan/app_menu.php @@ -6,13 +6,14 @@ $apps[$x]['menu'][0]['title']['es-mx'] = "Plan de Marcado"; $apps[$x]['menu'][0]['title']['fr-fr'] = "Dialplan"; $apps[$x]['menu'][0]['title']['pt-pt'] = "Dialplan"; $apps[$x]['menu'][0]['title']['pt-br'] = "Dialplan"; -$apps[$x]['menu'][0]['title']['pl'] = "Dialplan "; +$apps[$x]['menu'][0]['title']['pl'] = "Dialplan"; $apps[$x]['menu'][0]['title']['uk'] = "Маршрутизація"; $apps[$x]['menu'][0]['title']['sv-se'] = "Nummerplan"; $apps[$x]['menu'][0]['title']['de-at'] = "Wählplan"; $apps[$x]['menu'][0]['uuid'] = "b94e8bd9-9eb5-e427-9c26-ff7a6c21552a"; $apps[$x]['menu'][0]['parent_uuid'] = ""; $apps[$x]['menu'][0]['category'] = "internal"; +$apps[$x]['menu'][0]['icon'] = "glyphicon-transfer"; $apps[$x]['menu'][0]['path'] = ""; $apps[$x]['menu'][0]['order'] = "15"; $apps[$x]['menu'][0]['groups'][] = "admin"; diff --git a/app/edit/app_menu.php b/app/edit/app_menu.php index 5b5866f5c9..19b9cb616f 100644 --- a/app/edit/app_menu.php +++ b/app/edit/app_menu.php @@ -15,6 +15,7 @@ $apps[$x]['menu'][$y]['uuid'] = "f1905fec-0577-daef-6045-59d09b7d3f94"; $apps[$x]['menu'][$y]['parent_uuid'] = "594d99c5-6128-9c88-ca35-4b33392cec0f"; $apps[$x]['menu'][$y]['category'] = "external"; + $apps[$x]['menu'][$y]['icon'] = "glyphicon-new-window"; $apps[$x]['menu'][$y]['path'] = "/app/edit/index.php?dir=scripts"; $apps[$x]['menu'][$y]['groups'][] = "superadmin"; $y++; @@ -32,6 +33,7 @@ $apps[$x]['menu'][$y]['uuid'] = "16013877-606a-2a05-7d6a-c1b215839131"; $apps[$x]['menu'][$y]['parent_uuid'] = "594d99c5-6128-9c88-ca35-4b33392cec0f"; $apps[$x]['menu'][$y]['category'] = "external"; + $apps[$x]['menu'][$y]['icon'] = "glyphicon-new-window"; $apps[$x]['menu'][$y]['path'] = "/app/edit/index.php?dir=xml"; $apps[$x]['menu'][$y]['groups'][] = "superadmin"; $y++; @@ -49,6 +51,7 @@ $apps[$x]['menu'][$y]['uuid'] = "57773542-a565-1a29-605d-6535da1a0870"; $apps[$x]['menu'][$y]['parent_uuid'] = "594d99c5-6128-9c88-ca35-4b33392cec0f"; $apps[$x]['menu'][$y]['category'] = "external"; + $apps[$x]['menu'][$y]['icon'] = "glyphicon-new-window"; $apps[$x]['menu'][$y]['path'] = "/app/edit/index.php?dir=provision"; $apps[$x]['menu'][$y]['groups'][] = "superadmin"; $y++; @@ -66,6 +69,7 @@ $apps[$x]['menu'][$y]['uuid'] = "eae1f2d6-789b-807c-cc26-44501e848693"; $apps[$x]['menu'][$y]['parent_uuid'] = "594d99c5-6128-9c88-ca35-4b33392cec0f"; $apps[$x]['menu'][$y]['category'] = "external"; + $apps[$x]['menu'][$y]['icon'] = "glyphicon-new-window"; $apps[$x]['menu'][$y]['path'] = "/app/edit/index.php?dir=php"; $apps[$x]['menu'][$y]['groups'][] = "superadmin"; $y++; @@ -83,6 +87,7 @@ $apps[$x]['menu'][$y]['uuid'] = "c3db739e-89f9-0fa2-44ce-0f4c2ff43b1a"; $apps[$x]['menu'][$y]['parent_uuid'] = "594d99c5-6128-9c88-ca35-4b33392cec0f"; $apps[$x]['menu'][$y]['category'] = "external"; + $apps[$x]['menu'][$y]['icon'] = "glyphicon-new-window"; $apps[$x]['menu'][$y]['path'] = "/app/edit/index.php?dir=grammar"; $apps[$x]['menu'][$y]['groups'][] = "superadmin"; diff --git a/core/apps/app_menu.php b/core/apps/app_menu.php index 81e1d30c19..0e07d4366c 100644 --- a/core/apps/app_menu.php +++ b/core/apps/app_menu.php @@ -12,6 +12,7 @@ $apps[$x]['menu'][0]['title']['de-at'] = "Applikationen"; $apps[$x]['menu'][0]['uuid'] = "fd29e39c-c936-f5fc-8e2b-611681b266b5"; $apps[$x]['menu'][0]['parent_uuid'] = ""; $apps[$x]['menu'][0]['category'] = "internal"; +$apps[$x]['menu'][0]['icon'] = "glyphicon-send"; $apps[$x]['menu'][0]['path'] = ""; $apps[$x]['menu'][0]['order'] = "20"; $apps[$x]['menu'][0]['groups'][] = "user"; diff --git a/core/menu/app_config.php b/core/menu/app_config.php index e97287aab1..31e123e912 100644 --- a/core/menu/app_config.php +++ b/core/menu/app_config.php @@ -149,6 +149,10 @@ $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "menu_item_icon"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = "menu_item_category"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; @@ -163,7 +167,6 @@ $z++; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "menu_item_description"; $apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "menu_item_desc"; - $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $z++; diff --git a/core/menu/app_languages.php b/core/menu/app_languages.php index 0d534af849..5699d51eb5 100644 --- a/core/menu/app_languages.php +++ b/core/menu/app_languages.php @@ -180,6 +180,16 @@ $text['label-language']['uk'] = "Мова"; $text['label-language']['sv-se'] = "Språk"; $text['label-language']['de-at'] = "Sprache"; +$text['label-icon']['en-us'] = "Icon"; +$text['label-icon']['es-cl'] = "Icono"; +$text['label-icon']['pt-pt'] = "Ícone"; +$text['label-icon']['fr-fr'] = "Icône"; +$text['label-icon']['pt-br'] = "Ícone"; +$text['label-icon']['pl'] = "Ikona"; +$text['label-icon']['uk'] = "іконка"; +$text['label-icon']['sv-se'] = "Ikon"; +$text['label-icon']['de-at'] = "Symbol"; + $text['label-groups']['en-us'] = "Groups"; $text['label-groups']['es-cl'] = "Grupos"; $text['label-groups']['pt-pt'] = "Grupos"; diff --git a/core/menu/app_menu.php b/core/menu/app_menu.php index 967063a7cd..6361fab10e 100644 --- a/core/menu/app_menu.php +++ b/core/menu/app_menu.php @@ -27,6 +27,7 @@ $apps[$x]['menu'][1]['title']['de-at'] = "Home"; $apps[$x]['menu'][1]['uuid'] = "02194288-6d56-6d3e-0b1a-d53a2bc10788"; $apps[$x]['menu'][1]['parent_uuid'] = ""; $apps[$x]['menu'][1]['category'] = "internal"; +$apps[$x]['menu'][1]['icon'] = "glyphicon-home"; $apps[$x]['menu'][1]['path'] = ""; $apps[$x]['menu'][1]['order'] = "5"; $apps[$x]['menu'][1]['groups'][] = "user"; @@ -45,92 +46,84 @@ $apps[$x]['menu'][2]['title']['de-at'] = "Konten"; $apps[$x]['menu'][2]['uuid'] = "bc96d773-ee57-0cdd-c3ac-2d91aba61b55"; $apps[$x]['menu'][2]['parent_uuid'] = ""; $apps[$x]['menu'][2]['category'] = "internal"; +$apps[$x]['menu'][2]['icon'] = "glyphicon-user"; $apps[$x]['menu'][2]['path'] = ""; $apps[$x]['menu'][2]['order'] = "10"; $apps[$x]['menu'][2]['groups'][] = "admin"; $apps[$x]['menu'][2]['groups'][] = "superadmin"; -$apps[$x]['menu'][3]['title']['en-us'] = "Dialplan"; -$apps[$x]['menu'][3]['title']['pl'] = "Dialplan "; -$apps[$x]['menu'][3]['title']['uk'] = "Маршрутизація (Dialplan)"; -$apps[$x]['menu'][3]['title']['sv-se'] = "Nummerplan"; -$apps[$x]['menu'][3]['title']['de-at'] = "Wählplan"; -$apps[$x]['menu'][3]['uuid'] = "b94e8bd9-9eb5-e427-9c26-ff7a6c21552a"; +$apps[$x]['menu'][3]['title']['en-us'] = "Status"; +$apps[$x]['menu'][3]['title']['es-cl'] = "Estado"; +$apps[$x]['menu'][3]['title']['fr-fr'] = "Etat"; +$apps[$x]['menu'][3]['title']['pt-pt'] = "Estado"; +$apps[$x]['menu'][3]['title']['pt-br'] = "Estados"; +$apps[$x]['menu'][3]['title']['pl'] = "Status "; +$apps[$x]['menu'][3]['title']['uk'] = "Статус"; +$apps[$x]['menu'][3]['title']['sv-se'] = "Status"; +$apps[$x]['menu'][3]['title']['de-at'] = "Status"; +$apps[$x]['menu'][3]['uuid'] = "0438b504-8613-7887-c420-c837ffb20cb1"; $apps[$x]['menu'][3]['parent_uuid'] = ""; $apps[$x]['menu'][3]['category'] = "internal"; +$apps[$x]['menu'][3]['icon'] = "glyphicon-equalizer"; $apps[$x]['menu'][3]['path'] = ""; -$apps[$x]['menu'][3]['order'] = "15"; +$apps[$x]['menu'][3]['order'] = "25"; +$apps[$x]['menu'][3]['groups'][] = "user"; $apps[$x]['menu'][3]['groups'][] = "admin"; $apps[$x]['menu'][3]['groups'][] = "superadmin"; -$apps[$x]['menu'][4]['title']['en-us'] = "Status"; -$apps[$x]['menu'][4]['title']['es-cl'] = "Estado"; -$apps[$x]['menu'][4]['title']['fr-fr'] = "Etat"; -$apps[$x]['menu'][4]['title']['pt-pt'] = "Estado"; -$apps[$x]['menu'][4]['title']['pt-br'] = "Estados"; -$apps[$x]['menu'][4]['title']['pl'] = "Status "; -$apps[$x]['menu'][4]['title']['uk'] = "Статус"; -$apps[$x]['menu'][4]['title']['sv-se'] = "Status"; -$apps[$x]['menu'][4]['title']['de-at'] = "Status"; -$apps[$x]['menu'][4]['uuid'] = "0438b504-8613-7887-c420-c837ffb20cb1"; +$apps[$x]['menu'][4]['title']['en-us'] = "Advanced"; +$apps[$x]['menu'][4]['title']['es-cl'] = "Avanzado"; +$apps[$x]['menu'][4]['title']['fr-fr'] = "Avancé"; +$apps[$x]['menu'][4]['title']['pt-pt'] = "Avançado"; +$apps[$x]['menu'][4]['title']['pt-br'] = "Avançado"; +$apps[$x]['menu'][4]['title']['pl'] = "Zaawansowany"; +$apps[$x]['menu'][4]['title']['uk'] = "Розширені"; +$apps[$x]['menu'][4]['title']['sv-se'] = "Avancerad"; +$apps[$x]['menu'][4]['title']['de-at'] = "Erweitert"; +$apps[$x]['menu'][4]['uuid'] = "594d99c5-6128-9c88-ca35-4b33392cec0f"; $apps[$x]['menu'][4]['parent_uuid'] = ""; $apps[$x]['menu'][4]['category'] = "internal"; +$apps[$x]['menu'][4]['icon'] = "glyphicon-cog"; $apps[$x]['menu'][4]['path'] = ""; -$apps[$x]['menu'][4]['order'] = "25"; -$apps[$x]['menu'][4]['groups'][] = "user"; -$apps[$x]['menu'][4]['groups'][] = "admin"; +$apps[$x]['menu'][4]['order'] = "30"; $apps[$x]['menu'][4]['groups'][] = "superadmin"; +$apps[$x]['menu'][4]['groups'][] = "admin"; -$apps[$x]['menu'][5]['title']['en-us'] = "Advanced"; -$apps[$x]['menu'][5]['title']['es-cl'] = "Avanzado"; -$apps[$x]['menu'][5]['title']['fr-fr'] = "Avancé"; -$apps[$x]['menu'][5]['title']['pt-pt'] = "Avançado"; -$apps[$x]['menu'][5]['title']['pt-br'] = "Avançado"; -$apps[$x]['menu'][5]['title']['pl'] = "Zaawansowany"; -$apps[$x]['menu'][5]['title']['uk'] = "Розширені"; -$apps[$x]['menu'][5]['title']['sv-se'] = "Avancerad"; -$apps[$x]['menu'][5]['title']['de-at'] = "Erweitert"; -$apps[$x]['menu'][5]['uuid'] = "594d99c5-6128-9c88-ca35-4b33392cec0f"; +$apps[$x]['menu'][5]['title']['en-us'] = "Login"; +$apps[$x]['menu'][5]['title']['es-cl'] = "Ingresar"; +$apps[$x]['menu'][5]['title']['es-mx'] = ""; +$apps[$x]['menu'][5]['title']['de-de'] = ""; +$apps[$x]['menu'][5]['title']['de-ch'] = ""; +$apps[$x]['menu'][5]['title']['de-at'] = ""; +$apps[$x]['menu'][5]['title']['fr-fr'] = "Connexion"; +$apps[$x]['menu'][5]['title']['fr-ca'] = ""; +$apps[$x]['menu'][5]['title']['fr-ch'] = ""; +$apps[$x]['menu'][5]['title']['pt-pt'] = "Entrar"; +$apps[$x]['menu'][5]['title']['pt-br'] = ""; +$apps[$x]['menu'][5]['uuid'] = "c85bf816-b88d-40fa-8634-11b456928afa"; $apps[$x]['menu'][5]['parent_uuid'] = ""; $apps[$x]['menu'][5]['category'] = "internal"; -$apps[$x]['menu'][5]['path'] = ""; -$apps[$x]['menu'][5]['order'] = "30"; -$apps[$x]['menu'][5]['groups'][] = "superadmin"; -$apps[$x]['menu'][5]['groups'][] = "admin"; +$apps[$x]['menu'][5]['icon'] = "glyphicon-log-in"; +$apps[$x]['menu'][5]['path'] = "/login.php"; +$apps[$x]['menu'][5]['groups'][] = "public"; +$apps[$x]['menu'][5]['order'] = "99"; -$apps[$x]['menu'][6]['title']['en-us'] = "Login"; -$apps[$x]['menu'][6]['title']['es-cl'] = "Ingresar"; -$apps[$x]['menu'][6]['title']['es-mx'] = ""; -$apps[$x]['menu'][6]['title']['de-de'] = ""; -$apps[$x]['menu'][6]['title']['de-ch'] = ""; -$apps[$x]['menu'][6]['title']['de-at'] = ""; -$apps[$x]['menu'][6]['title']['fr-fr'] = "Connexion"; -$apps[$x]['menu'][6]['title']['fr-ca'] = ""; -$apps[$x]['menu'][6]['title']['fr-ch'] = ""; -$apps[$x]['menu'][6]['title']['pt-pt'] = "Entrar"; -$apps[$x]['menu'][6]['title']['pt-br'] = ""; -$apps[$x]['menu'][6]['uuid'] = "c85bf816-b88d-40fa-8634-11b456928afa"; -$apps[$x]['menu'][6]['parent_uuid'] = ""; -$apps[$x]['menu'][6]['category'] = "internal"; -$apps[$x]['menu'][6]['path'] = "/login.php"; -$apps[$x]['menu'][6]['groups'][] = "public"; -$apps[$x]['menu'][6]['order'] = "99"; - -$apps[$x]['menu'][7]['title']['en-us'] = 'Logout'; -$apps[$x]['menu'][7]['title']['es-mx'] = 'Salir'; -$apps[$x]['menu'][7]['title']['pt-pt'] = 'Sair'; -$apps[$x]['menu'][7]['title']['pt-br'] = ''; -$apps[$x]['menu'][7]['title']['de-at'] = 'Abmelden'; -$apps[$x]['menu'][7]['title']['fr-fr'] = 'Déconnexion'; -$apps[$x]['menu'][7]['title']['pl'] = 'Wyloguj'; -$apps[$x]['menu'][7]['title']['uk'] = 'вийти'; -$apps[$x]['menu'][7]['title']['uk'] = 'Logga Ut'; -$apps[$x]['menu'][7]['uuid'] = '0d29e9f4-0c9b-9d8d-cd2d-454899dc9bc4'; -$apps[$x]['menu'][7]['parent_uuid'] = '02194288-6d56-6d3e-0b1a-d53a2bc10788'; -$apps[$x]['menu'][7]['category'] = 'internal'; -$apps[$x]['menu'][7]['path'] = '/logout.php'; -$apps[$x]['menu'][7]['groups'][] = 'user'; -$apps[$x]['menu'][7]['groups'][] = 'admin'; -$apps[$x]['menu'][7]['groups'][] = 'superadmin'; +$apps[$x]['menu'][6]['title']['en-us'] = 'Logout'; +$apps[$x]['menu'][6]['title']['es-mx'] = 'Salir'; +$apps[$x]['menu'][6]['title']['pt-pt'] = 'Sair'; +$apps[$x]['menu'][6]['title']['pt-br'] = ''; +$apps[$x]['menu'][6]['title']['de-at'] = 'Abmelden'; +$apps[$x]['menu'][6]['title']['fr-fr'] = 'Déconnexion'; +$apps[$x]['menu'][6]['title']['pl'] = 'Wyloguj'; +$apps[$x]['menu'][6]['title']['uk'] = 'вийти'; +$apps[$x]['menu'][6]['title']['uk'] = 'Logga Ut'; +$apps[$x]['menu'][6]['uuid'] = '0d29e9f4-0c9b-9d8d-cd2d-454899dc9bc4'; +$apps[$x]['menu'][6]['parent_uuid'] = '02194288-6d56-6d3e-0b1a-d53a2bc10788'; +$apps[$x]['menu'][6]['category'] = 'internal'; +$apps[$x]['menu'][6]['icon'] = "glyphicon-log-out"; +$apps[$x]['menu'][6]['path'] = '/logout.php'; +$apps[$x]['menu'][6]['groups'][] = 'user'; +$apps[$x]['menu'][6]['groups'][] = 'admin'; +$apps[$x]['menu'][6]['groups'][] = 'superadmin'; ?> diff --git a/core/menu/menu_item_edit.php b/core/menu/menu_item_edit.php index 9fe661f911..62df9c71ff 100644 --- a/core/menu/menu_item_edit.php +++ b/core/menu/menu_item_edit.php @@ -80,6 +80,7 @@ else { $menu_item_title = check_str($_POST["menu_item_title"]); $menu_item_link = check_str($_POST["menu_item_link"]); $menu_item_category = check_str($_POST["menu_item_category"]); + $menu_item_icon = check_str($_POST["menu_item_icon"]); $menu_item_description = check_str($_POST["menu_item_description"]); $menu_item_protected = check_str($_POST["menu_item_protected"]); //$menu_item_uuid = check_str($_POST["menu_item_uuid"]); @@ -149,6 +150,7 @@ else { $sql .= "menu_item_title, "; $sql .= "menu_item_link, "; $sql .= "menu_item_category, "; + $sql .= "menu_item_icon, "; $sql .= "menu_item_description, "; $sql .= "menu_item_protected, "; $sql .= "menu_item_uuid, "; @@ -165,6 +167,7 @@ else { $sql .= "'$menu_item_title', "; $sql .= "'$menu_item_link', "; $sql .= "'$menu_item_category', "; + $sql .= "'$menu_item_icon', "; $sql .= "'$menu_item_description', "; $sql .= "'$menu_item_protected', "; $sql .= "'".$menu_item_uuid."', "; @@ -188,6 +191,7 @@ else { $sql .= "menu_item_title = '$menu_item_title', "; $sql .= "menu_item_link = '$menu_item_link', "; $sql .= "menu_item_category = '$menu_item_category', "; + $sql .= "menu_item_icon = '$menu_item_icon', "; $sql .= "menu_item_description = '$menu_item_description', "; $sql .= "menu_item_protected = '$menu_item_protected', "; if (strlen($menu_item_parent_uuid) == 0) { @@ -307,6 +311,7 @@ else { $menu_item_title = $row["menu_item_title"]; $menu_item_link = $row["menu_item_link"]; $menu_item_category = $row["menu_item_category"]; + $menu_item_icon = $row["menu_item_icon"]; $menu_item_description = $row["menu_item_description"]; $menu_item_protected = $row["menu_item_protected"]; $menu_item_parent_uuid = $row["menu_item_parent_uuid"]; @@ -351,10 +356,12 @@ else { echo " ".$text['label-title'].""; echo " "; echo " "; + echo " "; echo " ".$text['label-link'].""; echo " "; echo " "; + echo " "; echo " ".$text['label-category'].""; echo " "; @@ -366,6 +373,49 @@ else { echo " "; echo " "; + echo " "; + echo " ".$text['label-icon'].""; + echo " "; + if (file_exists($_SERVER["PROJECT_ROOT"].'/resources/bootstrap/glyphicons.json')) { + $tmp_array = json_decode(file_get_contents($_SERVER["PROJECT_ROOT"].'/resources/bootstrap/glyphicons.json'), true); + if (is_array($tmp_array['icons']) && sizeof($tmp_array['icons']) > 0) { + // rebuild and sort array + foreach ($tmp_array['icons'] as $i => $glyphicon) { + $tmp_string = str_replace('glyphicon-', '', $glyphicon['id']); + $tmp_string = str_replace('-', ' ', $tmp_string); + $tmp_string = ucwords($tmp_string); + $glyphicons[$glyphicon['id']] = $tmp_string; + } + asort($glyphicons, SORT_STRING); + echo "\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo "
\n"; + echo " \n"; + echo " \n"; + echo " "; + echo "
\n"; + echo ""; + } + } + else { + echo " "; + } + echo " "; + echo " "; + echo " "; echo " ".$text['label-parent_menu'].""; echo " "; diff --git a/resources/bootstrap/glyphicons.json b/resources/bootstrap/glyphicons.json new file mode 100644 index 0000000000..91577b3ffd --- /dev/null +++ b/resources/bootstrap/glyphicons.json @@ -0,0 +1,1040 @@ +{ + "icons":[ + { + "id":"glyphicon-asterisk", + "unicode":"2a" + }, + { + "id":"glyphicon-plus", + "unicode":"2b" + }, + { + "id":"glyphicon-eur", + "unicode":"20ac" + }, + { + "id":"glyphicon-euro", + "unicode":"20ac" + }, + { + "id":"glyphicon-minus", + "unicode":"2212" + }, + { + "id":"glyphicon-cloud", + "unicode":"2601" + }, + { + "id":"glyphicon-envelope", + "unicode":"2709" + }, + { + "id":"glyphicon-pencil", + "unicode":"270f" + }, + { + "id":"glyphicon-glass", + "unicode":"e001" + }, + { + "id":"glyphicon-music", + "unicode":"e002" + }, + { + "id":"glyphicon-search", + "unicode":"e003" + }, + { + "id":"glyphicon-heart", + "unicode":"e005" + }, + { + "id":"glyphicon-star", + "unicode":"e006" + }, + { + "id":"glyphicon-star-empty", + "unicode":"e007" + }, + { + "id":"glyphicon-user", + "unicode":"e008" + }, + { + "id":"glyphicon-film", + "unicode":"e009" + }, + { + "id":"glyphicon-th-large", + "unicode":"e010" + }, + { + "id":"glyphicon-th", + "unicode":"e011" + }, + { + "id":"glyphicon-th-list", + "unicode":"e012" + }, + { + "id":"glyphicon-ok", + "unicode":"e013" + }, + { + "id":"glyphicon-remove", + "unicode":"e014" + }, + { + "id":"glyphicon-zoom-in", + "unicode":"e015" + }, + { + "id":"glyphicon-zoom-out", + "unicode":"e016" + }, + { + "id":"glyphicon-off", + "unicode":"e017" + }, + { + "id":"glyphicon-signal", + "unicode":"e018" + }, + { + "id":"glyphicon-cog", + "unicode":"e019" + }, + { + "id":"glyphicon-trash", + "unicode":"e020" + }, + { + "id":"glyphicon-home", + "unicode":"e021" + }, + { + "id":"glyphicon-file", + "unicode":"e022" + }, + { + "id":"glyphicon-time", + "unicode":"e023" + }, + { + "id":"glyphicon-road", + "unicode":"e024" + }, + { + "id":"glyphicon-download-alt", + "unicode":"e025" + }, + { + "id":"glyphicon-download", + "unicode":"e026" + }, + { + "id":"glyphicon-upload", + "unicode":"e027" + }, + { + "id":"glyphicon-inbox", + "unicode":"e028" + }, + { + "id":"glyphicon-play-circle", + "unicode":"e029" + }, + { + "id":"glyphicon-repeat", + "unicode":"e030" + }, + { + "id":"glyphicon-refresh", + "unicode":"e031" + }, + { + "id":"glyphicon-list-alt", + "unicode":"e032" + }, + { + "id":"glyphicon-lock", + "unicode":"e033" + }, + { + "id":"glyphicon-flag", + "unicode":"e034" + }, + { + "id":"glyphicon-headphones", + "unicode":"e035" + }, + { + "id":"glyphicon-volume-off", + "unicode":"e036" + }, + { + "id":"glyphicon-volume-down", + "unicode":"e037" + }, + { + "id":"glyphicon-volume-up", + "unicode":"e038" + }, + { + "id":"glyphicon-qrcode", + "unicode":"e039" + }, + { + "id":"glyphicon-barcode", + "unicode":"e040" + }, + { + "id":"glyphicon-tag", + "unicode":"e041" + }, + { + "id":"glyphicon-tags", + "unicode":"e042" + }, + { + "id":"glyphicon-book", + "unicode":"e043" + }, + { + "id":"glyphicon-bookmark", + "unicode":"e044" + }, + { + "id":"glyphicon-print", + "unicode":"e045" + }, + { + "id":"glyphicon-camera", + "unicode":"e046" + }, + { + "id":"glyphicon-font", + "unicode":"e047" + }, + { + "id":"glyphicon-bold", + "unicode":"e048" + }, + { + "id":"glyphicon-italic", + "unicode":"e049" + }, + { + "id":"glyphicon-text-height", + "unicode":"e050" + }, + { + "id":"glyphicon-text-width", + "unicode":"e051" + }, + { + "id":"glyphicon-align-left", + "unicode":"e052" + }, + { + "id":"glyphicon-align-center", + "unicode":"e053" + }, + { + "id":"glyphicon-align-right", + "unicode":"e054" + }, + { + "id":"glyphicon-align-justify", + "unicode":"e055" + }, + { + "id":"glyphicon-list", + "unicode":"e056" + }, + { + "id":"glyphicon-indent-left", + "unicode":"e057" + }, + { + "id":"glyphicon-indent-right", + "unicode":"e058" + }, + { + "id":"glyphicon-facetime-video", + "unicode":"e059" + }, + { + "id":"glyphicon-picture", + "unicode":"e060" + }, + { + "id":"glyphicon-map-marker", + "unicode":"e062" + }, + { + "id":"glyphicon-adjust", + "unicode":"e063" + }, + { + "id":"glyphicon-tint", + "unicode":"e064" + }, + { + "id":"glyphicon-edit", + "unicode":"e065" + }, + { + "id":"glyphicon-share", + "unicode":"e066" + }, + { + "id":"glyphicon-check", + "unicode":"e067" + }, + { + "id":"glyphicon-move", + "unicode":"e068" + }, + { + "id":"glyphicon-step-backward", + "unicode":"e069" + }, + { + "id":"glyphicon-fast-backward", + "unicode":"e070" + }, + { + "id":"glyphicon-backward", + "unicode":"e071" + }, + { + "id":"glyphicon-play", + "unicode":"e072" + }, + { + "id":"glyphicon-pause", + "unicode":"e073" + }, + { + "id":"glyphicon-stop", + "unicode":"e074" + }, + { + "id":"glyphicon-forward", + "unicode":"e075" + }, + { + "id":"glyphicon-fast-forward", + "unicode":"e076" + }, + { + "id":"glyphicon-step-forward", + "unicode":"e077" + }, + { + "id":"glyphicon-eject", + "unicode":"e078" + }, + { + "id":"glyphicon-chevron-left", + "unicode":"e079" + }, + { + "id":"glyphicon-chevron-right", + "unicode":"e080" + }, + { + "id":"glyphicon-plus-sign", + "unicode":"e081" + }, + { + "id":"glyphicon-minus-sign", + "unicode":"e082" + }, + { + "id":"glyphicon-remove-sign", + "unicode":"e083" + }, + { + "id":"glyphicon-ok-sign", + "unicode":"e084" + }, + { + "id":"glyphicon-question-sign", + "unicode":"e085" + }, + { + "id":"glyphicon-info-sign", + "unicode":"e086" + }, + { + "id":"glyphicon-screenshot", + "unicode":"e087" + }, + { + "id":"glyphicon-remove-circle", + "unicode":"e088" + }, + { + "id":"glyphicon-ok-circle", + "unicode":"e089" + }, + { + "id":"glyphicon-ban-circle", + "unicode":"e090" + }, + { + "id":"glyphicon-arrow-left", + "unicode":"e091" + }, + { + "id":"glyphicon-arrow-right", + "unicode":"e092" + }, + { + "id":"glyphicon-arrow-up", + "unicode":"e093" + }, + { + "id":"glyphicon-arrow-down", + "unicode":"e094" + }, + { + "id":"glyphicon-share-alt", + "unicode":"e095" + }, + { + "id":"glyphicon-resize-full", + "unicode":"e096" + }, + { + "id":"glyphicon-resize-small", + "unicode":"e097" + }, + { + "id":"glyphicon-exclamation-sign", + "unicode":"e101" + }, + { + "id":"glyphicon-gift", + "unicode":"e102" + }, + { + "id":"glyphicon-leaf", + "unicode":"e103" + }, + { + "id":"glyphicon-fire", + "unicode":"e104" + }, + { + "id":"glyphicon-eye-open", + "unicode":"e105" + }, + { + "id":"glyphicon-eye-close", + "unicode":"e106" + }, + { + "id":"glyphicon-warning-sign", + "unicode":"e107" + }, + { + "id":"glyphicon-plane", + "unicode":"e108" + }, + { + "id":"glyphicon-calendar", + "unicode":"e109" + }, + { + "id":"glyphicon-random", + "unicode":"e110" + }, + { + "id":"glyphicon-comment", + "unicode":"e111" + }, + { + "id":"glyphicon-magnet", + "unicode":"e112" + }, + { + "id":"glyphicon-chevron-up", + "unicode":"e113" + }, + { + "id":"glyphicon-chevron-down", + "unicode":"e114" + }, + { + "id":"glyphicon-retweet", + "unicode":"e115" + }, + { + "id":"glyphicon-shopping-cart", + "unicode":"e116" + }, + { + "id":"glyphicon-folder-close", + "unicode":"e117" + }, + { + "id":"glyphicon-folder-open", + "unicode":"e118" + }, + { + "id":"glyphicon-resize-vertical", + "unicode":"e119" + }, + { + "id":"glyphicon-resize-horizontal", + "unicode":"e120" + }, + { + "id":"glyphicon-hdd", + "unicode":"e121" + }, + { + "id":"glyphicon-bullhorn", + "unicode":"e122" + }, + { + "id":"glyphicon-bell", + "unicode":"e123" + }, + { + "id":"glyphicon-certificate", + "unicode":"e124" + }, + { + "id":"glyphicon-thumbs-up", + "unicode":"e125" + }, + { + "id":"glyphicon-thumbs-down", + "unicode":"e126" + }, + { + "id":"glyphicon-hand-right", + "unicode":"e127" + }, + { + "id":"glyphicon-hand-left", + "unicode":"e128" + }, + { + "id":"glyphicon-hand-up", + "unicode":"e129" + }, + { + "id":"glyphicon-hand-down", + "unicode":"e130" + }, + { + "id":"glyphicon-circle-arrow-right", + "unicode":"e131" + }, + { + "id":"glyphicon-circle-arrow-left", + "unicode":"e132" + }, + { + "id":"glyphicon-circle-arrow-up", + "unicode":"e133" + }, + { + "id":"glyphicon-circle-arrow-down", + "unicode":"e134" + }, + { + "id":"glyphicon-globe", + "unicode":"e135" + }, + { + "id":"glyphicon-wrench", + "unicode":"e136" + }, + { + "id":"glyphicon-tasks", + "unicode":"e137" + }, + { + "id":"glyphicon-filter", + "unicode":"e138" + }, + { + "id":"glyphicon-briefcase", + "unicode":"e139" + }, + { + "id":"glyphicon-fullscreen", + "unicode":"e140" + }, + { + "id":"glyphicon-dashboard", + "unicode":"e141" + }, + { + "id":"glyphicon-paperclip", + "unicode":"e142" + }, + { + "id":"glyphicon-heart-empty", + "unicode":"e143" + }, + { + "id":"glyphicon-link", + "unicode":"e144" + }, + { + "id":"glyphicon-phone", + "unicode":"e145" + }, + { + "id":"glyphicon-pushpin", + "unicode":"e146" + }, + { + "id":"glyphicon-usd", + "unicode":"e148" + }, + { + "id":"glyphicon-gbp", + "unicode":"e149" + }, + { + "id":"glyphicon-sort", + "unicode":"e150" + }, + { + "id":"glyphicon-sort-by-alphabet", + "unicode":"e151" + }, + { + "id":"glyphicon-sort-by-alphabet-alt", + "unicode":"e152" + }, + { + "id":"glyphicon-sort-by-order", + "unicode":"e153" + }, + { + "id":"glyphicon-sort-by-order-alt", + "unicode":"e154" + }, + { + "id":"glyphicon-sort-by-attributes", + "unicode":"e155" + }, + { + "id":"glyphicon-sort-by-attributes-alt", + "unicode":"e156" + }, + { + "id":"glyphicon-unchecked", + "unicode":"e157" + }, + { + "id":"glyphicon-expand", + "unicode":"e158" + }, + { + "id":"glyphicon-collapse-down", + "unicode":"e159" + }, + { + "id":"glyphicon-collapse-up", + "unicode":"e160" + }, + { + "id":"glyphicon-log-in", + "unicode":"e161" + }, + { + "id":"glyphicon-flash", + "unicode":"e162" + }, + { + "id":"glyphicon-log-out", + "unicode":"e163" + }, + { + "id":"glyphicon-new-window", + "unicode":"e164" + }, + { + "id":"glyphicon-record", + "unicode":"e165" + }, + { + "id":"glyphicon-save", + "unicode":"e166" + }, + { + "id":"glyphicon-open", + "unicode":"e167" + }, + { + "id":"glyphicon-saved", + "unicode":"e168" + }, + { + "id":"glyphicon-import", + "unicode":"e169" + }, + { + "id":"glyphicon-export", + "unicode":"e170" + }, + { + "id":"glyphicon-send", + "unicode":"e171" + }, + { + "id":"glyphicon-floppy-disk", + "unicode":"e172" + }, + { + "id":"glyphicon-floppy-saved", + "unicode":"e173" + }, + { + "id":"glyphicon-floppy-remove", + "unicode":"e174" + }, + { + "id":"glyphicon-floppy-save", + "unicode":"e175" + }, + { + "id":"glyphicon-floppy-open", + "unicode":"e176" + }, + { + "id":"glyphicon-credit-card", + "unicode":"e177" + }, + { + "id":"glyphicon-transfer", + "unicode":"e178" + }, + { + "id":"glyphicon-cutlery", + "unicode":"e179" + }, + { + "id":"glyphicon-header", + "unicode":"e180" + }, + { + "id":"glyphicon-compressed", + "unicode":"e181" + }, + { + "id":"glyphicon-earphone", + "unicode":"e182" + }, + { + "id":"glyphicon-phone-alt", + "unicode":"e183" + }, + { + "id":"glyphicon-tower", + "unicode":"e184" + }, + { + "id":"glyphicon-stats", + "unicode":"e185" + }, + { + "id":"glyphicon-sd-video", + "unicode":"e186" + }, + { + "id":"glyphicon-hd-video", + "unicode":"e187" + }, + { + "id":"glyphicon-subtitles", + "unicode":"e188" + }, + { + "id":"glyphicon-sound-stereo", + "unicode":"e189" + }, + { + "id":"glyphicon-sound-dolby", + "unicode":"e190" + }, + { + "id":"glyphicon-sound-5-1", + "unicode":"e191" + }, + { + "id":"glyphicon-sound-6-1", + "unicode":"e192" + }, + { + "id":"glyphicon-sound-7-1", + "unicode":"e193" + }, + { + "id":"glyphicon-copyright-mark", + "unicode":"e194" + }, + { + "id":"glyphicon-registration-mark", + "unicode":"e195" + }, + { + "id":"glyphicon-cloud-download", + "unicode":"e197" + }, + { + "id":"glyphicon-cloud-upload", + "unicode":"e198" + }, + { + "id":"glyphicon-tree-conifer", + "unicode":"e199" + }, + { + "id":"glyphicon-tree-deciduous", + "unicode":"e200" + }, + { + "id":"glyphicon-cd", + "unicode":"e201" + }, + { + "id":"glyphicon-save-file", + "unicode":"e202" + }, + { + "id":"glyphicon-open-file", + "unicode":"e203" + }, + { + "id":"glyphicon-level-up", + "unicode":"e204" + }, + { + "id":"glyphicon-copy", + "unicode":"e205" + }, + { + "id":"glyphicon-paste", + "unicode":"e206" + }, + { + "id":"glyphicon-alert", + "unicode":"e209" + }, + { + "id":"glyphicon-equalizer", + "unicode":"e210" + }, + { + "id":"glyphicon-king", + "unicode":"e211" + }, + { + "id":"glyphicon-queen", + "unicode":"e212" + }, + { + "id":"glyphicon-pawn", + "unicode":"e213" + }, + { + "id":"glyphicon-bishop", + "unicode":"e214" + }, + { + "id":"glyphicon-knight", + "unicode":"e215" + }, + { + "id":"glyphicon-baby-formula", + "unicode":"e216" + }, + { + "id":"glyphicon-tent", + "unicode":"26fa" + }, + { + "id":"glyphicon-blackboard", + "unicode":"e218" + }, + { + "id":"glyphicon-bed", + "unicode":"e219" + }, + { + "id":"glyphicon-apple", + "unicode":"f8ff" + }, + { + "id":"glyphicon-erase", + "unicode":"e221" + }, + { + "id":"glyphicon-hourglass", + "unicode":"231b" + }, + { + "id":"glyphicon-lamp", + "unicode":"e223" + }, + { + "id":"glyphicon-duplicate", + "unicode":"e224" + }, + { + "id":"glyphicon-piggy-bank", + "unicode":"e225" + }, + { + "id":"glyphicon-scissors", + "unicode":"e226" + }, + { + "id":"glyphicon-bitcoin", + "unicode":"e227" + }, + { + "id":"glyphicon-yen", + "unicode":"00a5" + }, + { + "id":"glyphicon-ruble", + "unicode":"20bd" + }, + { + "id":"glyphicon-scale", + "unicode":"e230" + }, + { + "id":"glyphicon-ice-lolly", + "unicode":"e231" + }, + { + "id":"glyphicon-ice-lolly-tasted", + "unicode":"e232" + }, + { + "id":"glyphicon-education", + "unicode":"e233" + }, + { + "id":"glyphicon-option-horizontal", + "unicode":"e234" + }, + { + "id":"glyphicon-option-vertical", + "unicode":"e235" + }, + { + "id":"glyphicon-menu-hamburger", + "unicode":"e236" + }, + { + "id":"glyphicon-modal-window", + "unicode":"e237" + }, + { + "id":"glyphicon-oil", + "unicode":"e238" + }, + { + "id":"glyphicon-grain", + "unicode":"e239" + }, + { + "id":"glyphicon-sunglasses", + "unicode":"e240" + }, + { + "id":"glyphicon-text-size", + "unicode":"e241" + }, + { + "id":"glyphicon-text-color", + "unicode":"e242" + }, + { + "id":"glyphicon-text-background", + "unicode":"e243" + }, + { + "id":"glyphicon-object-align-top", + "unicode":"e244" + }, + { + "id":"glyphicon-object-align-bottom", + "unicode":"e245" + }, + { + "id":"glyphicon-object-align-horizontal", + "unicode":"e246" + }, + { + "id":"glyphicon-object-align-left", + "unicode":"e247" + }, + { + "id":"glyphicon-object-align-vertical", + "unicode":"e248" + }, + { + "id":"glyphicon-object-align-right", + "unicode":"e249" + }, + { + "id":"glyphicon-triangle-right", + "unicode":"e250" + }, + { + "id":"glyphicon-triangle-left", + "unicode":"e251" + }, + { + "id":"glyphicon-triangle-bottom", + "unicode":"e252" + }, + { + "id":"glyphicon-triangle-top", + "unicode":"e253" + }, + { + "id":"glyphicon-console", + "unicode":"e254" + }, + { + "id":"glyphicon-superscript", + "unicode":"e255" + }, + { + "id":"glyphicon-subscript", + "unicode":"e256" + }, + { + "id":"glyphicon-menu-left", + "unicode":"e257" + }, + { + "id":"glyphicon-menu-right", + "unicode":"e258" + }, + { + "id":"glyphicon-menu-down", + "unicode":"e259" + }, + { + "id":"glyphicon-menu-up", + "unicode":"e260" + } + ] +} \ No newline at end of file diff --git a/resources/classes/menu.php b/resources/classes/menu.php index 73f219d05d..39cdffb21f 100644 --- a/resources/classes/menu.php +++ b/resources/classes/menu.php @@ -99,6 +99,7 @@ if (!class_exists('menu')) { $menu_item_uuid = $menu['uuid']; $menu_item_parent_uuid = $menu['parent_uuid']; $menu_item_category = $menu['category']; + $menu_item_icon = $menu['icon']; $menu_item_path = $menu['path']; $menu_item_order = $menu['order']; $menu_item_description = $menu['desc']; @@ -120,6 +121,7 @@ if (!class_exists('menu')) { $sql .= "menu_item_title, "; $sql .= "menu_item_link, "; $sql .= "menu_item_category, "; + $sql .= "menu_item_icon, "; if (strlen($menu_item_order) > 0) { $sql .= "menu_item_order, "; } @@ -135,6 +137,7 @@ if (!class_exists('menu')) { $sql .= "'".check_str($menu_item_title)."', "; $sql .= "'$menu_item_path', "; $sql .= "'$menu_item_category', "; + $sql .= "'$menu_item_icon', "; if (strlen($menu_item_order) > 0) { $sql .= "'$menu_item_order', "; } @@ -404,7 +407,7 @@ if (!class_exists('menu')) { //get the menu from the database if (strlen($sql) == 0) { //default sql for base of the menu - $sql = "select i.menu_item_link, l.menu_item_title as menu_language_title, i.menu_item_title, i.menu_item_protected, i.menu_item_category, i.menu_item_uuid, i.menu_item_parent_uuid "; + $sql = "select i.menu_item_link, l.menu_item_title as menu_language_title, i.menu_item_title, i.menu_item_protected, i.menu_item_category, i.menu_item_icon, i.menu_item_uuid, i.menu_item_parent_uuid "; $sql .= "from v_menu_items as i, v_menu_languages as l "; $sql .= "where i.menu_item_uuid = l.menu_item_uuid "; $sql .= "and l.menu_language = '".$_SESSION['domain']['language']['code']."' "; @@ -475,7 +478,7 @@ if (!class_exists('menu')) { $menu_item_level = $menu_item_level+1; //get the child menu from the database - $sql = "select i.menu_item_link, l.menu_item_title as menu_language_title, i.menu_item_title, i.menu_item_protected, i.menu_item_category, i.menu_item_uuid, i.menu_item_parent_uuid "; + $sql = "select i.menu_item_link, l.menu_item_title as menu_language_title, i.menu_item_title, i.menu_item_protected, i.menu_item_category, i.menu_item_icon, i.menu_item_uuid, i.menu_item_parent_uuid "; $sql .= "from v_menu_items as i, v_menu_languages as l "; $sql .= "where i.menu_item_uuid = l.menu_item_uuid "; $sql .= "and l.menu_language = '".$_SESSION['domain']['language']['code']."' "; @@ -513,6 +516,7 @@ if (!class_exists('menu')) { //set the variables $menu_item_link = $row['menu_item_link']; $menu_item_category = $row['menu_item_category']; + $menu_item_icon = $row['menu_item_icon']; $menu_item_uuid = $row['menu_item_uuid']; $menu_item_parent_uuid = $row['menu_item_parent_uuid']; diff --git a/themes/default/template.php b/themes/default/template.php index dab74dcaa5..12666f7d58 100644 --- a/themes/default/template.php +++ b/themes/default/template.php @@ -2048,17 +2048,13 @@ } $mod_a_2 = ($menu_parent['menu_item_link'] != '') ? $menu_parent['menu_item_link'] : '#'; $mod_a_3 = ($menu_parent['menu_item_category'] == 'external') ? "target='_blank' " : null; - if ($_SESSION['theme']['menu_main_icons']['boolean'] == 'true' || $_SESSION['theme']['menu_main_icons']['boolean'] == '') { - switch ($menu_parent['menu_item_title']) { - case "Home": $glyph = 'home'; break; - case "Accounts": $glyph = 'user'; break; - case "Dialplan": $glyph = 'transfer'; break; - case "Apps": $glyph = 'send'; break; - case "Status": $glyph = 'equalizer'; break; - case "Advanced": $glyph = 'cog'; break; - default: $glyph = null; + if ($_SESSION['theme']['menu_main_icons']['boolean'] != 'false') { + if ($menu_parent['menu_item_icon'] != '' && substr_count($menu_parent['menu_item_icon'], 'glyphicon-') > 0) { + $menu_main_icon = ""; + } + else { + unset($menu_main_icon); } - $menu_main_icon = ($glyph != '') ? "" : null; $menu_main_item = ""; } else { @@ -2079,14 +2075,15 @@ $mod_a_2 = PROJECT_PATH . $mod_a_2; } $mod_a_3 = ($menu_sub['menu_item_category'] == 'external') ? "target='_blank' " : null; - if ($_SESSION['theme']['menu_sub_icons']['boolean'] == 'true') { - $mod_nw = ($menu_sub['menu_item_category'] == 'external') ? "" : null; - switch ($menu_sub['menu_item_title']) { - case 'Logout': $mod_icon = ""; break; - default: $mod_icon = null; + if ($_SESSION['theme']['menu_sub_icons']['boolean'] != 'false') { + if ($menu_sub['menu_item_icon'] != '' && substr_count($menu_sub['menu_item_icon'], 'glyphicon-') > 0) { + $menu_sub_icon = ""; + } + else { + unset($menu_sub_icon); } } - echo "
  • ".(($_SESSION['theme']['menu_sub_icons']) ? "" : null).$menu_sub['menu_language_title'].$mod_icon.$mod_nw."
  • \n"; + echo "
  • ".(($_SESSION['theme']['menu_sub_icons']) ? "" : null).$menu_sub['menu_language_title'].$menu_sub_icon."
  • \n"; } echo "\n"; }