Nkeditor.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. namespace addons\nkeditor;
  3. use app\common\library\Menu;
  4. use think\Addons;
  5. /**
  6. * 富文本编辑器插件
  7. */
  8. class Nkeditor extends Addons
  9. {
  10. /**
  11. * 插件安装方法
  12. * @return bool
  13. */
  14. public function install()
  15. {
  16. return true;
  17. }
  18. /**
  19. * 插件卸载方法
  20. * @return bool
  21. */
  22. public function uninstall()
  23. {
  24. return true;
  25. }
  26. /**
  27. * 插件启用方法
  28. * @return bool
  29. */
  30. public function enable()
  31. {
  32. return true;
  33. }
  34. /**
  35. * 插件禁用方法
  36. * @return bool
  37. */
  38. public function disable()
  39. {
  40. return true;
  41. }
  42. /**
  43. * @param $params
  44. */
  45. public function configInit(&$params)
  46. {
  47. $config = $this->getConfig();
  48. $params['nkeditor'] = [
  49. 'theme' => $config['theme'],
  50. 'fullmode' => !!($config['fullmode'] ?? '1'),
  51. 'classname' => $config['classname'] ?? '.editor',
  52. 'formulapreviewurl' => $config['formulapreviewurl'] ?? '',
  53. 'baidumapkey' => $config['baidumapkey'] ?? '',
  54. 'baidumapcenter' => $config['baidumapcenter'] ?? ''
  55. ];
  56. }
  57. }