config.php 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  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' => 70,
  39. 'info' => '后台配置设置之后,每个后台账户会根据该配置展示信息',
  40. # 数据结构
  41. 'struct' => array
  42. (
  43. 'id' => array
  44. (
  45. 'type' => 'int-11',
  46. 'name' => '配置ID',
  47. 'default' => '',
  48. 'desc' => '',
  49. 'match' => 'is_numeric',
  50. 'search' => 'order',
  51. 'list' => true,
  52. ),
  53. 'name' => 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. 'edit' => true,
  64. ),
  65. # 测试关联其他表字段 项目-表-字段 这里仅仅是测试
  66. /*
  67. 'manage-admin-username' => array
  68. (
  69. # 必填,两个表之间的关联字段,第一个为当前表的,第二个为关联表的
  70. 'sync' => array('id', 'config'),
  71. 'default' => '',
  72. 'name' => '管理员',
  73. 'desc' => '管理员',
  74. 'match' => 'option',
  75. 'update' => 'text',
  76. 'search' => 'fulltext',
  77. 'list' => true,
  78. ),
  79. */
  80. 'template' => array
  81. (
  82. 'type' => 'int-1',
  83. 'name' => '后台模板',
  84. 'default' => '1',
  85. 'desc' => '请选择后台模板',
  86. 'match' => 'is_numeric',
  87. 'option' => $template,
  88. //'update' => $selector,//图片选择器 注意跟select/radio不同哦
  89. ),
  90. 'title' => array
  91. (
  92. 'type' => 'varchar-32',
  93. 'name' => '后台title',
  94. 'default' => '',
  95. 'desc' => '请输入后台title',
  96. 'match' => 'option',
  97. 'update' => 'text',
  98. 'search' => 'fulltext',
  99. 'list' => true,
  100. ),
  101. 'info' => array
  102. (
  103. 'type' => 'varchar-40',
  104. 'name' => '控制台欢迎标题',
  105. 'default' => '',
  106. 'desc' => '请输入控制台欢迎标题',
  107. 'match' => 'option',
  108. 'update' => 'text',
  109. ),
  110. 'content' => array
  111. (
  112. 'type' => 'text-255',
  113. 'name' => '控制台欢迎内容',
  114. 'default' => '',
  115. 'desc' => '请输入控制台欢迎内容',
  116. 'match' => 'option',
  117. 'update' => 'editor',
  118. //'strip' => false,//默认是开启strip_tags过滤的,这里可以加上这个来取消过滤
  119. ),
  120. 'help_title' => array
  121. (
  122. 'type' => 'varchar-32',
  123. 'name' => '帮助标题',
  124. 'default' => '帮助标题',
  125. 'desc' => '帮助标题',
  126. 'match' => 'option',
  127. 'update' => 'text',
  128. ),
  129. 'help_info' => array
  130. (
  131. 'type' => 'varchar-800',
  132. 'name' => '帮助介绍',
  133. 'default' => '默认帮助介绍',
  134. 'desc' => '帮助介绍',
  135. 'match' => 'option',
  136. 'update' => 'textarea',
  137. ),
  138. 'state' => array
  139. (
  140. 'type' => 'tinyint-1',
  141. 'name' => '状态',
  142. 'default' => '1',
  143. 'desc' => '请选择状态',
  144. 'match' => 'is_numeric',
  145. //'option' => $option,
  146. //'update' => 'radio',
  147. //'list' => true,
  148. ),
  149. 'cdate' => array
  150. (
  151. 'type' => 'int-11',
  152. 'name' => '录入时间',
  153. 'match' => array('is_numeric', time()),
  154. 'desc' => '',
  155. # 只有insert时才生效
  156. 'insert' => true,
  157. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  158. ),
  159. ),
  160. # 更新表结构
  161. /*
  162. 'alter' => array
  163. (
  164. 1 => array
  165. (
  166. array('add', 'info', 'info', 'varchar-40 控制台欢迎标题'),
  167. array('add', 'content', 'content', 'text-255 控制台欢迎内容'),
  168. ),
  169. 2 => array
  170. (
  171. array('add', 'template', 'template', 'int-1 1 模板'),
  172. ),
  173. 'version' => 2,
  174. ),
  175. */
  176. 'manage' => array
  177. (
  178. 'link' => 'parent=config',
  179. 'button' => array
  180. (
  181. '后台公告' => array('list', 'notice'),
  182. '后台帮助' => array('list', 'help'),
  183. ),
  184. ),
  185. # 默认值
  186. 'default' => array
  187. (
  188. 'col' => 'name,state,cdate',
  189. 'value' => array
  190. (
  191. '"默认配置",1,' . time(),
  192. ),
  193. ),
  194. # request 请求接口定义
  195. 'request' => array
  196. (
  197. # all 取所有数据
  198. 'all' => array
  199. (
  200. # 匹配的正则或函数 选填项
  201. 'option' => array
  202. (
  203. 'name' => 'yes',
  204. ),
  205. 'type' => 'all',
  206. 'order' => array('id', 'desc'),
  207. 'col' => '*|id',
  208. ),
  209. # 取一条正常的数据
  210. 'info' => array
  211. (
  212. # 匹配的正则或函数 选填项
  213. 'where' => array
  214. (
  215. 'id' => 'yes',
  216. 'state' => 1,
  217. ),
  218. 'type' => 'one',
  219. ),
  220. ),
  221. );