EditablePage.php 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578
  1. <?php
  2. namespace app\admin\controller;
  3. use think\facade\View;
  4. use think\facade\Lang;
  5. use think\facade\Db;
  6. /**
  7. *
  8. *
  9. * ----------------------------------------------------------------------------
  10. *
  11. * 控制器
  12. */
  13. class EditablePage extends AdminControl
  14. {
  15. var $type = 'pc';
  16. var $model_dir = 'home@default/base/editable_page_model/';
  17. public function initialize()
  18. {
  19. parent::initialize();
  20. Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/editable_page.lang.php');
  21. Lang::load(base_path() . 'home/lang/' . config('lang.default_lang') . '.php');
  22. }
  23. /**
  24. * 页面列表
  25. */
  26. public function page_list($type = 'pc')
  27. {
  28. $this->type = $type;
  29. $keyword = input('param.editable_page_name');
  30. $condition = array();
  31. if ($keyword) {
  32. $condition[] = array('editable_page_name', 'like', '%' . $keyword . '%');
  33. }
  34. View::assign('filtered', empty($condition) ? 0 : 1);
  35. if (!in_array($type, array('pc', 'h5'))) {
  36. $type = 'pc';
  37. }
  38. $editable_page_model = model('editable_page');
  39. $condition = array_merge(array(array('store_id', '=', 0), array('editable_page_client', '=', $type)), $condition);
  40. $editable_page_list = $editable_page_model->getEditablePageList($condition, 10);
  41. foreach ($editable_page_list as $key => $val) {
  42. if ($val['editable_page_client'] == 'pc') {
  43. $editable_page_list[$key]['edit_url'] = (string)url('admin/editable_page/page_setting', ['editable_page_id' => $val['editable_page_id']]);
  44. $editable_page_list[$key]['view_url'] = (string)url('home/special/index', ['special_id' => $val['editable_page_id']]);
  45. } else {
  46. $editable_page_list[$key]['edit_url'] = (string)url('EditablePage/mobile_page_setting', array('editable_page_id' => $val['editable_page_id']));
  47. $editable_page_list[$key]['view_url'] = config('ds_config.h5_site_url') . '/' . 'pages/home/special/Index' . '?' . http_build_query(['special_id' => $val['editable_page_id']]);
  48. }
  49. }
  50. View::assign('show_page', $editable_page_model->page_info->render());
  51. View::assign('editable_page_list', $editable_page_list);
  52. View::assign('type', $type);
  53. $this->setAdminCurItem($type . '_page_list');
  54. return View::fetch('page_list');
  55. }
  56. public function h5_page_list()
  57. {
  58. return $this->page_list('h5');
  59. }
  60. /**
  61. * 新增页面
  62. */
  63. public function page_add()
  64. {
  65. $editable_page_path = input('param.editable_page_path');
  66. $editable_page_item_id = intval(input('param.editable_page_item_id'));
  67. $editable_page_model = model('editable_page');
  68. if (!request()->isPost()) {
  69. return View::fetch('page_form');
  70. } else {
  71. $data = array(
  72. 'editable_page_name' => input('post.editable_page_name'),
  73. 'editable_page_path' => $editable_page_path,
  74. 'editable_page_item_id' => $editable_page_item_id,
  75. 'editable_page_client' => input('param.type', 'pc'),
  76. 'editable_page_theme' => 'style_1',
  77. 'editable_page_edit_time' => TIMESTAMP,
  78. 'editable_page_theme_config' => json_encode(array(
  79. 'back_color' => input('param.back_color')
  80. ))
  81. );
  82. $result = $editable_page_model->addEditablePage($data);
  83. $condition = array();
  84. $condition[] = array('store_id', '=', 0);
  85. $condition[] = array('editable_page_id', '<>', $result);
  86. $condition[] = array('editable_page_path', '=', $data['editable_page_path']);
  87. $condition[] = array('editable_page_client', '=', $data['editable_page_client']);
  88. if (!in_array($data['editable_page_path'], array('index/index'))) {
  89. $condition[] = array('editable_page_item_id', '=', $data['editable_page_item_id']);
  90. }
  91. $editable_page_model->editEditablePage($condition, array('editable_page_path' => '', 'editable_page_item_id' => 0));
  92. if ($result) {
  93. $this->log(lang('ds_add') . ($data['editable_page_client'] == 'h5' ? lang('editable_page_h5') : lang('editable_page_pc')) . '[flex_' . $result . ':' . input('post.editable_page_name') . ']', null);
  94. dsLayerOpenSuccess(lang('ds_common_op_succ'));
  95. } else {
  96. $this->error(lang('ds_common_op_fail'));
  97. }
  98. }
  99. }
  100. public function page_setting()
  101. {
  102. $editable_page_id = intval(input('param.editable_page_id'));
  103. $editable_page_model = model('editable_page');
  104. $editable_page_info = $editable_page_model->getOneEditablePage(array('editable_page_id' => $editable_page_id));
  105. if (!$editable_page_info) {
  106. $this->error(lang('param_error'));
  107. }
  108. $editable_page_info['editable_page_theme_config'] = json_decode($editable_page_info['editable_page_theme_config'], true);
  109. View::assign('editable_page', $editable_page_info);
  110. $editable_page_config_model = model('editable_page_config');
  111. $editable_page_config_list = $editable_page_config_model->getEditablePageConfigList(array(array('editable_page_id', '=', $editable_page_id)));
  112. $config_list = array();
  113. foreach ($editable_page_config_list as $key => $val) {
  114. $config_info = json_decode($val['editable_page_config_content'], true);
  115. $model_id = $val['editable_page_model_id'];
  116. $var_html = array();
  117. $var_config = array();
  118. if (!empty($config_info)) {
  119. require_once PLUGINS_PATH . '/editable_page_model/' . $model_id . '/config.php';
  120. $model_name = 'Model' . $model_id;
  121. $model = new $model_name();
  122. $res = $model->filterData($config_info);
  123. if ($res['code']) {
  124. $var_config['config_info'] = $res['data'];
  125. $res = $model->formatData(json_encode($res['data']));
  126. if ($res['code']) {
  127. $var_html['config_info'] = $res['data'];
  128. }
  129. }
  130. }
  131. $html = View::fetch('../../../plugins/editable_page_model/' . $model_id . '/index', $var_html);
  132. $config = View::fetch('../../../plugins/editable_page_model/' . $model_id . '/config', $var_config);
  133. $config_list[] = array(
  134. 'val' => $val,
  135. 'html' => $html,
  136. 'config' => $config
  137. );
  138. }
  139. View::assign('config_list', $config_list);
  140. return View::fetch('page_setting');
  141. }
  142. /**
  143. * 设置手机端页面
  144. */
  145. public function mobile_page_setting()
  146. {
  147. $this->type = 'h5';
  148. $editable_page_id = intval(input('param.editable_page_id'));
  149. $editable_page_model = model('editable_page');
  150. $editable_page_info = $editable_page_model->getOneEditablePage(array('editable_page_id' => $editable_page_id));
  151. if (!$editable_page_info) {
  152. $this->error(lang('param_error'));
  153. }
  154. $editable_page_info['editable_page_theme_config'] = json_decode($editable_page_info['editable_page_theme_config'], true);
  155. View::assign('editable_page', $editable_page_info);
  156. $editable_page_config_model = model('editable_page_config');
  157. $editable_page_config_list = $editable_page_config_model->getEditablePageConfigList(array(array('editable_page_id', '=', $editable_page_id)));
  158. $config_list = array();
  159. foreach ($editable_page_config_list as $key => $val) {
  160. $config_info = json_decode($val['editable_page_config_content'], true);
  161. $model_id = $val['editable_page_model_id'];
  162. $var_html = array();
  163. $var_config = array();
  164. if (!empty($config_info)) {
  165. require_once PLUGINS_PATH . '/editable_page_model/h5_' . $model_id . '/config.php';
  166. $model_name = 'Model' . $model_id;
  167. $model = new $model_name();
  168. $res = $model->filterData($config_info);
  169. if ($res['code']) {
  170. $var_config['config_info'] = $res['data'];
  171. $res = $model->formatData(json_encode($res['data']));
  172. if ($res['code']) {
  173. $var_html['config_info'] = $res['data'];
  174. }
  175. }
  176. }
  177. $html = View::fetch('../../../plugins/editable_page_model/h5_' . $model_id . '/index', $var_html);
  178. $config = View::fetch('../../../plugins/editable_page_model/h5_' . $model_id . '/config', $var_config);
  179. $config_list[] = array(
  180. 'val' => $val,
  181. 'html' => $html,
  182. 'config' => $config
  183. );
  184. }
  185. View::assign('config_list', $config_list);
  186. $this->setAdminCurItem('mobile_page_setting');
  187. return View::fetch('mobile_page_setting');
  188. }
  189. /**
  190. * 编辑页面
  191. */
  192. public function page_edit()
  193. {
  194. $editable_page_id = intval(input('param.editable_page_id'));
  195. $editable_page_model = model('editable_page');
  196. $editable_page_info = $editable_page_model->getOneEditablePage(array('editable_page_id' => $editable_page_id));
  197. if (!$editable_page_info) {
  198. $this->error(lang('param_error'));
  199. }
  200. $editable_page_info['editable_page_theme_config'] = json_decode($editable_page_info['editable_page_theme_config'], true);
  201. if (!request()->isPost()) {
  202. View::assign('editable_page', $editable_page_info);
  203. return View::fetch('page_form');
  204. } else {
  205. $data = array(
  206. 'editable_page_path' => input('post.editable_page_path'),
  207. 'editable_page_item_id' => intval(input('post.editable_page_item_id')),
  208. 'editable_page_name' => input('post.editable_page_name'),
  209. 'editable_page_theme_config' => json_encode(array(
  210. 'back_color' => input('param.back_color')
  211. ))
  212. );
  213. $result = $editable_page_model->editEditablePage(array('editable_page_id' => $editable_page_id), $data);
  214. $condition = array();
  215. $condition[] = array('store_id', '=', 0);
  216. $condition[] = array('editable_page_id', '<>', $editable_page_id);
  217. $condition[] = array('editable_page_path', '=', $data['editable_page_path']);
  218. $condition[] = array('editable_page_client', '=', $editable_page_info['editable_page_client']);
  219. if (!in_array($data['editable_page_path'], array('index/index'))) {
  220. $condition[] = array('editable_page_item_id', '=', $data['editable_page_item_id']);
  221. }
  222. $editable_page_model->editEditablePage($condition, array('editable_page_path' => '', 'editable_page_item_id' => 0));
  223. if ($result) {
  224. $this->log(lang('ds_edit') . ($editable_page_info['editable_page_client'] == 'h5' ? lang('editable_page_h5') : lang('editable_page_pc')) . '[' . $editable_page_info['editable_page_name'] . ']', null);
  225. dsLayerOpenSuccess(lang('ds_common_op_succ'));
  226. } else {
  227. $this->error(lang('ds_common_op_fail'));
  228. }
  229. }
  230. }
  231. /**
  232. * 删除页面
  233. */
  234. public function page_del()
  235. {
  236. $editable_page_id = intval(input('param.editable_page_id'));
  237. $editable_page_model = model('editable_page');
  238. $editable_page_info = $editable_page_model->getOneEditablePage(array('editable_page_id' => $editable_page_id));
  239. if (!$editable_page_info) {
  240. ds_json_encode(10001, lang('param_error'));
  241. }
  242. if (!$editable_page_model->delEditablePage($editable_page_id)) {
  243. ds_json_encode(10001, lang('ds_common_op_fail'));
  244. }
  245. $this->log(lang('ds_del') . ($editable_page_info['editable_page_client'] == 'h5' ? lang('editable_page_h5') : lang('editable_page_pc')) . '[ID:' . $editable_page_info['editable_page_id'] . ':' . $editable_page_info['editable_page_name'] . ']', null);
  246. ds_json_encode(10000, lang('ds_common_del_succ'));
  247. }
  248. /**
  249. * 搜索商品
  250. */
  251. public function search_goods()
  252. {
  253. $goods_model = model('goods');
  254. /**
  255. * 查询条件
  256. */
  257. $where = array();
  258. $search_goods_name = trim(input('param.keyword'));
  259. $type = trim(input('param.type'));
  260. if ($search_goods_name != '') {
  261. $where[] = array('goods_name|store_name', 'like', '%' . $search_goods_name . '%');
  262. }
  263. switch ($type) {
  264. case 'bargain':
  265. $condition = array();
  266. $condition[] = array('bargain_state', '=', \app\common\model\Pbargain::PINTUAN_STATE_NORMAL);
  267. $condition[] = array('bargain_endtime', '>', TIMESTAMP);
  268. $condition[] = array('bargain_begintime', '<', TIMESTAMP);
  269. $subQuery = Db::name('pbargain')->field('bargain_goods_id')->where($condition)->buildSql();
  270. $where[] = array('goods_id', 'exp', Db::raw('in ' . $subQuery));
  271. break;
  272. case 'groupbuy':
  273. $condition = array();
  274. $condition[] = array('groupbuy_state', '=', \app\common\model\Groupbuy::GROUPBUY_STATE_NORMAL);
  275. $condition[] = array('groupbuy_endtime', '>', TIMESTAMP);
  276. $condition[] = array('groupbuy_starttime', '<', TIMESTAMP);
  277. $subQuery = Db::name('groupbuy')->field('goods_commonid')->where($condition)->buildSql();
  278. $where[] = array('goods_commonid', 'exp', Db::raw('in ' . $subQuery));
  279. break;
  280. case 'pintuan':
  281. $condition = array();
  282. $condition[] = array('pintuan_state', '=', \app\common\model\Ppintuan::PINTUAN_STATE_NORMAL);
  283. $condition[] = array('pintuan_end_time', '>', TIMESTAMP);
  284. $condition[] = array('pintuan_starttime', '<', TIMESTAMP);
  285. $subQuery = Db::name('ppintuan')->field('pintuan_goods_commonid')->where($condition)->buildSql();
  286. $where[] = array('goods_commonid', 'exp', Db::raw('in ' . $subQuery));
  287. break;
  288. case 'presell':
  289. $condition = array();
  290. $condition[] = array('presell_state', '=', \app\common\model\Presell::PRESELL_STATE_NORMAL);
  291. $condition[] = array('presell_end_time', '>', TIMESTAMP);
  292. $condition[] = array('presell_start_time', '<', TIMESTAMP);
  293. $subQuery = Db::name('presell')->field('goods_id')->where($condition)->buildSql();
  294. $where[] = array('goods_id', 'exp', Db::raw('in ' . $subQuery));
  295. break;
  296. case 'xianshi':
  297. $condition = array();
  298. $condition[] = array('xianshigoods_state', '=', \app\common\model\Pxianshigoods::XIANSHI_GOODS_STATE_NORMAL);
  299. $condition[] = array('xianshigoods_end_time', '>', TIMESTAMP);
  300. $condition[] = array('xianshigoods_starttime', '<', TIMESTAMP);
  301. $subQuery = Db::name('pxianshigoods')->field('goods_id')->where($condition)->buildSql();
  302. $where[] = array('goods_id', 'exp', Db::raw('in ' . $subQuery));
  303. break;
  304. }
  305. $goods_list = $goods_model->getGoodsOnlineList($where, '*', 12);
  306. View::assign('goods_list', $goods_list);
  307. View::assign('show_page', $goods_model->page_info->render());
  308. $goods_id = input('param.goods_id/a');
  309. if (!empty($goods_id)) {
  310. $where = array();
  311. $where[] = array('goods_id', 'in', array_keys($goods_id));
  312. $goods_list = $goods_model->getGoodsOnlineList($where);
  313. $selected_goods = array();
  314. foreach ($goods_list as $v) {
  315. $selected_goods[$v['goods_id']] = array_merge($v, array('sort' => $goods_id[$v['goods_id']]['sort']));
  316. }
  317. View::assign('goods_id', $selected_goods);
  318. }
  319. echo View::fetch('search_goods');
  320. exit;
  321. }
  322. /**
  323. * 搜索品牌
  324. */
  325. public function search_brand()
  326. {
  327. $brand_model = model('brand');
  328. /**
  329. * 查询条件
  330. */
  331. $where = array();
  332. $where[] = array('brand_apply', '=', 1);
  333. $search_brand_name = trim(input('param.keyword'));
  334. if ($search_brand_name != '') {
  335. $where[] = array('brand_name', 'like', '%' . $search_brand_name . '%');
  336. }
  337. $brand_list = $brand_model->getBrandList($where, '*', 12);
  338. View::assign('brand_list', $brand_list);
  339. View::assign('show_page', $brand_model->page_info->render());
  340. $brand_id = input('param.brand_id/a');
  341. if (!empty($brand_id)) {
  342. $where = array();
  343. $where[] = array('brand_id', 'in', array_keys($brand_id));
  344. $brand_list = $brand_model->getBrandList($where);
  345. $selected_brand = array();
  346. foreach ($brand_list as $v) {
  347. $selected_brand[$v['brand_id']] = array_merge($v, array('sort' => $brand_id[$v['brand_id']]['sort']));
  348. }
  349. View::assign('brand_id', $selected_brand);
  350. }
  351. echo View::fetch('search_brand');
  352. exit;
  353. }
  354. public function image_del()
  355. {
  356. $file_id = intval(input('param.upload_id'));
  357. $res = model('editable_page_model', 'logic')->imageDel($file_id);
  358. if (!$res['code']) {
  359. ds_json_encode(10001, $res['msg']);
  360. }
  361. ds_json_encode(10000);
  362. }
  363. /**
  364. * 图片上传
  365. */
  366. public function image_upload()
  367. {
  368. $res = model('editable_page_model', 'logic')->imageUpload(input('param.name'), input('param.config_id'));
  369. if (!$res['code']) {
  370. ds_json_encode(10001, $res['msg']);
  371. }
  372. $data = $res['data'];
  373. ds_json_encode(10000, '', $data);
  374. }
  375. public function goods_class()
  376. {
  377. $id = intval(input('param.id'));
  378. $parent_id = intval(input('param.parent_id'));
  379. $goodsclass_model = model('goodsclass');
  380. if ($id) {
  381. $data = array('id' => array(), 'list' => array());
  382. $goodsclass_info = $goodsclass_model->getGoodsclassInfoById($id);
  383. if ($goodsclass_info) {
  384. $data['id'][] = $goodsclass_info['gc_id'];
  385. $data['list'][] = $goodsclass_model->getGoodsclassListByParentId($goodsclass_info['gc_parent_id']);
  386. if ($goodsclass_info['gc_parent_id']) {
  387. $goodsclass_info = $goodsclass_model->getGoodsclassInfoById($goodsclass_info['gc_parent_id']);
  388. if ($goodsclass_info) {
  389. $data['id'][] = $goodsclass_info['gc_id'];
  390. $data['list'][] = $goodsclass_model->getGoodsclassListByParentId($goodsclass_info['gc_parent_id']);
  391. if ($goodsclass_info['gc_parent_id']) {
  392. $goodsclass_info = $goodsclass_model->getGoodsclassInfoById($goodsclass_info['gc_parent_id']);
  393. if ($goodsclass_info) {
  394. $data['id'][] = $goodsclass_info['gc_id'];
  395. $data['list'][] = $goodsclass_model->getGoodsclassListByParentId($goodsclass_info['gc_parent_id']);
  396. }
  397. }
  398. }
  399. }
  400. }
  401. $data['id'] = array_reverse($data['id']);
  402. $data['list'] = array_reverse($data['list']);
  403. } else {
  404. $data = $goodsclass_model->getGoodsclassListByParentId($parent_id);
  405. }
  406. ds_json_encode(10000, '', $data);
  407. }
  408. public function config_load()
  409. {
  410. $if_h5 = intval(input('param.if_h5'));
  411. $model_id = intval(input('param.model_id'));
  412. $config_info = input('param.config_info/a');
  413. if (!$model_id) {
  414. ds_json_encode(10001, lang('param_error'));
  415. }
  416. $var_html = array();
  417. $var_config = array();
  418. if (!empty($config_info)) {
  419. require_once PLUGINS_PATH . '/editable_page_model/' . ($if_h5 ? 'h5_' : '') . $model_id . '/config.php';
  420. $model_name = 'Model' . $model_id;
  421. $model = new $model_name();
  422. $res = $model->filterData($config_info);
  423. if ($res['code']) {
  424. $res = $model->formatData(json_encode($res['data']));
  425. if ($res['code']) {
  426. $var_html['config_info'] = $res['data'];
  427. } else {
  428. ds_json_encode(10001, $res['msg']);
  429. }
  430. } else {
  431. ds_json_encode(10001, $res['msg']);
  432. }
  433. }
  434. $html = View::fetch('../../../plugins/editable_page_model/' . ($if_h5 ? 'h5_' : '') . $model_id . '/index', $var_html);
  435. $config = View::fetch('../../../plugins/editable_page_model/' . ($if_h5 ? 'h5_' : '') . $model_id . '/config', $var_config);
  436. ds_json_encode(10000, '', array('html' => $html, 'config' => $config));
  437. }
  438. public function config_edit()
  439. {
  440. $if_h5 = intval(input('param.if_h5'));
  441. $config_list = input('param.config_list/a');
  442. $editable_page_id = intval(input('param.page_id'));
  443. $editable_page_model = model('editable_page');
  444. $editable_page_info = $editable_page_model->getOneEditablePage(array('editable_page_id' => $editable_page_id));
  445. if (!$editable_page_info) {
  446. ds_json_encode(10001, lang('param_error'));
  447. }
  448. try {
  449. $data = array();
  450. $new_data = array();
  451. $editable_page_theme_config = array();
  452. foreach ($config_list as $sort_order => $config_info) {
  453. $model_id = $config_info['model_id'];
  454. switch ($model_id) {
  455. case 'page':
  456. case 'jump':
  457. case 'button':
  458. if ($model_id == 'page') {
  459. $data['editable_page_name'] = $config_info['page_title'];
  460. }
  461. $editable_page_theme_config = array_merge($editable_page_theme_config, $config_info);
  462. break;
  463. default:
  464. require_once PLUGINS_PATH . '/editable_page_model/' . ($if_h5 ? 'h5_' : '') . $model_id . '/config.php';
  465. $model_name = 'Model' . $model_id;
  466. $model = new $model_name();
  467. $res = $model->filterData($config_info);
  468. if ($res['code']) {
  469. $new_data[] = array(
  470. 'editable_page_id' => $editable_page_id,
  471. 'editable_page_model_id' => $model_id,
  472. 'editable_page_config_sort_order' => $sort_order,
  473. 'editable_page_config_content' => json_encode($res['data'])
  474. );
  475. } else {
  476. throw new \think\Exception($res['msg'], 10006);
  477. }
  478. }
  479. }
  480. $data['editable_page_theme_config'] = json_encode($editable_page_theme_config);
  481. $data['editable_page_edit_time'] = TIMESTAMP;
  482. $editable_page_config_model = model('editable_page_config');
  483. $editable_page_config_model->delEditablePageConfig(array(array('editable_page_id', '=', $editable_page_id)));
  484. if (!empty($new_data)) {
  485. $editable_page_config_model->addEditablePageConfigAll($new_data);
  486. }
  487. $result = $editable_page_model->editEditablePage(array('editable_page_id' => $editable_page_id), $data);
  488. if (!$result) {
  489. throw new \think\Exception(lang('ds_common_op_fail'), 10006);
  490. }
  491. } catch (\Exception $e) {
  492. ds_json_encode(10001, $e->getMessage());
  493. }
  494. $this->log(lang('ds_edit') . ($editable_page_info['editable_page_client'] == 'h5' ? lang('editable_page_h5') : lang('editable_page_pc')) . '[' . $editable_page_info['editable_page_name'] . ']', null);
  495. ds_json_encode(10000, lang('ds_common_op_succ'));
  496. }
  497. /**
  498. * 菜单列表
  499. */
  500. protected function getAdminItemList()
  501. {
  502. if ($this->type == 'pc') {
  503. $menu_array = array(
  504. array(
  505. 'name' => 'pc_page_list',
  506. 'text' => lang('ds_list'),
  507. 'url' => (string)url('EditablePage/page_list'),
  508. ),
  509. array(
  510. 'name' => 'page_add',
  511. 'text' => lang('ds_new'),
  512. 'url' => "javascript:dsLayerOpen('" . (string)url('EditablePage/page_add') . "','" . lang('ds_new') . "')",
  513. ),
  514. );
  515. } else {
  516. $menu_array = array(
  517. array(
  518. 'name' => 'h5_page_list',
  519. 'text' => lang('ds_list'),
  520. 'url' => (string)url('EditablePage/page_list', array('type' => 'h5')),
  521. ),
  522. array(
  523. 'name' => 'page_add',
  524. 'text' => lang('ds_new'),
  525. 'url' => "javascript:dsLayerOpen('" . (string)url('EditablePage/page_add', array('type' => 'h5')) . "','" . lang('ds_new') . "')",
  526. ),
  527. );
  528. }
  529. return $menu_array;
  530. }
  531. }