config.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | config.php 后台配置信息
  5. |--------------------------------------------------------------------------
  6. */
  7. # 定义几个常用的选项
  8. $option = array
  9. (
  10. 1 => '启用',
  11. 2 => '失效',
  12. );
  13. # 定义图片选择器的内容 key为id,value为显示的样式
  14. $template = array
  15. (
  16. 1 => '<span class="color theme-1"></span>',
  17. 2 => '<span class="color theme-2"></span>',
  18. 3 => '<span class="color theme-3"></span>',
  19. 4 => '<span class="color theme-4"></span>',
  20. 5 => '<span class="color theme-5"></span>',
  21. 6 => '<span class="color theme-6"></span>',
  22. 7 => '<span class="color theme-7"></span>',
  23. 8 => '<span class="color theme-8"></span>',
  24. );
  25. $selector = 'selector';
  26. /*
  27. if(Dever::$global['base'] != 'default')
  28. {
  29. $selector = 'hidden';
  30. }
  31. */
  32. return array
  33. (
  34. # 表名
  35. 'name' => 'config',
  36. # 显示给用户看的名称
  37. 'lang' => '个性化配置',
  38. 'order' => 10,
  39. # 数据结构
  40. 'struct' => array
  41. (
  42. 'id' => array
  43. (
  44. 'type' => 'int-11',
  45. 'name' => '配置ID',
  46. 'default' => '',
  47. 'desc' => '',
  48. 'match' => 'is_numeric',
  49. 'search' => 'order',
  50. 'list' => true,
  51. ),
  52. 'name' => array
  53. (
  54. 'type' => 'varchar-32',
  55. 'name' => '配置名',
  56. 'default' => '',
  57. 'desc' => '请输入配置名',
  58. 'match' => 'is_string',
  59. 'update' => 'text',
  60. 'search' => 'fulltext',
  61. 'list' => true,
  62. 'edit' => true,
  63. ),
  64. # 测试关联其他表字段 项目-表-字段 这里仅仅是测试
  65. /*
  66. 'manage-admin-username' => array
  67. (
  68. # 必填,两个表之间的关联字段,第一个为当前表的,第二个为关联表的
  69. 'sync' => array('id', 'config'),
  70. 'default' => '',
  71. 'name' => '管理员',
  72. 'desc' => '管理员',
  73. 'match' => 'option',
  74. 'update' => 'text',
  75. 'search' => 'fulltext',
  76. 'list' => true,
  77. ),
  78. */
  79. 'template' => array
  80. (
  81. 'type' => 'int-1',
  82. 'name' => '后台模板',
  83. 'default' => '1',
  84. 'desc' => '请选择后台模板',
  85. 'match' => 'is_numeric',
  86. 'option' => $template,
  87. //'update' => $selector,//图片选择器 注意跟select/radio不同哦
  88. ),
  89. 'title' => array
  90. (
  91. 'type' => 'varchar-32',
  92. 'name' => '后台title',
  93. 'default' => '',
  94. 'desc' => '请输入后台title',
  95. 'match' => 'option',
  96. 'update' => 'text',
  97. 'search' => 'fulltext',
  98. 'list' => true,
  99. ),
  100. 'info' => array
  101. (
  102. 'type' => 'varchar-40',
  103. 'name' => '控制台欢迎标题',
  104. 'default' => '',
  105. 'desc' => '请输入控制台欢迎标题',
  106. 'match' => 'option',
  107. 'update' => 'text',
  108. ),
  109. 'content' => array
  110. (
  111. 'type' => 'text-255',
  112. 'name' => '控制台欢迎内容',
  113. 'default' => '',
  114. 'desc' => '请输入控制台欢迎内容',
  115. 'match' => 'option',
  116. 'update' => 'editor',
  117. //'strip' => false,//默认是开启strip_tags过滤的,这里可以加上这个来取消过滤
  118. ),
  119. 'help_title' => array
  120. (
  121. 'type' => 'varchar-32',
  122. 'name' => '帮助标题',
  123. 'default' => '帮助标题',
  124. 'desc' => '帮助标题',
  125. 'match' => 'option',
  126. 'update' => 'text',
  127. ),
  128. 'help_info' => array
  129. (
  130. 'type' => 'varchar-800',
  131. 'name' => '帮助介绍',
  132. 'default' => '默认帮助介绍',
  133. 'desc' => '帮助介绍',
  134. 'match' => 'option',
  135. 'update' => 'textarea',
  136. ),
  137. 'state' => array
  138. (
  139. 'type' => 'tinyint-1',
  140. 'name' => '状态',
  141. 'default' => '1',
  142. 'desc' => '请选择状态',
  143. 'match' => 'is_numeric',
  144. //'option' => $option,
  145. //'update' => 'radio',
  146. //'list' => true,
  147. ),
  148. 'cdate' => array
  149. (
  150. 'type' => 'int-11',
  151. 'name' => '录入时间',
  152. 'match' => array('is_numeric', time()),
  153. 'desc' => '',
  154. # 只有insert时才生效
  155. 'insert' => true,
  156. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  157. ),
  158. ),
  159. # 更新表结构
  160. /*
  161. 'alter' => array
  162. (
  163. 1 => array
  164. (
  165. array('add', 'info', 'info', 'varchar-40 控制台欢迎标题'),
  166. array('add', 'content', 'content', 'text-255 控制台欢迎内容'),
  167. ),
  168. 2 => array
  169. (
  170. array('add', 'template', 'template', 'int-1 1 模板'),
  171. ),
  172. 'version' => 2,
  173. ),
  174. */
  175. # 默认值
  176. 'default' => array
  177. (
  178. 'col' => 'name,state,cdate',
  179. 'value' => array
  180. (
  181. '"默认配置",1,' . time(),
  182. ),
  183. ),
  184. # request 请求接口定义
  185. 'request' => array
  186. (
  187. # all 取所有数据
  188. 'all' => array
  189. (
  190. # 匹配的正则或函数 选填项
  191. 'option' => array
  192. (
  193. 'name' => 'yes',
  194. ),
  195. 'type' => 'all',
  196. 'order' => array('id', 'desc'),
  197. 'col' => '*|id',
  198. ),
  199. # 取一条正常的数据
  200. 'info' => array
  201. (
  202. # 匹配的正则或函数 选填项
  203. 'where' => array
  204. (
  205. 'id' => 'yes',
  206. 'state' => 1,
  207. ),
  208. 'type' => 'one',
  209. ),
  210. ),
  211. );