content.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  1. <?php
  2. $type = array
  3. (
  4. # 默认类型
  5. 3 => '图文内容',
  6. 1 => '全屏图',
  7. 2 => '长图',
  8. # 2018-12-11 增加3个类型
  9. //4 => '全屏视频',
  10. //5 => '留言视频',
  11. //6 => '留言音频',
  12. # 关联类型 > 10
  13. 11 => '关联图文',
  14. 12 => '关联视频',
  15. 13 => '关联直播',
  16. );
  17. $is_button = array
  18. (
  19. 1 => '显示',
  20. 2 => '不显示',
  21. );
  22. $text = array
  23. (
  24. 1 => '上左',
  25. 2 => '上中',
  26. 3 => '上右',
  27. 4 => '中左',
  28. 5 => '正中',
  29. 6 => '中右',
  30. 7 => '下左',
  31. 8 => '下中',
  32. 9 => '下右',
  33. //10 => '自定义',
  34. );
  35. $bgcolor_type = array
  36. (
  37. 1 => '设置背景颜色',
  38. 2 => '不设置背景颜色',
  39. );
  40. $author = function()
  41. {
  42. $array = array();
  43. $info = Dever::db('content/author')->state();
  44. if($info)
  45. {
  46. $array += $info;
  47. }
  48. return $array;
  49. };
  50. return array
  51. (
  52. # 表名
  53. 'name' => 'content',
  54. # 显示给用户看的名称
  55. 'lang' => '内页管理',
  56. 'menu' => false,
  57. 'gettype' => $type,
  58. 'text' => $text,
  59. 'end' => array
  60. (
  61. 'insert' => 'journal/lib/manage.addContent',
  62. ),
  63. # 数据结构
  64. 'struct' => array
  65. (
  66. 'id' => array
  67. (
  68. 'type' => 'int-11',
  69. 'name' => 'ID',
  70. 'default' => '',
  71. 'desc' => '',
  72. 'match' => 'is_numeric',
  73. //'search' => 'order',
  74. //'list' => true,
  75. ),
  76. 'info_id' => array
  77. (
  78. 'type' => 'int-11',
  79. 'name' => '小刊',
  80. 'default' => '',
  81. 'desc' => '小刊',
  82. 'match' => 'is_numeric',
  83. 'update' => 'hidden',
  84. 'value' => Dever::input('search_option_info_id')
  85. ),
  86. 'type' => array
  87. (
  88. 'type' => 'int-11',
  89. 'name' => '类型',
  90. 'default' => '3',
  91. 'desc' => '类型',
  92. 'match' => 'is_numeric',
  93. 'update' => 'radio',
  94. 'option' => $type,
  95. 'control' => 'type',
  96. ),
  97. 'name' => array
  98. (
  99. 'type' => 'varchar-80',
  100. 'name' => '标题',
  101. 'default' => '',
  102. 'desc' => '标题',
  103. 'match' => 'is_string',
  104. 'update' => 'text',
  105. 'list' => true,
  106. //增加预览
  107. 'preview' => true,
  108. 'show' => 'type=3,5,6',
  109. ),
  110. 'video' => array
  111. (
  112. 'type' => 'varchar-800',
  113. 'name' => '上传视频-视频格式mp4,mov,上传大小不能超过4G',
  114. 'default' => '',
  115. 'desc' => '上传点播视频',
  116. 'match' => 'is_string',
  117. 'update' => 'upload',
  118. 'key' => '3',
  119. 'place' => '150',
  120. 'upload' => 'qiniu',
  121. 'large' => true,
  122. //不覆盖原文件,生成新文件
  123. 'cover' => 2,
  124. 'show' => 'type=4,5',
  125. ),
  126. 'music' => array
  127. (
  128. 'type' => 'varchar-800',
  129. 'name' => '上传音频-视频格式mp3,上传大小不能超过100M',
  130. 'default' => '',
  131. 'desc' => '上传音频',
  132. 'match' => 'is_string',
  133. 'update' => 'upload',
  134. 'key' => '2',
  135. 'place' => '150',
  136. 'upload' => 'qiniu',
  137. 'large' => true,
  138. //不覆盖原文件,生成新文件
  139. 'cover' => 2,
  140. 'show' => 'type=6',
  141. ),
  142. 'focus' => array
  143. (
  144. 'type' => 'text-255',
  145. 'name' => '焦点图',
  146. 'default' => '',
  147. 'desc' => '焦点图',
  148. 'match' => 'option',
  149. 'update' => 'image',
  150. 'key' => '1',
  151. 'place' => '150',
  152. 'show' => 'type=3',
  153. ),
  154. 'author_id' => array
  155. (
  156. 'type' => 'int-11',
  157. 'name' => '作者',
  158. 'default' => '1',
  159. 'desc' => '作者',
  160. 'match' => 'is_numeric',
  161. 'update' => 'select',
  162. 'option' => $author,
  163. //'search' => 'select',
  164. 'show' => 'type=3',
  165. ),
  166. 'content' => array
  167. (
  168. 'type' => 'text-255',
  169. 'name' => '内容',
  170. 'default' => '',
  171. 'desc' => '请输入内容',
  172. 'match' => 'is_string',
  173. 'update' => 'editor',
  174. 'show' => 'type=3',
  175. //自定义编辑器右侧按钮
  176. 'editor' => array
  177. (
  178. 'name' => '选择插入模块',
  179. 'button' => array
  180. (
  181. array
  182. (
  183. # 名称
  184. 'name' => '图片',
  185. # 资源库id
  186. 'key' => 1,
  187. # 类型
  188. 'type' => 'image',
  189. ),
  190. array
  191. (
  192. 'name' => '音频',
  193. 'key' => 2,
  194. 'type' => 'media',
  195. ),
  196. array
  197. (
  198. 'name' => '视频',
  199. 'key' => 'video/lib/core.vod',
  200. ),
  201. array
  202. (
  203. 'name' => '直播',
  204. 'key' => 'video/lib/core.live',
  205. ),
  206. array
  207. (
  208. 'name' => '小程序',
  209. 'key' => 'content/lib/applet.update',
  210. 'type' => 'update',
  211. ),
  212. ),
  213. ),
  214. ),
  215. 'pic' => array
  216. (
  217. 'type' => 'varchar-150',
  218. 'name' => '图片-全屏图图片尺寸750*1386px或等比尺寸,长图图片尺寸750*高度不限 或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  219. 'default' => '',
  220. 'desc' => '图片',
  221. 'match' => 'option',
  222. 'update' => 'image',
  223. 'key' => '1',
  224. 'place' => '150',
  225. 'show' => 'type=1,2',
  226. ),
  227. 'is_button' => array
  228. (
  229. 'type' => 'int-11',
  230. 'name' => '是否显示保存按钮',
  231. 'default' => '1',
  232. 'desc' => '是否显示保存按钮',
  233. 'match' => 'is_numeric',
  234. 'update' => 'radio',
  235. 'option' => $is_button,
  236. // 'search' => 'select',
  237. 'show' => 'type=1',
  238. 'control' => 'is_button',
  239. ),
  240. 'button_name' => array
  241. (
  242. 'type' => 'varchar-80',
  243. 'name' => '保存按钮文字内容',
  244. 'default' => '保存图片',
  245. 'desc' => '保存按钮文字内容',
  246. 'match' => 'option',
  247. 'update' => 'textarea',
  248. 'show' => 'type=1',
  249. ),
  250. 'button_color' => array
  251. (
  252. 'type' => 'varchar-10',
  253. 'name' => '保存按钮文字颜色',
  254. 'default' => '#000000',
  255. 'desc' => '保存按钮文字颜色',
  256. 'match' => 'option',
  257. 'update' => 'color',
  258. 'show' => 'type=1',
  259. ),
  260. 'article_id' => array
  261. (
  262. 'type' => 'int-11',
  263. 'name' => '关联图文',
  264. 'default' => '',
  265. 'desc' => '关联图文',
  266. 'match' => 'option',
  267. 'update' => 'select',
  268. 'show' => 'type=11',
  269. 'update_search' => 'journal/lib/manage.search_article',
  270. ),
  271. 'vod_id' => array
  272. (
  273. 'type' => 'int-11',
  274. 'name' => '关联视频',
  275. 'default' => '',
  276. 'desc' => '关联视频',
  277. 'match' => 'option',
  278. 'update' => 'select',
  279. 'show' => 'type=12',
  280. 'update_search' => 'journal/lib/manage.search_vod',
  281. ),
  282. 'live_id' => array
  283. (
  284. 'type' => 'int-11',
  285. 'name' => '关联直播',
  286. 'default' => '',
  287. 'desc' => '关联直播',
  288. 'match' => 'option',
  289. 'update' => 'select',
  290. 'show' => 'type=13',
  291. 'update_search' => 'journal/lib/manage.search_live',
  292. ),
  293. 'text' => array
  294. (
  295. 'type' => 'text-1000',
  296. 'name' => '文字设置',
  297. 'default' => '',
  298. 'desc' => '文字设置',
  299. 'match' => 'is_string',
  300. 'option' => $text,
  301. 'show' => 'type=1',
  302. 'update' => array
  303. (
  304. array
  305. (
  306. 'col' => 'name',
  307. 'name' => '文字内容',
  308. 'default' => '',
  309. 'desc' => '文字内容',
  310. 'match' => 'is_string',
  311. 'update' => 'textarea',
  312. ),
  313. array
  314. (
  315. 'col' => 'color',
  316. 'name' => '文字颜色',
  317. 'default' => '#000000',
  318. 'desc' => '文字颜色',
  319. 'match' => 'is_string',
  320. 'update' => 'color',
  321. ),
  322. array
  323. (
  324. 'col' => 'bgcolor_type',
  325. 'name' => '是否设置背景颜色',
  326. 'default' => '2',
  327. 'desc' => '是否设置背景颜色',
  328. 'match' => 'is_string',
  329. 'update' => 'radio',
  330. 'option' => $bgcolor_type,
  331. 'control' => 'bgcolor_type',
  332. ),
  333. array
  334. (
  335. 'col' => 'bgcolor',
  336. 'name' => '背景颜色',
  337. 'default' => '#000000',
  338. 'desc' => '背景颜色',
  339. 'match' => 'is_string',
  340. 'update' => 'color',
  341. 'show' => 'bgcolor_type=1'
  342. ),
  343. array
  344. (
  345. 'col' => 'size',
  346. 'name' => '文字大小-直接输入像素数字',
  347. 'default' => '16',
  348. 'desc' => '结果描述',
  349. 'match' => 'is_numeric',
  350. 'update' => 'text',
  351. ),
  352. ),
  353. ),
  354. 'reorder' => array
  355. (
  356. 'type' => 'int-11',
  357. 'name' => '页号',
  358. 'default' => '1',
  359. 'desc' => '请输入排序',
  360. 'match' => 'option',
  361. //'update' => 'text',
  362. 'search' => 'order',
  363. 'list' => true,
  364. 'order' => 'asc',
  365. 'edit' => true,
  366. ),
  367. 'state' => array
  368. (
  369. 'type' => 'tinyint-1',
  370. 'name' => '状态',
  371. 'default' => '1',
  372. 'desc' => '请选择状态',
  373. 'match' => 'is_numeric',
  374. ),
  375. 'cdate' => array
  376. (
  377. 'type' => 'int-11',
  378. 'name' => '创建时间',
  379. 'match' => array('is_numeric', time()),
  380. 'desc' => '',
  381. # 只有insert时才生效
  382. 'insert' => true,
  383. //'search' => 'date',
  384. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  385. ),
  386. ),
  387. 'manage' => array
  388. (
  389. 'insert' => false,
  390. 'edit' => false,
  391. //'delete' => false,
  392. 'num' => false,
  393. 'page_list_table' => 'journal',
  394. # 自定义快捷新增和编辑
  395. 'button' => array
  396. (
  397. '新增内页' => array('location', 'add'),
  398. '预览' => array('fast', 'main/preview.get?type=4&id=' . Dever::input('search_option_info_id')),
  399. ),
  400. ),
  401. # request 请求接口定义
  402. 'request' => array
  403. (
  404. 'getAll' => array
  405. (
  406. # 匹配的正则或函数 选填项
  407. 'option' => array
  408. (
  409. 'info_id' => 'yes',
  410. 'state' => 1,
  411. ),
  412. 'type' => 'all',
  413. 'order' => array('reorder' => 'asc', 'id' => 'desc'),
  414. 'page' => array(10, 'list'),
  415. 'col' => '*',
  416. ),
  417. 'getAllByReorder' => array
  418. (
  419. # 匹配的正则或函数 选填项
  420. 'option' => array
  421. (
  422. 'info_id' => 'yes',
  423. 'state' => 1,
  424. ),
  425. 'type' => 'one',
  426. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  427. 'col' => '*',
  428. ),
  429. )
  430. );