Equipment.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. namespace addons\equipment;
  3. use app\common\library\Menu;
  4. use think\Addons;
  5. /**
  6. * 插件
  7. */
  8. class Equipment extends Addons
  9. {
  10. /**
  11. * 插件安装方法
  12. * @return bool
  13. */
  14. public function install()
  15. {
  16. $menu = include ADDON_PATH . "equipment" . DS . 'config' . DS . "menu.php";
  17. $config_file = ADDON_PATH . "equipment" . DS . 'config' . DS . "menu.php";
  18. if (is_file($config_file)) {
  19. $menu = include $config_file;
  20. }
  21. if ($menu) {
  22. Menu::create($menu);
  23. }
  24. return true;
  25. }
  26. /**
  27. * 插件卸载方法
  28. * @return bool
  29. */
  30. public function uninstall()
  31. {
  32. Menu::delete("equipment");
  33. return true;
  34. }
  35. /**
  36. * 插件启用方法
  37. * @return bool
  38. */
  39. public function enable()
  40. {
  41. Menu::enable("equipment");
  42. return true;
  43. }
  44. /**
  45. * 插件禁用方法
  46. * @return bool
  47. */
  48. public function disable()
  49. {
  50. Menu::disable("equipment");
  51. return true;
  52. }
  53. }