pic.php 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. <?php
  2. $status = Dever::config('base')->status;
  3. $is_button = array
  4. (
  5. 1 => '显示',
  6. 2 => '不显示',
  7. );
  8. $text = array
  9. (
  10. 1 => '上左',
  11. 2 => '上中',
  12. 3 => '上右',
  13. 4 => '中左',
  14. 5 => '正中',
  15. 6 => '中右',
  16. 7 => '下左',
  17. 8 => '下中',
  18. 9 => '下右',
  19. //10 => '自定义',
  20. );
  21. $type = array
  22. (
  23. 1 => '长屏图',
  24. 2 => '横屏图',
  25. );
  26. $bgcolor_type = array
  27. (
  28. 1 => '设置背景颜色',
  29. 2 => '不设置背景颜色',
  30. );
  31. return array
  32. (
  33. # 表名
  34. 'name' => 'pic',
  35. # 显示给用户看的名称
  36. 'lang' => '图片内容',
  37. 'order' => 100,
  38. 'menu' => false,
  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. //'list' => true,
  50. ),
  51. 'info_id' => array
  52. (
  53. 'type' => 'int-11',
  54. 'name' => '合集',
  55. 'default' => '',
  56. 'desc' => '合集',
  57. 'match' => 'is_numeric',
  58. 'update' => 'hidden',
  59. 'value' => Dever::input('search_option_info_id')
  60. ),
  61. 'content_id' => array
  62. (
  63. 'type' => 'int-11',
  64. 'name' => '合集内容id',
  65. 'default' => '',
  66. 'desc' => '合集内容id',
  67. 'match' => 'is_numeric',
  68. 'update' => 'hidden',
  69. 'value' => Dever::input('search_option_content_id')
  70. ),
  71. 'type' => array
  72. (
  73. 'type' => 'tinyint-1',
  74. 'name' => '展示类型',
  75. 'default' => '1',
  76. 'desc' => '展示类型',
  77. 'match' => 'is_numeric',
  78. 'update' => 'radio',
  79. 'option' => $type,
  80. ),
  81. 'pic' => array
  82. (
  83. 'type' => 'varchar-150',
  84. 'name' => '图片-全屏图图片尺寸750*1386px或等比尺寸,长屏图图片尺寸750*高度不限或等比尺寸,横屏图图片尺寸宽度不限*1386px或等比尺寸,无边框图片尺寸长和宽均没有限制,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  85. 'default' => '',
  86. 'desc' => '图片',
  87. 'match' => 'option',
  88. 'update' => 'image',
  89. 'key' => '1',
  90. 'place' => '750*1386',
  91. 'list' => 'Dever::load("content/lib/manage.pic", "{pic}")',
  92. ),
  93. 'pic_info' => array
  94. (
  95. 'type' => 'varchar-500',
  96. 'name' => '图片信息',
  97. 'default' => '',
  98. 'desc' => '图片信息',
  99. 'match' => 'is_string',
  100. 'update' => 'hidden',
  101. ),
  102. 'text' => array
  103. (
  104. 'type' => 'text-1000',
  105. 'name' => '文字设置',
  106. 'default' => '',
  107. 'desc' => '文字设置',
  108. 'match' => 'is_string',
  109. 'option' => $text,
  110. 'update' => array
  111. (
  112. array
  113. (
  114. 'col' => 'name',
  115. 'name' => '文字内容',
  116. 'default' => '',
  117. 'desc' => '文字内容',
  118. 'match' => 'is_string',
  119. 'update' => 'textarea',
  120. ),
  121. array
  122. (
  123. 'col' => 'color',
  124. 'name' => '文字颜色',
  125. 'default' => '#000000',
  126. 'desc' => '文字颜色',
  127. 'match' => 'is_string',
  128. 'update' => 'color',
  129. ),
  130. array
  131. (
  132. 'col' => 'bgcolor_type',
  133. 'name' => '是否设置背景颜色',
  134. 'default' => '2',
  135. 'desc' => '是否设置背景颜色',
  136. 'match' => 'is_string',
  137. 'update' => 'radio',
  138. 'option' => $bgcolor_type,
  139. 'control' => 'bgcolor_type',
  140. ),
  141. array
  142. (
  143. 'col' => 'bgcolor',
  144. 'name' => '背景颜色',
  145. 'default' => '#000000',
  146. 'desc' => '背景颜色',
  147. 'match' => 'is_string',
  148. 'update' => 'color',
  149. 'show' => 'bgcolor_type=1'
  150. ),
  151. array
  152. (
  153. 'col' => 'size',
  154. 'name' => '文字大小-直接输入像素数字',
  155. 'default' => '16',
  156. 'desc' => '结果描述',
  157. 'match' => 'is_numeric',
  158. 'update' => 'text',
  159. ),
  160. ),
  161. ),
  162. 'is_button' => array
  163. (
  164. 'type' => 'int-11',
  165. 'name' => '是否显示保存按钮',
  166. 'default' => '2',
  167. 'desc' => '是否显示保存按钮',
  168. 'match' => 'is_numeric',
  169. 'update' => 'radio',
  170. 'option' => $is_button,
  171. 'control' => 'is_button',
  172. ),
  173. 'button_name' => array
  174. (
  175. 'type' => 'varchar-80',
  176. 'name' => '保存按钮文字内容',
  177. 'default' => '保存图片',
  178. 'desc' => '保存按钮文字内容',
  179. 'match' => 'option',
  180. 'update' => 'textarea',
  181. 'show' => 'is_button=1',
  182. ),
  183. 'button_color' => array
  184. (
  185. 'type' => 'varchar-10',
  186. 'name' => '保存按钮文字颜色',
  187. 'default' => '#000000',
  188. 'desc' => '保存按钮文字颜色',
  189. 'match' => 'option',
  190. 'update' => 'color',
  191. 'show' => 'is_button=1',
  192. ),
  193. 'udate' => array
  194. (
  195. 'type' => 'int-11',
  196. 'name' => '更新时间',
  197. 'match' => array('is_numeric', time()),
  198. 'desc' => '',
  199. ),
  200. 'status' => array
  201. (
  202. 'type' => 'int-11',
  203. 'name' => '发布状态',
  204. 'default' => '1',
  205. 'desc' => '发布状态',
  206. 'match' => 'is_numeric',
  207. //'update' => 'select',
  208. 'option' => $status,
  209. //'search' => 'select',
  210. //'list' => true,
  211. //'edit' => true,
  212. ),
  213. 'reorder' => array
  214. (
  215. 'type' => 'int-11',
  216. 'name' => '排序(数值越大越靠前)',
  217. 'default' => '1',
  218. 'desc' => '请输入排序',
  219. 'match' => 'option',
  220. //'update' => 'text',
  221. 'search' => 'order',
  222. 'list' => true,
  223. 'order' => 'desc',
  224. 'edit' => true,
  225. ),
  226. 'state' => array
  227. (
  228. 'type' => 'tinyint-1',
  229. 'name' => '状态',
  230. 'default' => '1',
  231. 'desc' => '请选择状态',
  232. 'match' => 'is_numeric',
  233. ),
  234. 'cdate' => array
  235. (
  236. 'type' => 'int-11',
  237. 'name' => '录入时间',
  238. 'match' => array('is_numeric', time()),
  239. 'desc' => '',
  240. # 只有insert时才生效
  241. 'insert' => true,
  242. ),
  243. ),
  244. # 管理功能
  245. 'manage' => array
  246. (
  247. ),
  248. # request 请求接口定义
  249. 'request' => array
  250. (
  251. 'getAll' => array
  252. (
  253. # 匹配的正则或函数 选填项
  254. 'option' => array
  255. (
  256. 'info_id' => 'yes',
  257. 'content_id' => 'yes',
  258. 'state' => 1,
  259. ),
  260. 'type' => 'all',
  261. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  262. 'col' => '*',
  263. ),
  264. ),
  265. );