diff --git a/templates/kathrine/config.php b/templates/kathrine/config.php index 63847317..52835ff4 100644 --- a/templates/kathrine/config.php +++ b/templates/kathrine/config.php @@ -1,12 +1,18 @@ 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') -); +// max 7 menus for kathrine +$config['menu_categories'] = [ + MENU_CATEGORY_NEWS => ['id' => 'news', 'name' => 'Latest News'], + // you can add custom menu by uncommenting this + // after doing it, go to admin panel -> Menus and add your entries for this category + // tip: you can move it up/down to show it on specific position + //7 => array('id' => 'testing', 'name' => 'Test Menu 1'), + //8 => array('id' => 'testing2', 'name' => 'Test Menu 2'), + MENU_CATEGORY_ACCOUNT => ['id' => 'account', 'name' => 'Account'], + MENU_CATEGORY_COMMUNITY => ['id' => 'community', 'name' => 'Community'], + MENU_CATEGORY_LIBRARY => ['id' => 'library', 'name' => 'Library'], + MENU_CATEGORY_SHOP => ['id' => 'shops', 'name' => 'Shop'] +]; $config['menus'] = require __DIR__ . '/menus.php'; diff --git a/templates/kathrine/javascript.php b/templates/kathrine/javascript.php index a092b7c2..32fcf53d 100644 --- a/templates/kathrine/javascript.php +++ b/templates/kathrine/javascript.php @@ -1,42 +1,40 @@ -var category = ' $info) { + $templatePages = get_template_pages($id); + + if ($id == MENU_CATEGORY_ACCOUNT) { + $templatePages = array_merge($templatePages, ['account']); + } + + if (in_array($tmp[0], $templatePages)) { + echo $info['id']; + break; + } } ?>'; diff --git a/templates/kathrine/menu.js.html.twig b/templates/kathrine/menu.js.html.twig index adf7ceb0..ae8ad3bf 100644 --- a/templates/kathrine/menu.js.html.twig +++ b/templates/kathrine/menu.js.html.twig @@ -1,10 +1,10 @@ var list = new Array(); {% set i = 0 %} -{% for cat in categories %} - {% if cat.id != 'shops' or setting('core.gifts_system') %} - list[{{ i }}] = '{{ cat.id }}'; +{% for id, cat in config('menu_categories') %} + {% if (cat.id != 'shops' or setting('core.gifts_system')) and menus[id]|length > 0 %} + list[{{ i }}] = '{{ cat.id }}'; + {% set i = i + 1 %} {% endif %} -{% set i = i + 1 %} {% endfor %} function initMenu() diff --git a/templates/kathrine/style.css b/templates/kathrine/style.css index 45a1a9d4..cc212685 100644 --- a/templates/kathrine/style.css +++ b/templates/kathrine/style.css @@ -27,11 +27,13 @@ body #tabs { - width: 580px; + width: 99%; height: 32px; background: url('images/tabs-bg.png') no-repeat; - float: left; padding-left: 200px; + position: relative; + display: inline-flex; + right: 0; } #tabs .tab diff --git a/templates/kathrine/template.php b/templates/kathrine/template.php index af03b3c9..ffa2195a 100644 --- a/templates/kathrine/template.php +++ b/templates/kathrine/template.php @@ -8,7 +8,9 @@ defined('MYAAC') or die('Direct access not allowed!'); @@ -28,11 +30,24 @@ defined('MYAAC') or die('Direct access not allowed!'); + + 6) { + $tabsStyle .= 'padding-left: 4px;'; + $tabsStyle .= 'padding-right: 12px;'; + } + elseif ($menusCount > 5) { + $tabsStyle .= 'padding-left: 90px;'; + } + ?> + -
+
$cat) { - if($id != MENU_CATEGORY_SHOP || $config['gifts_system']) { ?> + if (($id != MENU_CATEGORY_SHOP || $config['gifts_system']) && isset($menus[$id])) { ?>