info.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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. 'col_pic' => array
  105. (
  106. 'type' => 'varchar-500',
  107. 'name' => '图片尺寸提醒-请直接输入提醒的文字即可,如100*100,如果有多个图片字段,请用换行隔开',
  108. 'default' => '',
  109. 'desc' => '图片尺寸提醒',
  110. 'match' => 'option',
  111. 'update' => 'textarea',
  112. ),
  113. 'reorder' => array
  114. (
  115. 'type' => 'int-11',
  116. 'name' => '排序(数值越大越靠前)',
  117. 'default' => '1',
  118. 'desc' => '请输入排序',
  119. 'match' => 'option',
  120. 'update' => 'text',
  121. 'search' => 'order',
  122. 'list_name' => '排序',
  123. 'list' => true,
  124. 'order' => 'desc',
  125. 'edit' => true,
  126. ),
  127. 'state' => array
  128. (
  129. 'type' => 'tinyint-1',
  130. 'name' => '状态',
  131. 'default' => '1',
  132. 'desc' => '请选择状态',
  133. 'match' => 'is_numeric',
  134. ),
  135. 'cdate' => array
  136. (
  137. 'type' => 'int-11',
  138. 'name' => '录入时间',
  139. 'match' => array('is_numeric', time()),
  140. 'desc' => '',
  141. # 只有insert时才生效
  142. 'insert' => true,
  143. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  144. ),
  145. ),
  146. # 权限精细控制 加入到该项目的详细权限中,注意与top的不同
  147. /*
  148. 'auth' => array
  149. (
  150. # 数据来源
  151. 'data' => 'all',
  152. # 所属项目
  153. 'project' => 'module',
  154. # 项目名称
  155. 'project_name' => '推送位管理',
  156. ),
  157. */
  158. 'manage' => array
  159. (
  160. 'delete' => false,
  161. //'edit' => false,
  162. //'insert' => $curPage ? true : false,
  163. # 自定义快捷新增和编辑
  164. 'button' => array
  165. (
  166. //'新增兑换码' => array('fast', 1, 'config&where_id=1'),
  167. '字段配置' => array('list', 'col&project=push&oper_parent=info&oper_project=push'),
  168. '功能配置' => array('list', 'func&project=push&oper_parent=info&oper_project=push'),
  169. ),
  170. 'list_button' => array
  171. (
  172. 'add' => array('新增数据', '"data&search_option_info_id={id}&oper_parent=info"'),
  173. 'list' => array('数据列表', '"data&search_option_info_id={id}&oper_parent=info"'),
  174. ),
  175. ),
  176. # request 请求接口定义
  177. 'request' => array
  178. (
  179. # 获取列表页
  180. 'getAll' => array
  181. (
  182. # 匹配的正则或函数 选填项
  183. 'option' => array
  184. (
  185. 'type' => 'yes',
  186. //'page_id' => 'yes',
  187. 'state' => 1,
  188. ),
  189. 'type' => 'all',
  190. 'order' => array('reorder' => 'desc'),
  191. 'col' => '*',
  192. ),
  193. ),
  194. );