col.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <?php
  2. $type = array
  3. (
  4. 1 => '普通文本',
  5. 2 => '长文本',
  6. 3 => '编辑器',
  7. 4 => '单张图片',
  8. 5 => '多张图片',
  9. //6 => '单项选择',
  10. //7 => '多项选择',
  11. 8 => '时间选择',
  12. );
  13. $is_option = array
  14. (
  15. 1 => '必填',
  16. 2 => '选填',
  17. );
  18. return array
  19. (
  20. # 表名
  21. 'name' => 'col',
  22. # 显示给用户看的名称
  23. 'lang' => '字段设置',
  24. # 后台菜单排序
  25. 'order' => 2,
  26. 'menu' => false,
  27. 'check' => 'key',
  28. # 数据结构
  29. 'struct' => array
  30. (
  31. 'id' => array
  32. (
  33. 'type' => 'int-11',
  34. 'name' => 'ID',
  35. 'default' => '',
  36. 'desc' => '',
  37. 'match' => 'is_numeric',
  38. 'search' => 'order',
  39. 'list' => true,
  40. 'order' => 'desc',
  41. ),
  42. 'name' => array
  43. (
  44. 'type' => 'varchar-32',
  45. 'name' => '字段名称',
  46. 'default' => '',
  47. 'desc' => '字段名称',
  48. 'match' => 'is_string',
  49. 'update' => 'text',
  50. 'search' => 'fulltext',
  51. 'list' => true,
  52. ),
  53. 'key' => array
  54. (
  55. 'type' => 'varchar-32',
  56. 'name' => '字段标识',
  57. 'default' => '',
  58. 'desc' => '字段标识',
  59. 'match' => 'is_string',
  60. 'update' => 'text',
  61. 'search' => 'fulltext',
  62. 'list' => true,
  63. ),
  64. 'desc' => array
  65. (
  66. 'type' => 'varchar-200',
  67. 'name' => '字段描述',
  68. 'default' => '',
  69. 'desc' => '字段描述',
  70. 'match' => 'is_string',
  71. 'update' => 'text',
  72. 'search' => 'fulltext',
  73. 'list' => true,
  74. ),
  75. 'type' => array
  76. (
  77. 'type' => 'tinyint-1',
  78. 'name' => '类型',
  79. 'default' => '1',
  80. 'desc' => '类型',
  81. 'match' => 'is_numeric',
  82. 'update' => 'radio',
  83. 'option' => $type,
  84. 'search' => 'select',
  85. 'list' => true,
  86. 'control' => 'type',
  87. ),
  88. 'is_option' => array
  89. (
  90. 'type' => 'tinyint-1',
  91. 'name' => '是否必填',
  92. 'default' => '1',
  93. 'desc' => '是否必填',
  94. 'match' => 'is_numeric',
  95. 'update' => 'radio',
  96. 'option' => $is_option,
  97. 'search' => 'select',
  98. 'list' => true,
  99. ),
  100. 'pic' => array
  101. (
  102. 'type' => 'varchar-20',
  103. 'name' => '图片尺寸提醒-请直接输入尺寸,如100*100',
  104. 'default' => '',
  105. 'desc' => '图片尺寸提醒',
  106. 'match' => 'option',
  107. 'update' => 'text',
  108. 'show' => 'type=4,5',
  109. ),
  110. 'option' => array
  111. (
  112. 'type' => 'varchar-1000',
  113. 'name' => '可选项-每行一个选项,多个直接换行',
  114. 'default' => '',
  115. 'desc' => '可选项',
  116. 'match' => 'is_string',
  117. 'update' => 'textarea',
  118. 'show' => 'type=6,7',
  119. ),
  120. 'reorder' => array
  121. (
  122. 'type' => 'int-11',
  123. 'name' => '排序(数值越大越靠前)',
  124. 'default' => '1',
  125. 'desc' => '请输入排序',
  126. 'match' => 'option',
  127. 'update' => 'text',
  128. 'search' => 'order',
  129. 'list' => true,
  130. 'order' => 'desc',
  131. 'edit' => true,
  132. ),
  133. 'state' => array
  134. (
  135. 'type' => 'tinyint-1',
  136. 'name' => '状态',
  137. 'default' => '1',
  138. 'desc' => '请选择状态',
  139. 'match' => 'is_numeric',
  140. ),
  141. 'cdate' => array
  142. (
  143. 'type' => 'int-11',
  144. 'name' => '录入时间',
  145. 'match' => array('is_numeric', time()),
  146. 'desc' => '',
  147. # 只有insert时才生效
  148. 'insert' => true,
  149. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  150. ),
  151. ),
  152. 'manage' => array
  153. (
  154. 'insert' => false,
  155. 'edit' => false,
  156. # 自定义快捷新增和编辑
  157. 'button' => array
  158. (
  159. '新增' => array('fast'),
  160. ),
  161. # 快捷更新
  162. 'list_button' => array
  163. (
  164. 'edit' => array('编辑'),
  165. ),
  166. ),
  167. 'default' => array
  168. (
  169. 'col' => '`name`,`key`,`desc`,`type`,`state`,`cdate`',
  170. 'value' => array
  171. (
  172. '"标题","name","标题",1, 1,' . DEVER_TIME,
  173. '"图片","pic","图片",4, 1,' . DEVER_TIME,
  174. '"链接","link","链接",1, 1,' . DEVER_TIME,
  175. ),
  176. ),
  177. 'request' => array
  178. (
  179. 'state' => array
  180. (
  181. # 匹配的正则或函数 选填项
  182. 'option' => array
  183. (
  184. 'state' => 1,
  185. ),
  186. 'type' => 'all',
  187. 'order' => array('reorder' => 'desc','id' => 'desc'),
  188. 'col' => '*',
  189. ),
  190. 'getAll' => array
  191. (
  192. # 匹配的正则或函数 选填项
  193. 'option' => array
  194. (
  195. 'state' => 1,
  196. //'id' => array('yes', 'in'),
  197. //'id_no' => array('yes-id', '!='),
  198. ),
  199. 'type' => 'all',
  200. 'order' => array('reorder' => 'desc','id' => 'asc'),
  201. 'col' => '*',
  202. ),
  203. ),
  204. );