config.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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. if(Dever::$global['base'] != 'default')
  27. {
  28. $selector = 'hidden';
  29. }
  30. return array
  31. (
  32. # 表名
  33. 'name' => 'config',
  34. # 显示给用户看的名称
  35. 'lang' => '后台个性化',
  36. 'order' => 10,
  37. # 数据结构
  38. 'struct' => array
  39. (
  40. 'id' => array
  41. (
  42. 'type' => 'int-11',
  43. 'name' => '配置ID',
  44. 'default' => '',
  45. 'desc' => '',
  46. 'match' => 'is_numeric',
  47. 'search' => 'order',
  48. 'list' => true,
  49. ),
  50. 'name' => array
  51. (
  52. 'type' => 'varchar-32',
  53. 'name' => '配置名',
  54. 'default' => '',
  55. 'desc' => '请输入配置名',
  56. 'match' => 'is_string',
  57. 'update' => 'text',
  58. 'search' => 'fulltext',
  59. 'list' => true,
  60. ),
  61. 'template' => array
  62. (
  63. 'type' => 'int-1',
  64. 'name' => '后台模板',
  65. 'default' => '1',
  66. 'desc' => '请选择后台模板',
  67. 'match' => 'is_numeric',
  68. 'option' => $template,
  69. 'update' => $selector,//图片选择器 注意跟select/radio不同哦
  70. ),
  71. 'title' => array
  72. (
  73. 'type' => 'varchar-32',
  74. 'name' => '后台title',
  75. 'default' => '',
  76. 'desc' => '请输入后台title',
  77. 'match' => 'option',
  78. 'update' => 'text',
  79. 'search' => 'fulltext',
  80. 'list' => true,
  81. ),
  82. 'info' => array
  83. (
  84. 'type' => 'varchar-40',
  85. 'name' => '控制台欢迎标题',
  86. 'default' => '',
  87. 'desc' => '请输入控制台欢迎标题',
  88. 'match' => 'option',
  89. 'update' => 'text',
  90. ),
  91. 'content' => array
  92. (
  93. 'type' => 'text-255',
  94. 'name' => '控制台欢迎内容',
  95. 'default' => '',
  96. 'desc' => '请输入控制台欢迎内容',
  97. 'match' => 'option',
  98. 'update' => 'editor',
  99. //'strip' => false,//默认是开启strip_tags过滤的,这里可以加上这个来取消过滤
  100. ),
  101. 'state' => array
  102. (
  103. 'type' => 'tinyint-1',
  104. 'name' => '状态',
  105. 'default' => '1',
  106. 'desc' => '请选择状态',
  107. 'match' => 'is_numeric',
  108. 'option' => $option,
  109. 'update' => 'radio',
  110. 'list' => true,
  111. ),
  112. 'cdate' => array
  113. (
  114. 'type' => 'int-11',
  115. 'name' => '录入时间',
  116. 'match' => array('is_numeric', time()),
  117. 'desc' => '',
  118. # 只有insert时才生效
  119. 'insert' => true,
  120. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  121. ),
  122. ),
  123. # 更新表结构
  124. /*
  125. 'alter' => array
  126. (
  127. 1 => array
  128. (
  129. array('add', 'info', 'info', 'varchar-40 控制台欢迎标题'),
  130. array('add', 'content', 'content', 'text-255 控制台欢迎内容'),
  131. ),
  132. 2 => array
  133. (
  134. array('add', 'template', 'template', 'int-1 1 模板'),
  135. ),
  136. 'version' => 2,
  137. ),
  138. */
  139. # 默认值
  140. 'default' => array
  141. (
  142. 'col' => 'name,state,cdate',
  143. 'value' => array
  144. (
  145. '"默认配置",1,' . time(),
  146. ),
  147. ),
  148. # request 请求接口定义
  149. 'request' => array
  150. (
  151. # all 取所有数据
  152. 'all' => array
  153. (
  154. # 匹配的正则或函数 选填项
  155. 'option' => array
  156. (
  157. 'name' => 'yes',
  158. ),
  159. 'type' => 'all',
  160. 'order' => array('id', 'desc'),
  161. 'col' => '*|id',
  162. ),
  163. # 取一条正常的数据
  164. 'info' => array
  165. (
  166. # 匹配的正则或函数 选填项
  167. 'where' => array
  168. (
  169. 'id' => 'yes',
  170. 'state' => 1,
  171. ),
  172. 'type' => 'one',
  173. ),
  174. ),
  175. );