info.php 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. <?php
  2. # 显示的页面
  3. /*
  4. $curPage = Dever::input('search_option_page_id');
  5. $page = function()
  6. {
  7. $parent = Dever::db('push/page')->getParent();
  8. $child = Dever::db('push/page')->getChild();
  9. foreach ($parent as $k => $v) {
  10. $parent[$k]['child'] = $child[$v['id']];
  11. }
  12. $array = array(-1 => array('id' => -1, 'name' => '无'));
  13. if ($parent) {
  14. $array += $parent;
  15. }
  16. return $array;
  17. };
  18. */
  19. $type = array
  20. (
  21. 1 => '手动输入',
  22. /*
  23. 2 => '调取其他推送位',
  24. 3 => '预定义方法',
  25. 4 => '自定义方法',
  26. 5 => '自定义SQL',
  27. 6 => '自定义接口',
  28. */
  29. );
  30. //$define = Dever::config('base')->module;
  31. $function = Dever::config('base')->type;
  32. $function[10] = '链接';
  33. $col = array
  34. (
  35. 1 => '标题',
  36. //2 => '链接',
  37. 3 => '图片',
  38. //4 => '描述',
  39. 5 => '分享图片',
  40. );
  41. return array
  42. (
  43. # 表名
  44. 'name' => 'info',
  45. # 显示给用户看的名称
  46. 'lang' => '推送位管理',
  47. 'order' => 10,
  48. 'check' => 'key',
  49. # 数据结构
  50. 'struct' => array
  51. (
  52. 'id' => array
  53. (
  54. 'type' => 'int-11',
  55. 'name' => '推送位ID',
  56. 'default' => '',
  57. 'desc' => '',
  58. 'match' => 'is_numeric',
  59. //'search' => 'order',
  60. 'order' => 'desc',
  61. //'list' => true,
  62. ),
  63. 'name' => array
  64. (
  65. 'type' => 'varchar-60',
  66. 'name' => '推送位标题',
  67. 'default' => '',
  68. 'desc' => '请输入推送位标题',
  69. 'match' => 'is_string',
  70. 'update' => 'text',
  71. 'search' => 'fulltext',
  72. 'list' => true,
  73. 'edit' => true,
  74. ),
  75. 'key' => array
  76. (
  77. 'type' => 'varchar-60',
  78. 'name' => '推送位标识',
  79. 'default' => '',
  80. 'desc' => '推送位标识',
  81. 'match' => 'is_string',
  82. 'update' => Dever::input('where_id') ? 'hidden' : 'text',
  83. 'search' => 'fulltext',
  84. 'list' => true,
  85. //'auth' => '!{key}'
  86. ),
  87. 'num' => array
  88. (
  89. 'type' => 'int-11',
  90. 'name' => '数据显示条数-为空或小于0则取默认值20,只对前台有效,当有分页时,则为每页显示的条数',
  91. 'default' => '20',
  92. 'desc' => '数据显示条数',
  93. 'match' => 'is_numeric',
  94. 'update' => 'text',
  95. 'list' => true,
  96. 'edit' => true,
  97. ),
  98. 'type' => array
  99. (
  100. 'type' => 'tinyint-1',
  101. 'name' => '推送位类型',
  102. 'default' => '1',
  103. 'desc' => '请选择推送位类型',
  104. 'match' => 'is_numeric',
  105. 'option' => $type,
  106. 'update' => 'radio',
  107. 'search' => 'select',
  108. //'list' => true,
  109. 'control' => 'type',
  110. ),
  111. /*
  112. 'data_type' => array
  113. (
  114. 'type' => 'varchar-50',
  115. 'name' => '数据类型定义-多个用换行隔开,必须有一个值,主要用于该推送位有多种不同类型的值',
  116. 'default' => '默认类型',
  117. 'desc' => '请选择推送位类型',
  118. 'match' => 'is_string',
  119. //'update' => 'textarea',
  120. //'show' => array('type_1'),
  121. ),
  122. 'code' => array
  123. (
  124. 'type' => 'varchar-500',
  125. 'name' => '自定义内容',
  126. 'default' => '',
  127. 'desc' => '请输入自定义内容',
  128. 'match' => 'is_string',
  129. 'update' => 'textarea',
  130. 'show' => 'type=4,5,6',
  131. ),
  132. 'sql_method' => array
  133. (
  134. 'type' => 'tinyint-1',
  135. 'name' => '选择sql执行之后的方法',
  136. 'default' => '1',
  137. 'desc' => '选择sql执行之后的方法',
  138. 'match' => 'is_numeric',
  139. 'update' => 'radio',
  140. 'option' => $sqlMethod,
  141. 'show' => 'type=5',
  142. ),
  143. 'define' => array
  144. (
  145. 'type' => 'varchar-100',
  146. 'name' => '选择预定义方法',
  147. 'default' => '',
  148. 'desc' => '请选择预定义方法',
  149. 'match' => 'is_string',
  150. 'update' => 'select',
  151. 'option' => $define,
  152. 'show' => 'type=3'
  153. ),
  154. */
  155. 'function' => array
  156. (
  157. 'type' => 'varchar-30',
  158. 'name' => '启用的功能',
  159. 'default' => '1,2,3,4,6,7,10',
  160. 'desc' => '启用的功能',
  161. 'match' => 'is_string',
  162. 'option' => $function,
  163. 'update' => 'checkbox',
  164. 'show' => 'type=1',
  165. ),
  166. 'col' => array
  167. (
  168. 'type' => 'varchar-30',
  169. 'name' => '启用的字段',
  170. 'default' => '1',
  171. 'desc' => '请选择启用的字段',
  172. 'match' => 'is_string',
  173. 'option' => $col,
  174. 'update' => 'checkbox',
  175. 'show' => 'type=1',
  176. 'control' => 'col',
  177. ),
  178. 'col_pic' => array
  179. (
  180. 'type' => 'varchar-20',
  181. 'name' => '图片尺寸提醒-请直接输入提醒的文字即可,如100X100',
  182. 'default' => '100X100',
  183. 'desc' => '图片尺寸提醒',
  184. 'match' => 'is_string',
  185. 'update' => 'text',
  186. 'show' => 'col=3',
  187. ),
  188. 'col_share_pic' => array
  189. (
  190. 'type' => 'varchar-20',
  191. 'name' => '分享图片尺寸提醒-请直接输入提醒的文字即可,如100X100',
  192. 'default' => '100X100',
  193. 'desc' => '分享图片尺寸提醒',
  194. 'match' => 'is_string',
  195. 'update' => 'text',
  196. 'show' => 'col=5',
  197. ),
  198. 'col_content' => array
  199. (
  200. 'type' => 'int-11',
  201. 'name' => '内容长度限制-必须是数字',
  202. 'default' => '30',
  203. 'desc' => '内容长度限制',
  204. 'match' => 'is_numeric',
  205. 'update' => 'text',
  206. 'show' => 'col=4',
  207. ),
  208. /*
  209. 'relate_id' => array
  210. (
  211. 'type' => 'int-11',
  212. 'name' => '请输入推送位id',
  213. 'default' => '',
  214. 'desc' => '请输入推送位id',
  215. 'match' => 'is_numeric',
  216. 'update' => 'text',
  217. 'show' => 'type=2',
  218. ),
  219. 'preview' => array
  220. (
  221. 'type' => 'varchar-200',
  222. 'name' => '推送位预览地址',
  223. 'default' => '',
  224. 'desc' => '推送位预览地址',
  225. 'match' => 'option',
  226. 'update' => 'text',
  227. ),
  228. 'preview_height' => array
  229. (
  230. 'type' => 'int-11',
  231. 'name' => '推送位预览的高度',
  232. 'default' => '500',
  233. 'desc' => '推送位预览的高度',
  234. 'match' => 'option',
  235. 'update' => 'text',
  236. ),
  237. */
  238. 'reorder' => array
  239. (
  240. 'type' => 'int-11',
  241. 'name' => '排序(数值越大越靠前)',
  242. 'default' => '1',
  243. 'desc' => '请输入排序',
  244. 'match' => 'option',
  245. 'update' => 'text',
  246. 'search' => 'order',
  247. 'list_name' => '排序',
  248. 'list' => true,
  249. 'order' => 'desc',
  250. //'edit' => true,
  251. ),
  252. 'state' => array
  253. (
  254. 'type' => 'tinyint-1',
  255. 'name' => '状态',
  256. 'default' => '1',
  257. 'desc' => '请选择状态',
  258. 'match' => 'is_numeric',
  259. ),
  260. 'cdate' => array
  261. (
  262. 'type' => 'int-11',
  263. 'name' => '录入时间',
  264. 'match' => array('is_numeric', time()),
  265. 'desc' => '',
  266. # 只有insert时才生效
  267. 'insert' => true,
  268. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  269. ),
  270. ),
  271. # 权限精细控制 加入到该项目的详细权限中,注意与top的不同
  272. /*
  273. 'auth' => array
  274. (
  275. # 数据来源
  276. 'data' => 'all',
  277. # 所属项目
  278. 'project' => 'module',
  279. # 项目名称
  280. 'project_name' => '推送位管理',
  281. ),
  282. */
  283. 'manage' => array
  284. (
  285. 'delete' => false,
  286. //'edit' => false,
  287. //'insert' => $curPage ? true : false,
  288. 'list_button' => array
  289. (
  290. 'add' => array('新增数据', '"data&search_option_info_id={id}&oper_parent=info"', '{type} == 1'),
  291. 'list' => array('数据列表', '"data&search_option_info_id={id}&oper_parent=info"'),
  292. ),
  293. ),
  294. # request 请求接口定义
  295. 'request' => array
  296. (
  297. # 获取列表页
  298. 'getAll' => array
  299. (
  300. # 匹配的正则或函数 选填项
  301. 'option' => array
  302. (
  303. 'type' => 'yes',
  304. //'page_id' => 'yes',
  305. 'state' => 1,
  306. ),
  307. 'type' => 'all',
  308. 'order' => array('reorder' => 'desc'),
  309. 'col' => '*',
  310. ),
  311. ),
  312. );