7faa9e9479ad07bc5a9c5928fb36415aa1def518.svn-base 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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. ),
  95. 'state' => array
  96. (
  97. 'type' => 'tinyint-1',
  98. 'name' => '状态',
  99. 'default' => '1',
  100. 'desc' => '请选择状态',
  101. 'match' => 'is_numeric',
  102. 'option' => $option,
  103. 'update' => 'radio',
  104. 'list' => true,
  105. ),
  106. 'cdate' => array
  107. (
  108. 'type' => 'int-11',
  109. 'name' => '录入时间',
  110. 'match' => array('is_numeric', time()),
  111. 'desc' => '',
  112. # 只有insert时才生效
  113. 'insert' => true,
  114. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  115. ),
  116. ),
  117. # 更新表结构
  118. 'alter' => array
  119. (
  120. 1 => array
  121. (
  122. array('add', 'info', 'info', 'varchar-40 控制台欢迎标题'),
  123. array('add', 'content', 'content', 'text-255 控制台欢迎内容'),
  124. ),
  125. 2 => array
  126. (
  127. array('add', 'template', 'template', 'int-1 1 模板'),
  128. ),
  129. 'version' => 2,
  130. ),
  131. # 默认值
  132. 'default' => array
  133. (
  134. 'col' => 'name,state,cdate',
  135. 'value' => array
  136. (
  137. '"默认配置",1,' . time(),
  138. ),
  139. ),
  140. # request 请求接口定义
  141. 'request' => array
  142. (
  143. # all 取所有数据
  144. 'all' => array
  145. (
  146. # 匹配的正则或函数 选填项
  147. 'option' => array
  148. (
  149. 'name' => 'yes',
  150. ),
  151. 'type' => 'all',
  152. 'order' => array('id', 'desc'),
  153. 'col' => '*|id',
  154. ),
  155. # 取一条正常的数据
  156. 'info' => array
  157. (
  158. # 匹配的正则或函数 选填项
  159. 'where' => array
  160. (
  161. 'id' => 'yes',
  162. 'state' => 1,
  163. ),
  164. 'type' => 'one',
  165. ),
  166. ),
  167. );