content.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  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. 'cover' => array
  143. (
  144. 'type' => 'varchar-150',
  145. 'name' => '封面图-全屏视频的封面图图片尺寸750*1386px或等比尺寸,留言视频的封面图图片尺寸750*422px或等比尺寸,留言音频的封面图图片尺寸750*422px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  146. 'default' => '',
  147. 'desc' => '封面图',
  148. 'match' => 'option',
  149. 'update' => 'image',
  150. 'key' => '1',
  151. 'place' => '150',
  152. 'show' => 'type=4,5,6',
  153. ),
  154. 'focus' => array
  155. (
  156. 'type' => 'text-255',
  157. 'name' => '焦点图',
  158. 'default' => '',
  159. 'desc' => '焦点图',
  160. 'match' => 'option',
  161. 'update' => 'image',
  162. 'key' => '1',
  163. 'place' => '150',
  164. 'show' => 'type=3',
  165. ),
  166. 'author_id' => array
  167. (
  168. 'type' => 'int-11',
  169. 'name' => '作者',
  170. 'default' => '1',
  171. 'desc' => '作者',
  172. 'match' => 'is_numeric',
  173. 'update' => 'select',
  174. 'option' => $author,
  175. //'search' => 'select',
  176. 'show' => 'type=3',
  177. ),
  178. 'content' => array
  179. (
  180. 'type' => 'text-255',
  181. 'name' => '内容',
  182. 'default' => '',
  183. 'desc' => '请输入内容',
  184. 'match' => 'is_string',
  185. 'update' => 'editor',
  186. 'show' => 'type=3',
  187. //自定义编辑器右侧按钮
  188. 'editor' => array
  189. (
  190. 'name' => '选择插入模块',
  191. 'button' => array
  192. (
  193. array
  194. (
  195. # 名称
  196. 'name' => '图片',
  197. # 资源库id
  198. 'key' => 1,
  199. # 类型
  200. 'type' => 'image',
  201. ),
  202. array
  203. (
  204. 'name' => '音频',
  205. 'key' => 2,
  206. 'type' => 'media',
  207. ),
  208. array
  209. (
  210. 'name' => '视频',
  211. 'key' => 'video/lib/core.vod',
  212. ),
  213. array
  214. (
  215. 'name' => '直播',
  216. 'key' => 'video/lib/core.live',
  217. ),
  218. array
  219. (
  220. 'name' => '小程序',
  221. 'key' => 'content/lib/applet.update',
  222. 'type' => 'update',
  223. ),
  224. ),
  225. ),
  226. ),
  227. 'pic' => array
  228. (
  229. 'type' => 'varchar-150',
  230. 'name' => '图片-全屏图图片尺寸750*1386px或等比尺寸,长图图片尺寸750*高度不限 或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  231. 'default' => '',
  232. 'desc' => '图片',
  233. 'match' => 'option',
  234. 'update' => 'image',
  235. 'key' => '1',
  236. 'place' => '150',
  237. 'show' => 'type=1,2',
  238. ),
  239. 'is_button' => array
  240. (
  241. 'type' => 'int-11',
  242. 'name' => '是否显示保存按钮',
  243. 'default' => '1',
  244. 'desc' => '是否显示保存按钮',
  245. 'match' => 'is_numeric',
  246. 'update' => 'radio',
  247. 'option' => $is_button,
  248. // 'search' => 'select',
  249. 'show' => 'type=1',
  250. 'control' => 'is_button',
  251. ),
  252. 'button_name' => array
  253. (
  254. 'type' => 'varchar-80',
  255. 'name' => '保存按钮文字内容',
  256. 'default' => '保存图片',
  257. 'desc' => '保存按钮文字内容',
  258. 'match' => 'option',
  259. 'update' => 'textarea',
  260. 'show' => 'type=1',
  261. ),
  262. 'button_color' => array
  263. (
  264. 'type' => 'varchar-10',
  265. 'name' => '保存按钮文字颜色',
  266. 'default' => '#000000',
  267. 'desc' => '保存按钮文字颜色',
  268. 'match' => 'option',
  269. 'update' => 'color',
  270. 'show' => 'type=1',
  271. ),
  272. 'article_id' => array
  273. (
  274. 'type' => 'int-11',
  275. 'name' => '关联图文',
  276. 'default' => '',
  277. 'desc' => '关联图文',
  278. 'match' => 'option',
  279. 'update' => 'select',
  280. 'show' => 'type=11',
  281. 'update_search' => 'journal/lib/manage.search_article',
  282. ),
  283. 'vod_id' => array
  284. (
  285. 'type' => 'int-11',
  286. 'name' => '关联视频',
  287. 'default' => '',
  288. 'desc' => '关联视频',
  289. 'match' => 'option',
  290. 'update' => 'select',
  291. 'show' => 'type=12',
  292. 'update_search' => 'journal/lib/manage.search_vod',
  293. ),
  294. 'live_id' => array
  295. (
  296. 'type' => 'int-11',
  297. 'name' => '关联直播',
  298. 'default' => '',
  299. 'desc' => '关联直播',
  300. 'match' => 'option',
  301. 'update' => 'select',
  302. 'show' => 'type=13',
  303. 'update_search' => 'journal/lib/manage.search_live',
  304. ),
  305. 'text' => array
  306. (
  307. 'type' => 'text-1000',
  308. 'name' => '文字设置',
  309. 'default' => '',
  310. 'desc' => '文字设置',
  311. 'match' => 'is_string',
  312. 'option' => $text,
  313. 'show' => 'type=1',
  314. 'update' => array
  315. (
  316. array
  317. (
  318. 'col' => 'name',
  319. 'name' => '文字内容',
  320. 'default' => '',
  321. 'desc' => '文字内容',
  322. 'match' => 'is_string',
  323. 'update' => 'textarea',
  324. ),
  325. array
  326. (
  327. 'col' => 'color',
  328. 'name' => '文字颜色',
  329. 'default' => '#000000',
  330. 'desc' => '文字颜色',
  331. 'match' => 'is_string',
  332. 'update' => 'color',
  333. ),
  334. array
  335. (
  336. 'col' => 'bgcolor_type',
  337. 'name' => '是否设置背景颜色',
  338. 'default' => '2',
  339. 'desc' => '是否设置背景颜色',
  340. 'match' => 'is_string',
  341. 'update' => 'radio',
  342. 'option' => $bgcolor_type,
  343. 'control' => 'bgcolor_type',
  344. ),
  345. array
  346. (
  347. 'col' => 'bgcolor',
  348. 'name' => '背景颜色',
  349. 'default' => '#000000',
  350. 'desc' => '背景颜色',
  351. 'match' => 'is_string',
  352. 'update' => 'color',
  353. 'show' => 'bgcolor_type=1'
  354. ),
  355. array
  356. (
  357. 'col' => 'size',
  358. 'name' => '文字大小-直接输入像素数字',
  359. 'default' => '16',
  360. 'desc' => '结果描述',
  361. 'match' => 'is_numeric',
  362. 'update' => 'text',
  363. ),
  364. ),
  365. ),
  366. 'reorder' => array
  367. (
  368. 'type' => 'int-11',
  369. 'name' => '页号',
  370. 'default' => '1',
  371. 'desc' => '请输入排序',
  372. 'match' => 'option',
  373. //'update' => 'text',
  374. 'search' => 'order',
  375. 'list' => true,
  376. 'order' => 'asc',
  377. 'edit' => true,
  378. ),
  379. 'state' => array
  380. (
  381. 'type' => 'tinyint-1',
  382. 'name' => '状态',
  383. 'default' => '1',
  384. 'desc' => '请选择状态',
  385. 'match' => 'is_numeric',
  386. ),
  387. 'cdate' => array
  388. (
  389. 'type' => 'int-11',
  390. 'name' => '创建时间',
  391. 'match' => array('is_numeric', time()),
  392. 'desc' => '',
  393. # 只有insert时才生效
  394. 'insert' => true,
  395. //'search' => 'date',
  396. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  397. ),
  398. ),
  399. 'manage' => array
  400. (
  401. 'insert' => false,
  402. 'edit' => false,
  403. //'delete' => false,
  404. 'num' => false,
  405. 'page_list_table' => 'journal',
  406. # 自定义快捷新增和编辑
  407. 'button' => array
  408. (
  409. '新增内页' => array('location', 'add'),
  410. '预览' => array('fast', 'main/preview.get?type=4&id=' . Dever::input('search_option_info_id')),
  411. ),
  412. ),
  413. # request 请求接口定义
  414. 'request' => array
  415. (
  416. 'getAll' => array
  417. (
  418. # 匹配的正则或函数 选填项
  419. 'option' => array
  420. (
  421. 'info_id' => 'yes',
  422. 'state' => 1,
  423. ),
  424. 'type' => 'all',
  425. 'order' => array('reorder' => 'asc', 'id' => 'desc'),
  426. 'page' => array(10, 'list'),
  427. 'col' => '*',
  428. ),
  429. 'getAllByReorder' => array
  430. (
  431. # 匹配的正则或函数 选填项
  432. 'option' => array
  433. (
  434. 'info_id' => 'yes',
  435. 'state' => 1,
  436. ),
  437. 'type' => 'one',
  438. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  439. 'col' => '*',
  440. ),
  441. )
  442. );