config.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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. 'state' => array
  120. (
  121. 'type' => 'tinyint-1',
  122. 'name' => '状态',
  123. 'default' => '1',
  124. 'desc' => '请选择状态',
  125. 'match' => 'is_numeric',
  126. //'option' => $option,
  127. //'update' => 'radio',
  128. //'list' => true,
  129. ),
  130. 'cdate' => array
  131. (
  132. 'type' => 'int-11',
  133. 'name' => '录入时间',
  134. 'match' => array('is_numeric', time()),
  135. 'desc' => '',
  136. # 只有insert时才生效
  137. 'insert' => true,
  138. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  139. ),
  140. ),
  141. # 更新表结构
  142. /*
  143. 'alter' => array
  144. (
  145. 1 => array
  146. (
  147. array('add', 'info', 'info', 'varchar-40 控制台欢迎标题'),
  148. array('add', 'content', 'content', 'text-255 控制台欢迎内容'),
  149. ),
  150. 2 => array
  151. (
  152. array('add', 'template', 'template', 'int-1 1 模板'),
  153. ),
  154. 'version' => 2,
  155. ),
  156. */
  157. # 默认值
  158. 'default' => array
  159. (
  160. 'col' => 'name,state,cdate',
  161. 'value' => array
  162. (
  163. '"默认配置",1,' . time(),
  164. ),
  165. ),
  166. # request 请求接口定义
  167. 'request' => array
  168. (
  169. # all 取所有数据
  170. 'all' => array
  171. (
  172. # 匹配的正则或函数 选填项
  173. 'option' => array
  174. (
  175. 'name' => 'yes',
  176. ),
  177. 'type' => 'all',
  178. 'order' => array('id', 'desc'),
  179. 'col' => '*|id',
  180. ),
  181. # 取一条正常的数据
  182. 'info' => array
  183. (
  184. # 匹配的正则或函数 选填项
  185. 'where' => array
  186. (
  187. 'id' => 'yes',
  188. 'state' => 1,
  189. ),
  190. 'type' => 'one',
  191. ),
  192. ),
  193. );