content.php 10 KB

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