content.php 12 KB

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