diff --git a/beike/Admin/View/Components/Sidebar.php b/beike/Admin/View/Components/Sidebar.php index af924711..dbbac0ec 100644 --- a/beike/Admin/View/Components/Sidebar.php +++ b/beike/Admin/View/Components/Sidebar.php @@ -114,7 +114,7 @@ class Sidebar extends Component { $prefix = ['home.']; - return hook_filter('sidebar.home.prefix', $prefix); + return hook_filter('admin.sidebar.home.prefix', $prefix); } /** @@ -124,7 +124,7 @@ class Sidebar extends Component { $prefix = ['products.', 'categories.', 'brands.', 'attribute_groups.', 'attributes.']; - return hook_filter('sidebar.product.prefix', $prefix); + return hook_filter('admin.sidebar.product.prefix', $prefix); } /** @@ -134,7 +134,7 @@ class Sidebar extends Component { $prefix = ['customers.', 'customer_groups.']; - return hook_filter('sidebar.customer.prefix', $prefix); + return hook_filter('admin.sidebar.customer.prefix', $prefix); } /** @@ -144,7 +144,7 @@ class Sidebar extends Component { $prefix = ['orders.', 'rmas.', 'rma_reasons.']; - return hook_filter('sidebar.order.prefix', $prefix); + return hook_filter('admin.sidebar.order.prefix', $prefix); } /** @@ -154,7 +154,7 @@ class Sidebar extends Component { $prefix = ['pages.']; - return hook_filter('sidebar.page.prefix', $prefix); + return hook_filter('admin.sidebar.page.prefix', $prefix); } /** @@ -164,7 +164,7 @@ class Sidebar extends Component { $prefix = ['settings.', 'admin_users.', 'admin_roles.', 'plugins.', 'marketing.', 'tax_classes', 'tax_rates', 'regions', 'currencies', 'languages', 'design_menu', 'countries', 'zones']; - return hook_filter('sidebar.setting.prefix', $prefix); + return hook_filter('admin.sidebar.setting.prefix', $prefix); } /** @@ -181,7 +181,7 @@ class Sidebar extends Component ['route' => 'plugins.index', 'icon' => 'fa fa-tachometer-alt', 'hide_mobile' => 1], ]; - return hook_filter('sidebar.home_routes', $routes); + return hook_filter('admin.sidebar.home_routes', $routes); } /** @@ -198,7 +198,7 @@ class Sidebar extends Component ['route' => 'products.trashed', 'icon' => 'fa fa-tachometer-alt'], ]; - return hook_filter('sidebar.product_routes', $routes); + return hook_filter('admin.sidebar.product_routes', $routes); } /** @@ -212,7 +212,7 @@ class Sidebar extends Component ['route' => 'customers.trashed', 'icon' => 'fa fa-tachometer-alt'], ]; - return hook_filter('sidebar.customer_routes', $routes); + return hook_filter('admin.sidebar.customer_routes', $routes); } /** @@ -226,7 +226,7 @@ class Sidebar extends Component ['route' => 'rma_reasons.index', 'icon' => 'fa fa-tachometer-alt'], ]; - return hook_filter('sidebar.order_routes', $routes); + return hook_filter('admin.sidebar.order_routes', $routes); } /** @@ -239,7 +239,7 @@ class Sidebar extends Component ['route' => 'pages.index', 'icon' => 'fa fa-tachometer-alt'], ]; - return hook_filter('sidebar.pages_routes', $routes); + return hook_filter('admin.sidebar.pages_routes', $routes); } /** @@ -265,7 +265,7 @@ class Sidebar extends Component ['route' => 'design_menu.index', 'icon' => 'fa fa-tachometer-alt', 'hide_mobile' => 1], ]; - return hook_filter('sidebar.setting_routes', $routes); + return hook_filter('admin.sidebar.setting_routes', $routes); } /** diff --git a/plugins/LatestProducts/Bootstrap.php b/plugins/LatestProducts/Bootstrap.php index 64868a06..2a54fb18 100644 --- a/plugins/LatestProducts/Bootstrap.php +++ b/plugins/LatestProducts/Bootstrap.php @@ -24,6 +24,7 @@ class Bootstrap // $this->modifyProductDetail(); // $this->modifyAdminProductEdit(); + // $this->modifySetting(); } @@ -81,13 +82,12 @@ class Bootstrap { // 通过数据 hook 修改产品详情页产品名称 add_hook_filter('product.show.data', function ($product) { - $product['product']['name'] = '[疯狂热销]'. $product['product']['name']; + $product['product']['name'] = '[疯狂热销]' . $product['product']['name']; return $product; }); // 通过模板 hook 在产品详情页名称上面添加 Hot 标签 add_hook_blade('product.detail.name', function ($callback, $output, $data) { - return $output; $badge = 'Hot'; return $badge . $output; }); @@ -116,4 +116,19 @@ class Bootstrap }, 1); } + + /** + * 系统设置添加新 tab + */ + private function modifySetting() + { + add_hook_blade('admin.setting.nav.after', function ($callback, $output, $data) { + return view('LatestProducts::admin.setting.nav')->render(); + }); + + add_hook_blade('admin.setting.after', function ($callback, $output, $data) { + return view('LatestProducts::admin.setting.tab')->render(); + }); + } + } diff --git a/resources/beike/admin/views/pages/setting.blade.php b/resources/beike/admin/views/pages/setting.blade.php index 6b90f27a..97bfb02f 100644 --- a/resources/beike/admin/views/pages/setting.blade.php +++ b/resources/beike/admin/views/pages/setting.blade.php @@ -26,18 +26,26 @@