123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- <?php
- namespace addons\example;
- use app\common\library\Menu;
- use think\Addons;
- /**
- * Example
- */
- class Example extends Addons
- {
- /**
- * 插件安装方法
- * @return bool
- */
- public function install()
- {
- $menu = [
- [
- 'name' => 'example',
- 'title' => '开发示例管理',
- 'icon' => 'fa fa-magic',
- 'sublist' => [
- [
- 'name' => 'example/bootstraptable',
- 'title' => '表格完整示例',
- 'icon' => 'fa fa-table',
- 'sublist' => [
- ['name' => 'example/bootstraptable/index', 'title' => '查看'],
- ['name' => 'example/bootstraptable/detail', 'title' => '详情'],
- ['name' => 'example/bootstraptable/change', 'title' => '变更'],
- ['name' => 'example/bootstraptable/del', 'title' => '删除'],
- ['name' => 'example/bootstraptable/multi', 'title' => '批量更新'],
- ]
- ],
- [
- 'name' => 'example/customsearch',
- 'title' => '自定义搜索',
- 'icon' => 'fa fa-table',
- 'sublist' => [
- ['name' => 'example/customsearch/index', 'title' => '查看'],
- ['name' => 'example/customsearch/del', 'title' => '删除'],
- ['name' => 'example/customsearch/multi', 'title' => '批量更新'],
- ]
- ],
- [
- 'name' => 'example/customform',
- 'title' => '自定义表单示例',
- 'icon' => 'fa fa-edit',
- 'sublist' => [
- ['name' => 'example/customform/index', 'title' => '查看'],
- ]
- ],
- [
- 'name' => 'example/tablelink',
- 'title' => '表格联动示例',
- 'icon' => 'fa fa-table',
- 'remark' => '点击左侧日志列表,右侧的表格数据会显示指定管理员的日志列表',
- 'sublist' => [
- ['name' => 'example/tablelink/index', 'title' => '查看'],
- ]
- ],
- [
- 'name' => 'example/colorbadge',
- 'title' => '彩色角标',
- 'icon' => 'fa fa-table',
- 'remark' => '左侧彩色的角标会根据当前数据量的大小进行更新',
- 'sublist' => [
- ['name' => 'example/colorbadge/index', 'title' => '查看'],
- ['name' => 'example/colorbadge/del', 'title' => '删除'],
- ['name' => 'example/colorbadge/multi', 'title' => '批量更新'],
- ]
- ],
- [
- 'name' => 'example/controllerjump',
- 'title' => '控制器间跳转',
- 'icon' => 'fa fa-table',
- 'remark' => '点击IP地址可以跳转到新的选项卡中查看指定IP的数据',
- 'sublist' => [
- ['name' => 'example/controllerjump/index', 'title' => '查看'],
- ['name' => 'example/controllerjump/del', 'title' => '删除'],
- ['name' => 'example/controllerjump/multi', 'title' => '批量更新'],
- ]
- ],
- [
- 'name' => 'example/cxselect',
- 'title' => '多级联动',
- 'icon' => 'fa fa-table',
- 'remark' => '基于jquery.cxselect实现的多级联动',
- 'sublist' => [
- ['name' => 'example/cxselect/index', 'title' => '查看'],
- ['name' => 'example/cxselect/del', 'title' => '删除'],
- ['name' => 'example/cxselect/multi', 'title' => '批量更新'],
- ]
- ],
- [
- 'name' => 'example/multitable',
- 'title' => '多表格示例',
- 'icon' => 'fa fa-table',
- 'remark' => '展示在一个页面显示多个Bootstrap-table表格',
- 'sublist' => [
- ['name' => 'example/multitable/index', 'title' => '查看'],
- ['name' => 'example/multitable/del', 'title' => '删除'],
- ['name' => 'example/multitable/multi', 'title' => '批量更新'],
- ]
- ],
- [
- 'name' => 'example/relationmodel',
- 'title' => '关联模型示例',
- 'icon' => 'fa fa-table',
- 'remark' => '列表中的头像、用户名和昵称字段均从关联表中取出',
- 'sublist' => [
- ['name' => 'example/relationmodel/index', 'title' => '查看'],
- ['name' => 'example/relationmodel/del', 'title' => '删除'],
- ['name' => 'example/relationmodel/multi', 'title' => '批量更新'],
- ]
- ],
- [
- 'name' => 'example/tabletemplate',
- 'title' => '表格模板示例',
- 'icon' => 'fa fa-table',
- 'remark' => '',
- 'sublist' => [
- ['name' => 'example/tabletemplate/index', 'title' => '查看'],
- ['name' => 'example/tabletemplate/detail', 'title' => '详情'],
- ['name' => 'example/tabletemplate/del', 'title' => '删除'],
- ['name' => 'example/tabletemplate/multi', 'title' => '批量更新'],
- ]
- ],
- [
- 'name' => 'example/baidumap',
- 'title' => '百度地图示例',
- 'icon' => 'fa fa-map-pin',
- 'sublist' => [
- ['name' => 'example/baidumap/index', 'title' => '查看'],
- ['name' => 'example/baidumap/map', 'title' => '详情'],
- ['name' => 'example/baidumap/del', 'title' => '删除'],
- ]
- ],
- [
- 'name' => 'example/echarts',
- 'title' => '统计图表示例',
- 'icon' => 'fa fa-bar-chart',
- 'sublist' => [
- ['name' => 'example/echarts/index', 'title' => '查看'],
- ]
- ],
- ]
- ]
- ];
- Menu::create($menu);
- return true;
- }
- /**
- * 插件卸载方法
- * @return bool
- */
- public function uninstall()
- {
- Menu::delete('example');
- return true;
- }
- /**
- * 插件启用方法
- */
- public function enable()
- {
- Menu::enable('example');
- }
- /**
- * 插件禁用方法
- */
- public function disable()
- {
- Menu::disable('example');
- }
- }
|