ModelConfigEditorAddon.class.php 992 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace Addons\ModelConfigEditor;
  3. use Common\Controller\Addon;
  4. /**
  5. * 模型配置器插件
  6. * @author yangweijie
  7. */
  8. class ModelConfigEditorAddon extends Addon
  9. {
  10. public $info = array(
  11. 'name' => 'ModelConfigEditor',
  12. 'title' => '模型配置器',
  13. 'description' => '用于编辑已有模块的配置',
  14. 'status' => 1,
  15. 'author' => 'yangweijie',
  16. 'version' => '0.3',
  17. );
  18. public function install()
  19. {
  20. return true;
  21. }
  22. public function uninstall()
  23. {
  24. return true;
  25. }
  26. //实现的app_begin钩子方法
  27. public function AdminIndex($param)
  28. {
  29. $module_object = D('Admin/Module');
  30. $data_list = $module_object->getAll();
  31. $addon = D('Admin/Addon')->where("name='{$this->getName()}'")->getField('id');
  32. $this->assign('addon_id', $addon);
  33. $this->assign('list', $data_list);
  34. $this->display('widget');
  35. }
  36. }