col.php 4.3 KB

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