From 5fa4890b708319c3eebe559076e877cdc725899b Mon Sep 17 00:00:00 2001 From: slawkens Date: Fri, 21 Jul 2023 15:54:22 +0200 Subject: [PATCH] Add support for menu_default_color --- admin/pages/menus.php | 8 ++++++-- system/templates/admin.menus.js.html.twig | 4 ++-- templates/kathrine/config.php | 4 +++- templates/tibiacom/config.php | 2 ++ 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/admin/pages/menus.php b/admin/pages/menus.php index b5e7dbdf..bd1635a6 100644 --- a/admin/pages/menus.php +++ b/admin/pages/menus.php @@ -46,6 +46,7 @@ if (isset($_REQUEST['template'])) { if ($cache->enabled()) { $cache->delete('template_menus'); } + success('Saved at ' . date('H:i')); } @@ -56,6 +57,7 @@ if (isset($_REQUEST['template'])) { echo 'Cannot find template config.php file.'; return; } + if (!isset($config['menu_categories'])) { echo "No menu categories set in template config.php.
This template doesn't support dynamic menus."; return; @@ -75,6 +77,7 @@ if (isset($_REQUEST['template'])) { $menus_db = $db->query('SELECT `name`, `link`, `blank`, `color`, `category`, `ordering` FROM `' . TABLE_PREFIX . 'menu` WHERE `enabled` = 1 AND `template` = ' . $db->quote($template) . ' ORDER BY `ordering` ASC;')->fetchAll(); foreach ($menus_db as $menu) { $menus[$menu['category']][] = array('name' => $menu['name'], 'link' => $menu['link'], 'blank' => $menu['blank'], 'color' => $menu['color'], 'ordering' => $menu['ordering']); + var_dump($menu['color']); } $last_id = array(); ?> @@ -98,7 +101,7 @@ if (isset($_REQUEST['template'])) { - + display('admin.menus.js.html.twig', array( 'menus' => $menus, - 'last_id' => $last_id + 'last_id' => $last_id, + 'menu_default_color' => $config['menu_default_color'] ?? '#ffffff' )); ?> '); //add input bo + $('#sortable-' + cat).append('
  • '); //add input bo $('#remove-button-' + cat + '-' + id).click(function () { $('#list-' + $(this).attr("id").replace('remove-button-', '')).remove(); }); @@ -69,4 +69,4 @@ ] }); } - \ No newline at end of file + diff --git a/templates/kathrine/config.php b/templates/kathrine/config.php index a53500b1..2de3804e 100644 --- a/templates/kathrine/config.php +++ b/templates/kathrine/config.php @@ -1,8 +1,10 @@ array('id' => 'news', 'name' => 'Latest News'), MENU_CATEGORY_ACCOUNT => array('id' => 'account', 'name' => 'Account'), MENU_CATEGORY_COMMUNITY => array('id' => 'community', 'name' => 'Community'), MENU_CATEGORY_LIBRARY => array('id' => 'library', 'name' => 'Library'), MENU_CATEGORY_SHOP => array('id' => 'shops', 'name' => 'Shop') -); \ No newline at end of file +); diff --git a/templates/tibiacom/config.php b/templates/tibiacom/config.php index 5e529e06..3f3f49d5 100644 --- a/templates/tibiacom/config.php +++ b/templates/tibiacom/config.php @@ -1,4 +1,6 @@ array('id' => 'news', 'name' => 'Latest News'), MENU_CATEGORY_ACCOUNT => array('id' => 'account', 'name' => 'Account'),