content.php 11 KB

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