EditablePage.php 26 KB

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