content.php 11 KB

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