123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- <?php
- namespace addons\customcharts;
- use app\common\library\Menu;
- use think\Addons;
- use think\Db;
- use app\common\library\Auth;
- use think\Config;
- use think\Loader;
- use think\Request;
- /**
- * 插件
- */
- class Customcharts extends Addons
- {
- /**
- * 插件安装方法
- * @return bool
- */
- public function install()
- {
- $menu = [
- [
- 'name' => 'customcharts',
- 'title' => 'DIY图表统计工具',
- 'icon' => 'fa fa-bar-chart',
- 'sublist' => [
- [
- 'name' => 'customcharts/totalnumber',
- 'title' => '数量统计管理',
- 'icon' => 'fa fa-circle-o',
- 'sublist' => [
- ['name' => 'customcharts/totalnumber/index', 'title' => '查看'],
- ['name' => 'customcharts/totalnumber/add', 'title' => '添加'],
- ['name' => 'customcharts/totalnumber/edit', 'title' => '编辑'],
- ['name' => 'customcharts/totalnumber/del', 'title' => '删除'],
- ]
- ],
- [
- 'name' => 'customcharts/chart',
- 'title' => '图表统计管理',
- 'icon' => 'fa fa-circle-o',
- 'sublist' => [
- ['name' => 'customcharts/chart/index', 'title' => '查看'],
- ['name' => 'customcharts/chart/add', 'title' => '添加'],
- ['name' => 'customcharts/chart/edit', 'title' => '编辑'],
- ['name' => 'customcharts/chart/del', 'title' => '删除'],
- ]
- ],
- [
- 'name' => 'customcharts/ranking',
- 'title' => '排行统计管理',
- 'icon' => 'fa fa-circle-o',
- 'sublist' => [
- ['name' => 'customcharts/ranking/index', 'title' => '查看'],
- ['name' => 'customcharts/ranking/add', 'title' => '添加'],
- ['name' => 'customcharts/ranking/edit', 'title' => '编辑'],
- ['name' => 'customcharts/ranking/del', 'title' => '删除'],
- ]
- ],
- [
- 'name' => 'customcharts/show',
- 'title' => '统计控制台',
- 'icon' => 'fa fa-circle-o',
- 'sublist' => [
- ['name' => 'customcharts/show/index', 'title' => '查看'],
- ]
- ]
- ]
- ]
- ];
- Menu::create($menu);
- }
- /**
- * 插件卸载方法
- * @return bool
- */
- public function uninstall()
- {
- Menu::delete('customcharts');
- return true;
- }
- /**
- * 插件启用方法
- */
- public function enable()
- {
- Menu::enable('customcharts');
- }
- /**
- * 插件禁用方法
- */
- public function disable()
- {
- Menu::disable('customcharts');
- }
- }
|