info.php 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <?php
  2. $func = function()
  3. {
  4. $array = array
  5. (
  6. -1 => array('id' => '-1', 'name' => '自定义',),
  7. );
  8. $info = Dever::db('push/func')->state();
  9. if($info)
  10. {
  11. $array += $info;
  12. }
  13. return $array;
  14. };
  15. $col = function()
  16. {
  17. $array = array
  18. (
  19. );
  20. $info = Dever::db('push/col')->state();
  21. if($info)
  22. {
  23. $array += $info;
  24. }
  25. return $array;
  26. };
  27. return array
  28. (
  29. # 表名
  30. 'name' => 'info',
  31. # 显示给用户看的名称
  32. 'lang' => '推送位管理',
  33. 'order' => 10,
  34. 'check' => 'key',
  35. 'func' => $func,
  36. # 数据结构
  37. 'struct' => array
  38. (
  39. 'id' => array
  40. (
  41. 'type' => 'int-11',
  42. 'name' => '推送位ID',
  43. 'default' => '',
  44. 'desc' => '',
  45. 'match' => 'is_numeric',
  46. //'search' => 'order',
  47. 'order' => 'desc',
  48. //'list' => true,
  49. ),
  50. 'name' => array
  51. (
  52. 'type' => 'varchar-60',
  53. 'name' => '推送位标题',
  54. 'default' => '',
  55. 'desc' => '请输入推送位标题',
  56. 'match' => 'is_string',
  57. 'update' => 'text',
  58. 'search' => 'fulltext',
  59. 'list' => true,
  60. 'edit' => true,
  61. ),
  62. 'key' => array
  63. (
  64. 'type' => 'varchar-60',
  65. 'name' => '推送位标识',
  66. 'default' => '',
  67. 'desc' => '推送位标识',
  68. 'match' => 'is_string',
  69. 'update' => Dever::input('where_id') ? 'hidden' : 'text',
  70. 'search' => 'fulltext',
  71. 'list' => true,
  72. ),
  73. 'num' => array
  74. (
  75. 'type' => 'int-11',
  76. 'name' => '数据显示条数-为空或小于0则取默认值10,只对前台有效,当有分页时,则为每页显示的条数',
  77. 'default' => '10',
  78. 'desc' => '数据显示条数',
  79. 'match' => 'is_numeric',
  80. 'update' => 'text',
  81. 'list' => true,
  82. 'edit' => true,
  83. ),
  84. 'func' => array
  85. (
  86. 'type' => 'varchar-300',
  87. 'name' => '功能类型',
  88. 'default' => '',
  89. 'desc' => '功能类型',
  90. 'match' => 'is_string',
  91. 'option' => $func,
  92. 'update' => 'checkbox',
  93. ),
  94. 'col' => array
  95. (
  96. 'type' => 'varchar-300',
  97. 'name' => '启用的字段',
  98. 'default' => '',
  99. 'desc' => '请选择启用的字段',
  100. 'match' => 'is_string',
  101. 'option' => $col,
  102. 'update' => 'checkbox',
  103. ),
  104. 'reorder' => array
  105. (
  106. 'type' => 'int-11',
  107. 'name' => '排序(数值越大越靠前)',
  108. 'default' => '1',
  109. 'desc' => '请输入排序',
  110. 'match' => 'option',
  111. 'update' => 'text',
  112. 'search' => 'order',
  113. 'list_name' => '排序',
  114. 'list' => true,
  115. 'order' => 'desc',
  116. 'edit' => true,
  117. ),
  118. 'state' => array
  119. (
  120. 'type' => 'tinyint-1',
  121. 'name' => '状态',
  122. 'default' => '1',
  123. 'desc' => '请选择状态',
  124. 'match' => 'is_numeric',
  125. ),
  126. 'cdate' => array
  127. (
  128. 'type' => 'int-11',
  129. 'name' => '录入时间',
  130. 'match' => array('is_numeric', time()),
  131. 'desc' => '',
  132. # 只有insert时才生效
  133. 'insert' => true,
  134. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  135. ),
  136. ),
  137. # 权限精细控制 加入到该项目的详细权限中,注意与top的不同
  138. /*
  139. 'auth' => array
  140. (
  141. # 数据来源
  142. 'data' => 'all',
  143. # 所属项目
  144. 'project' => 'module',
  145. # 项目名称
  146. 'project_name' => '推送位管理',
  147. ),
  148. */
  149. 'manage' => array
  150. (
  151. 'delete' => false,
  152. //'edit' => false,
  153. //'insert' => $curPage ? true : false,
  154. # 自定义快捷新增和编辑
  155. 'button' => array
  156. (
  157. //'新增兑换码' => array('fast', 1, 'config&where_id=1'),
  158. '字段配置' => array('list', 'col&project=push&oper_parent=info&oper_project=push'),
  159. '功能配置' => array('list', 'func&project=push&oper_parent=info&oper_project=push'),
  160. ),
  161. 'list_button' => array
  162. (
  163. 'add' => array('新增数据', '"data&search_option_info_id={id}&oper_parent=info"'),
  164. 'list' => array('数据列表', '"data&search_option_info_id={id}&oper_parent=info"'),
  165. ),
  166. ),
  167. # request 请求接口定义
  168. 'request' => array
  169. (
  170. # 获取列表页
  171. 'getAll' => array
  172. (
  173. # 匹配的正则或函数 选填项
  174. 'option' => array
  175. (
  176. 'type' => 'yes',
  177. //'page_id' => 'yes',
  178. 'state' => 1,
  179. ),
  180. 'type' => 'all',
  181. 'order' => array('reorder' => 'desc'),
  182. 'col' => '*',
  183. ),
  184. ),
  185. );