col.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  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. 'edit' => true,
  100. ),
  101. 'pic' => array
  102. (
  103. 'type' => 'varchar-20',
  104. 'name' => '图片尺寸提醒-请直接输入尺寸,如100*100',
  105. 'default' => '',
  106. 'desc' => '图片尺寸提醒',
  107. 'match' => 'option',
  108. 'update' => 'text',
  109. 'show' => 'type=4,5',
  110. ),
  111. 'option' => array
  112. (
  113. 'type' => 'varchar-1000',
  114. 'name' => '可选项-每行一个选项,多个直接换行',
  115. 'default' => '',
  116. 'desc' => '可选项',
  117. 'match' => 'is_string',
  118. 'update' => 'textarea',
  119. 'show' => 'type=6,7',
  120. ),
  121. 'reorder' => array
  122. (
  123. 'type' => 'int-11',
  124. 'name' => '排序(数值越大越靠前)',
  125. 'default' => '1',
  126. 'desc' => '请输入排序',
  127. 'match' => 'option',
  128. 'update' => 'text',
  129. 'search' => 'order',
  130. 'list' => true,
  131. 'order' => 'desc',
  132. 'edit' => true,
  133. ),
  134. 'state' => array
  135. (
  136. 'type' => 'tinyint-1',
  137. 'name' => '状态',
  138. 'default' => '1',
  139. 'desc' => '请选择状态',
  140. 'match' => 'is_numeric',
  141. ),
  142. 'cdate' => array
  143. (
  144. 'type' => 'int-11',
  145. 'name' => '录入时间',
  146. 'match' => array('is_numeric', time()),
  147. 'desc' => '',
  148. # 只有insert时才生效
  149. 'insert' => true,
  150. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  151. ),
  152. ),
  153. 'manage' => array
  154. (
  155. 'insert' => false,
  156. 'edit' => false,
  157. # 自定义快捷新增和编辑
  158. 'button' => array
  159. (
  160. '新增' => array('fast'),
  161. ),
  162. # 快捷更新
  163. 'list_button' => array
  164. (
  165. 'edit' => array('编辑'),
  166. ),
  167. ),
  168. 'default' => array
  169. (
  170. 'col' => '`name`,`key`,`desc`,`type`,`state`,`cdate`',
  171. 'value' => array
  172. (
  173. '"标题","name","标题",1, 1,' . DEVER_TIME,
  174. '"图片","pic","图片",4, 1,' . DEVER_TIME,
  175. '"链接","link","链接",1, 1,' . DEVER_TIME,
  176. ),
  177. ),
  178. 'request' => array
  179. (
  180. 'state' => array
  181. (
  182. # 匹配的正则或函数 选填项
  183. 'option' => array
  184. (
  185. 'state' => 1,
  186. ),
  187. 'type' => 'all',
  188. 'order' => array('reorder' => 'desc','id' => 'desc'),
  189. 'col' => '*',
  190. ),
  191. 'getAll' => array
  192. (
  193. # 匹配的正则或函数 选填项
  194. 'option' => array
  195. (
  196. 'state' => 1,
  197. //'id' => array('yes', 'in'),
  198. //'id_no' => array('yes-id', '!='),
  199. ),
  200. 'type' => 'all',
  201. 'order' => array('reorder' => 'desc','id' => 'asc'),
  202. 'col' => '*',
  203. ),
  204. ),
  205. );