5aab6292a8fc22e1488d63b09a4c134151568740.svn-base 3.7 KB

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