col.php 4.3 KB

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