c
This commit is contained in:
@@ -9,7 +9,7 @@ function _get_menu_list() {
|
||||
'product',
|
||||
'customer',
|
||||
'marketing',
|
||||
'investor_relation',
|
||||
//'investor_relation',
|
||||
'article',
|
||||
'job',
|
||||
'pcbuilder',
|
||||
@@ -21,8 +21,21 @@ function _get_menu_list() {
|
||||
|
||||
$menu_list = [];
|
||||
foreach ($main_items as $item) {
|
||||
$menu_list[$item] = include_once __DIR__."/menu_item/".$item.".php";
|
||||
$item_menu = include_once __DIR__."/menu_item/".$item.".php";
|
||||
|
||||
// skip not enabled
|
||||
if(!$item_menu['enable']) continue;
|
||||
|
||||
// skip not enabled children
|
||||
$item_menu_children_enabled = array_filter($item_menu['menu'], function ($menu_child) { return $menu_child['enable'];});
|
||||
if(!sizeof($item_menu_children_enabled)) continue;
|
||||
|
||||
// reset menu for $item_menu
|
||||
$item_menu['menu'] = $item_menu_children_enabled;
|
||||
|
||||
$menu_list[$item] = $item_menu;
|
||||
}
|
||||
|
||||
|
||||
return $menu_list;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ return array(
|
||||
"name" => "Tuyển dụng",
|
||||
"url" => "",
|
||||
"menu" => array(
|
||||
|
||||
array(
|
||||
'enable' => true ,
|
||||
'module' => 'job',
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
return array(
|
||||
'enable' => true ,
|
||||
|
||||
"name" => "Marketing",
|
||||
"url" => "",
|
||||
"menu" => array(
|
||||
@@ -51,23 +50,23 @@ return array(
|
||||
'url' => '/admin/?opt=marketing&view=poster-upload',
|
||||
),
|
||||
|
||||
array(
|
||||
/* array(
|
||||
'enable' => true ,
|
||||
'module' => 'system',
|
||||
'view' => 'store-design',
|
||||
'id' => 'system/store-design',
|
||||
'name' => 'Hình nền website',
|
||||
'url' => '/admin/?opt=system&view=store-design§ion=background',
|
||||
),
|
||||
),*/
|
||||
|
||||
array(
|
||||
/* array(
|
||||
'enable' => false,
|
||||
'module' => 'email',
|
||||
'view' => 'home',
|
||||
'id' => 'email/home',
|
||||
'name' => 'Email',
|
||||
'url' => '/admin/?opt=email',
|
||||
),
|
||||
),*/
|
||||
|
||||
array(
|
||||
'enable' => false,
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
|
||||
return array(
|
||||
'enable' => true ,
|
||||
|
||||
"name" => "Trả góp",
|
||||
"url" => "",
|
||||
"menu" => array(
|
||||
0 => array(
|
||||
array(
|
||||
'enable' => true ,
|
||||
'module' => 'payinstall',
|
||||
'view' => 'order',
|
||||
@@ -15,7 +14,7 @@ return array(
|
||||
'url' => '/admin/?opt=payinstall&view=order',
|
||||
),
|
||||
|
||||
1 => array(
|
||||
array(
|
||||
'enable' => true ,
|
||||
'module' => 'payinstall',
|
||||
'view' => 'home',
|
||||
@@ -24,7 +23,7 @@ return array(
|
||||
'url' => '/admin/?opt=payinstall',
|
||||
),
|
||||
|
||||
2 => array(
|
||||
array(
|
||||
'enable' => true ,
|
||||
'module' => 'payinstall',
|
||||
'view' => 'category',
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
return array(
|
||||
'enable' => true ,
|
||||
|
||||
"name" => "Sản phẩm",
|
||||
"url" => "",
|
||||
"menu" => array(
|
||||
@@ -17,32 +16,32 @@ return array(
|
||||
'url' => '/admin/?opt=product',
|
||||
),
|
||||
|
||||
array(
|
||||
/* array(
|
||||
'enable' => false ,
|
||||
'module' => 'product',
|
||||
'view' => 'user-rating',
|
||||
'id' => 'product/user-rating',
|
||||
'name' => 'Đánh giá ',
|
||||
'url' => '/admin/?opt=product&view=user-rating',
|
||||
),
|
||||
),*/
|
||||
|
||||
array(
|
||||
/*array(
|
||||
'enable' => false ,
|
||||
'module' => 'product',
|
||||
'view' => 'product-customer-image',
|
||||
'id' => 'product/product-customer-image',
|
||||
'name' => 'Ảnh người dùng gửi',
|
||||
'url' => '/admin/?opt=product&view=product-customer-image',
|
||||
),
|
||||
),*/
|
||||
|
||||
array(
|
||||
/*array(
|
||||
'enable' => true ,
|
||||
'module' => 'product',
|
||||
'view' => 'product-list-update',
|
||||
'id' => 'product/product-list-update',
|
||||
'name' => 'Bảng giá cập nhật',
|
||||
'url' => '/admin/?opt=product&view=product-list-update',
|
||||
),
|
||||
),*/
|
||||
|
||||
array(
|
||||
'enable' => true ,
|
||||
@@ -87,7 +86,7 @@ return array(
|
||||
),
|
||||
|
||||
array(
|
||||
'enable' => false ,
|
||||
'enable' => true ,
|
||||
'module' => 'addon',
|
||||
'view' => 'home',
|
||||
'id' => 'addon/home',
|
||||
@@ -96,7 +95,7 @@ return array(
|
||||
),
|
||||
|
||||
array(
|
||||
'enable' => false ,
|
||||
'enable' => true ,
|
||||
'module' => 'config_group',
|
||||
'view' => 'home',
|
||||
'id' => 'config_group/home',
|
||||
@@ -104,53 +103,35 @@ return array(
|
||||
'url' => '/admin/?opt=config_group',
|
||||
),
|
||||
|
||||
array(
|
||||
/*array(
|
||||
'enable' => false ,
|
||||
'module' => 'supplier',
|
||||
'view' => 'home',
|
||||
'id' => 'supplier/home',
|
||||
'name' => 'Nhà cung cấp',
|
||||
'url' => '/admin/?opt=supplier',
|
||||
),
|
||||
),*/
|
||||
|
||||
array(
|
||||
'enable' => false ,
|
||||
'module' => 'product',
|
||||
'view' => 'product-erp-not-web',
|
||||
'id' => 'product/product-erp-not-web',
|
||||
'name' => 'SP ERP chưa có trên web',
|
||||
'url' => '/admin/?opt=product&view=product-erp-not-web',
|
||||
),
|
||||
|
||||
array(
|
||||
/* array(
|
||||
'enable' => false ,
|
||||
'module' => 'product',
|
||||
'view' => 'set-promotion-price',
|
||||
'id' => 'product/set-promotion-price',
|
||||
'name' => 'Cài đặt giá khuyến mại',
|
||||
'url' => '/admin/?opt=product&view=set-promotion-price',
|
||||
),
|
||||
),*/
|
||||
|
||||
array(
|
||||
/*array(
|
||||
'enable' => false ,
|
||||
'module' => 'product',
|
||||
'view' => 'product-per-customer-group',
|
||||
'id' => 'product/product-per-customer-group',
|
||||
'name' => 'Giá theo nhóm khách hàng',
|
||||
'url' => '/admin/?opt=product&view=product-per-customer-group',
|
||||
),
|
||||
),*/
|
||||
|
||||
array(
|
||||
'enable' => false ,
|
||||
'module' => 'product',
|
||||
'view' => 'list-competitor',
|
||||
'id' => 'product/list-competitor',
|
||||
'name' => 'So sánh giá đối thủ',
|
||||
'url' => '/admin/?opt=product&view=list-competitor',
|
||||
),
|
||||
|
||||
array(
|
||||
'enable' => false ,
|
||||
'enable' => true ,
|
||||
'module' => 'product',
|
||||
'view' => 'set',
|
||||
'id' => 'product/set',
|
||||
@@ -166,6 +147,5 @@ return array(
|
||||
'name' => 'Nhóm thông số kỹ thuật',
|
||||
'url' => '/admin/?opt=product&view=spec-group',
|
||||
),
|
||||
|
||||
),
|
||||
);
|
||||
|
||||
@@ -6,7 +6,7 @@ return array(
|
||||
"name" => "Thống kê",
|
||||
"url" => "",
|
||||
"menu" => array(
|
||||
0 => array(
|
||||
array(
|
||||
'enable' => true ,
|
||||
'module' => 'report',
|
||||
'view' => 'visitor',
|
||||
@@ -15,7 +15,7 @@ return array(
|
||||
'url' => '/admin/?opt=report&view=visitor',
|
||||
),
|
||||
|
||||
1 => array(
|
||||
array(
|
||||
'enable' => true ,
|
||||
'module' => 'report',
|
||||
'view' => 'customer',
|
||||
@@ -24,7 +24,7 @@ return array(
|
||||
'url' => '/admin/?opt=report&view=customer',
|
||||
),
|
||||
|
||||
2 => array(
|
||||
array(
|
||||
'enable' => true ,
|
||||
'module' => 'report',
|
||||
'view' => 'order',
|
||||
@@ -33,7 +33,7 @@ return array(
|
||||
'url' => '/admin/?opt=report&view=order',
|
||||
),
|
||||
|
||||
3 => array(
|
||||
array(
|
||||
'enable' => true ,
|
||||
'module' => 'report',
|
||||
'view' => 'product-buy',
|
||||
@@ -42,7 +42,7 @@ return array(
|
||||
'url' => '/admin/?opt=report&view=product-buy',
|
||||
),
|
||||
|
||||
4 => array(
|
||||
array(
|
||||
'enable' => true ,
|
||||
'module' => 'report',
|
||||
'view' => 'product-visit',
|
||||
@@ -51,7 +51,7 @@ return array(
|
||||
'url' => '/admin/?opt=report&view=product-visit',
|
||||
),
|
||||
|
||||
5 => array(
|
||||
array(
|
||||
'enable' => true ,
|
||||
'module' => 'report',
|
||||
'view' => 'referer',
|
||||
@@ -60,7 +60,7 @@ return array(
|
||||
'url' => '/admin/?opt=report&view=referer',
|
||||
),
|
||||
|
||||
6 => array(
|
||||
array(
|
||||
'enable' => true ,
|
||||
'module' => 'report',
|
||||
'view' => 'search',
|
||||
@@ -69,13 +69,13 @@ return array(
|
||||
'url' => '/admin/?opt=report&view=search',
|
||||
),
|
||||
|
||||
/*7 => array(
|
||||
array(
|
||||
'enable' => true ,
|
||||
'module' => 'report',
|
||||
'view' => 'error-page',
|
||||
'id' => '',
|
||||
'name' => 'Lỗi website',
|
||||
'url' => '/admin/?opt=report&view=error-page',
|
||||
),*/
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -55,8 +55,8 @@ class AppAdmin
|
||||
|
||||
$data = include_once $module_file;
|
||||
|
||||
$global_data = [
|
||||
"name" => $this->current_route_info['module'],
|
||||
$global_data = [
|
||||
"module" => $this->current_route_info['module'],
|
||||
"view" => $this->current_route_info['view'],
|
||||
"main_menu" => include_once ROOT_DIR."/data/menu.php",
|
||||
];
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
function debug_var($input) {
|
||||
@ob_start();
|
||||
print_r($input);
|
||||
$content = ob_get_contents();
|
||||
@ob_end_clean();
|
||||
|
||||
echo join("\r", ['<textarea cols="80" rows="20">', $content, '</textarea>']) ;
|
||||
}
|
||||
|
||||
function init_autoload(){
|
||||
$classLoader = require_once ROOT_DIR . '/package/vendor/autoload.php';
|
||||
$classLoader->add("Hura8", ROOT_DIR . '/inc' );
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
{% include javascript/global %}
|
||||
|
||||
{% if global.name == 'home' %}
|
||||
{% include javascript/homepage %}
|
||||
{% if global.module == 'home' %}
|
||||
{% include javascript/homepage %}
|
||||
|
||||
{% elsif global.module == 'product' %}
|
||||
{% include javascript/product_form %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% if global.name == 'product' %}
|
||||
{% include javascript/product_form %}
|
||||
{% endif %}
|
||||
@@ -24,12 +24,12 @@
|
||||
</head>
|
||||
<body>
|
||||
|
||||
{{ global | show_var }}
|
||||
{{ page | show_var }}
|
||||
<!--
|
||||
{{ page | show_var }}-->
|
||||
|
||||
<div class="admin-global-container">
|
||||
|
||||
<!-- Menu cũ -->
|
||||
<!-- Menu full -->
|
||||
<div class="admin-menu-container box-menu sticky top-0 bottom-0 h-[100vh] hidden" id="js-menu-big">
|
||||
<a href="javascript:void(0)" class="icon-close" id="js-hide-menu">
|
||||
<i class="fa-solid fa-outdent"></i>
|
||||
@@ -42,14 +42,14 @@
|
||||
<div class="menu-list">
|
||||
<a href="/" class="item">
|
||||
<i class="icons icon-home"></i>
|
||||
<span class="title"> Home </span>
|
||||
<span class="title"> Dashboard </span>
|
||||
</a>
|
||||
|
||||
{% for _category in global.main_menu %}
|
||||
{% assign _type = _category[0] %}
|
||||
{% assign _menuArray = _category[1].menu %}
|
||||
{% if _category[1].enable == 1 %}
|
||||
<details {% if _type == global.name %} open {% endif %}>
|
||||
<details {% if _type == global.module %} open {% endif %}>
|
||||
<summary class="item">
|
||||
<div class="flex items-center">
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
<div class="sub-menu">
|
||||
{% for _item in _menuArray %}
|
||||
<a href="?module={{ _item.module }}&view={{ _item.view }}" {% if _item.view == global.view and
|
||||
_type == global.name %} class="current" {% endif %}> {{ _item.name }} </a>
|
||||
_type == global.module %} class="current" {% endif %}> {{ _item.name }} </a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</details>
|
||||
@@ -109,7 +109,7 @@
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Menu mới -->
|
||||
<!-- Menu collapse -->
|
||||
<div class="admin-menu box-menu sticky top-0 bg-[#004E99] flex flex-col justify-between pb-[20px] min-h-[100vh]" id="js-menu-small">
|
||||
<div>
|
||||
<div class="logo item items-center justify-center border-[rgba(255,255,255,0.15)] border-b p-[20px_0_38px_!important]">
|
||||
@@ -125,7 +125,7 @@
|
||||
<a href="/" class="icons icon-home"> </a>
|
||||
|
||||
<div class="sub-menu">
|
||||
<p class="font-bold"> Home </p>
|
||||
<p class="font-bold"> Dashboard </p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
<div class="menu-list">
|
||||
{% for _item in _menuArray %}
|
||||
<a href="?module={{ _item.module }}&view={{ _item.view }}" {% if _item.view == global.view and
|
||||
_type == global.name %} class="current" {% endif %}> {{ _item.name }} </a>
|
||||
_type == global.module %} class="current" {% endif %}> {{ _item.name }} </a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
@@ -279,4 +279,4 @@
|
||||
{% include javascript/index %}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user