content.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  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. ),
  169. ),
  170. ),
  171. 'pic' => array
  172. (
  173. 'type' => 'varchar-150',
  174. 'name' => '图片-全屏图图片尺寸750*1386px或等比尺寸,长图图片尺寸750*高度不限 或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  175. 'default' => '',
  176. 'desc' => '图片',
  177. 'match' => 'option',
  178. 'update' => 'image',
  179. 'key' => '1',
  180. 'place' => '150',
  181. 'show' => 'type=1,2',
  182. ),
  183. 'is_button' => array
  184. (
  185. 'type' => 'int-11',
  186. 'name' => '是否显示保存按钮',
  187. 'default' => '1',
  188. 'desc' => '是否显示保存按钮',
  189. 'match' => 'is_numeric',
  190. 'update' => 'radio',
  191. 'option' => $is_button,
  192. // 'search' => 'select',
  193. 'show' => 'type=1',
  194. 'control' => 'is_button',
  195. ),
  196. 'button_name' => array
  197. (
  198. 'type' => 'varchar-80',
  199. 'name' => '保存按钮文字内容',
  200. 'default' => '保存图片',
  201. 'desc' => '保存按钮文字内容',
  202. 'match' => 'option',
  203. 'update' => 'textarea',
  204. 'show' => 'type=1',
  205. ),
  206. 'button_color' => array
  207. (
  208. 'type' => 'varchar-10',
  209. 'name' => '保存按钮文字颜色',
  210. 'default' => '#000000',
  211. 'desc' => '保存按钮文字颜色',
  212. 'match' => 'option',
  213. 'update' => 'color',
  214. 'show' => 'type=1',
  215. ),
  216. 'article_id' => array
  217. (
  218. 'type' => 'int-11',
  219. 'name' => '关联图文',
  220. 'default' => '',
  221. 'desc' => '关联图文',
  222. 'match' => 'option',
  223. 'update' => 'select',
  224. 'show' => 'type=11',
  225. 'update_search' => 'journal/lib/manage.search_article',
  226. ),
  227. 'vod_id' => array
  228. (
  229. 'type' => 'int-11',
  230. 'name' => '关联视频',
  231. 'default' => '',
  232. 'desc' => '关联视频',
  233. 'match' => 'option',
  234. 'update' => 'select',
  235. 'show' => 'type=12',
  236. 'update_search' => 'journal/lib/manage.search_vod',
  237. ),
  238. 'live_id' => array
  239. (
  240. 'type' => 'int-11',
  241. 'name' => '关联直播',
  242. 'default' => '',
  243. 'desc' => '关联直播',
  244. 'match' => 'option',
  245. 'update' => 'select',
  246. 'show' => 'type=13',
  247. 'update_search' => 'journal/lib/manage.search_live',
  248. ),
  249. 'text' => array
  250. (
  251. 'type' => 'text-1000',
  252. 'name' => '文字设置',
  253. 'default' => '',
  254. 'desc' => '文字设置',
  255. 'match' => 'is_string',
  256. 'option' => $text,
  257. 'show' => 'type=1',
  258. 'update' => array
  259. (
  260. array
  261. (
  262. 'col' => 'name',
  263. 'name' => '文字内容',
  264. 'default' => '',
  265. 'desc' => '文字内容',
  266. 'match' => 'is_string',
  267. 'update' => 'textarea',
  268. ),
  269. array
  270. (
  271. 'col' => 'color',
  272. 'name' => '文字颜色',
  273. 'default' => '#000000',
  274. 'desc' => '文字颜色',
  275. 'match' => 'is_string',
  276. 'update' => 'color',
  277. ),
  278. array
  279. (
  280. 'col' => 'bgcolor_type',
  281. 'name' => '是否设置背景颜色',
  282. 'default' => '2',
  283. 'desc' => '是否设置背景颜色',
  284. 'match' => 'is_string',
  285. 'update' => 'radio',
  286. 'option' => $bgcolor_type,
  287. 'control' => 'bgcolor_type',
  288. ),
  289. array
  290. (
  291. 'col' => 'bgcolor',
  292. 'name' => '背景颜色',
  293. 'default' => '#000000',
  294. 'desc' => '背景颜色',
  295. 'match' => 'is_string',
  296. 'update' => 'color',
  297. 'show' => 'bgcolor_type=1'
  298. ),
  299. array
  300. (
  301. 'col' => 'size',
  302. 'name' => '文字大小-直接输入像素数字',
  303. 'default' => '16',
  304. 'desc' => '结果描述',
  305. 'match' => 'is_numeric',
  306. 'update' => 'text',
  307. ),
  308. ),
  309. ),
  310. 'reorder' => array
  311. (
  312. 'type' => 'int-11',
  313. 'name' => '页号',
  314. 'default' => '1',
  315. 'desc' => '请输入排序',
  316. 'match' => 'option',
  317. //'update' => 'text',
  318. 'search' => 'order',
  319. 'list' => true,
  320. 'order' => 'asc',
  321. 'edit' => true,
  322. ),
  323. 'state' => array
  324. (
  325. 'type' => 'tinyint-1',
  326. 'name' => '状态',
  327. 'default' => '1',
  328. 'desc' => '请选择状态',
  329. 'match' => 'is_numeric',
  330. ),
  331. 'cdate' => array
  332. (
  333. 'type' => 'int-11',
  334. 'name' => '创建时间',
  335. 'match' => array('is_numeric', time()),
  336. 'desc' => '',
  337. # 只有insert时才生效
  338. 'insert' => true,
  339. 'search' => 'date',
  340. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  341. ),
  342. ),
  343. 'manage' => array
  344. (
  345. 'insert' => false,
  346. 'edit' => false,
  347. //'delete' => false,
  348. 'num' => false,
  349. 'page_list_table' => 'journal',
  350. # 自定义快捷新增和编辑
  351. 'button' => array
  352. (
  353. '新增内页' => array('location', 'add'),
  354. '预览' => array('fast', 'main/preview.get?type=4&id=' . Dever::input('search_option_info_id')),
  355. ),
  356. ),
  357. # request 请求接口定义
  358. 'request' => array
  359. (
  360. 'getAll' => array
  361. (
  362. # 匹配的正则或函数 选填项
  363. 'option' => array
  364. (
  365. 'info_id' => 'yes',
  366. 'state' => 1,
  367. ),
  368. 'type' => 'all',
  369. 'order' => array('reorder' => 'asc', 'id' => 'desc'),
  370. 'page' => array(10, 'list'),
  371. 'col' => '*',
  372. ),
  373. 'getAllByReorder' => array
  374. (
  375. # 匹配的正则或函数 选填项
  376. 'option' => array
  377. (
  378. 'info_id' => 'yes',
  379. 'state' => 1,
  380. ),
  381. 'type' => 'one',
  382. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  383. 'col' => '*',
  384. ),
  385. )
  386. );