Umeditor.php 821 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace app\common\extend\editor;
  3. class Umeditor {
  4. public $name = 'Umeditor';
  5. public $ver = '1.0';
  6. public function front($param)
  7. {
  8. if (isset($param['action']) && $param['action'] == 'config') {
  9. $UE_CONFIG = json_decode(preg_replace("/\/\*[\s\S]+?\*\//", "", file_get_contents('./static/ueditor/config.json')), true);
  10. echo json_encode($UE_CONFIG);
  11. exit;
  12. }
  13. }
  14. public function back($info='',$status=0,$data=[])
  15. {
  16. $arr=[];
  17. if ($status == 0) {
  18. $arr['message'] = $info;
  19. $arr['state'] = 'ERROR';
  20. } else {
  21. $arr['message'] = $info;
  22. $arr['url'] = $data['file'];
  23. $arr['state'] = 'SUCCESS';
  24. }
  25. echo json_encode($arr, 1);
  26. exit;
  27. }
  28. }