EditablePage.php 26 KB

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