Third.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. namespace addons\third;
  3. use app\common\library\Menu;
  4. use think\Addons;
  5. /**
  6. * 第三方登录
  7. */
  8. class Third extends Addons
  9. {
  10. /**
  11. * 插件安装方法
  12. * @return bool
  13. */
  14. public function install()
  15. {
  16. $menu = [
  17. [
  18. 'name' => 'third',
  19. 'title' => '第三方登录管理',
  20. 'icon' => 'fa fa-users',
  21. 'sublist' => [
  22. [
  23. "name" => "third/index",
  24. "title" => "查看"
  25. ],
  26. [
  27. "name" => "third/del",
  28. "title" => "删除"
  29. ]
  30. ]
  31. ]
  32. ];
  33. Menu::create($menu);
  34. return true;
  35. }
  36. /**
  37. * 插件卸载方法
  38. * @return bool
  39. */
  40. public function uninstall()
  41. {
  42. Menu::delete("third");
  43. return true;
  44. }
  45. /**
  46. * 插件启用方法
  47. * @return bool
  48. */
  49. public function enable()
  50. {
  51. Menu::enable("third");
  52. return true;
  53. }
  54. /**
  55. * 插件禁用方法
  56. * @return bool
  57. */
  58. public function disable()
  59. {
  60. Menu::disable("third");
  61. return true;
  62. }
  63. /**
  64. * @param $params
  65. */
  66. public function configInit(&$params)
  67. {
  68. $config = $this->getConfig();
  69. $params['third'] = ['status' => explode(',', $config['status'])];
  70. }
  71. }