content.php 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  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. $author = function()
  17. {
  18. $array = array();
  19. $info = Dever::db('content/author')->state();
  20. if($info)
  21. {
  22. $array += $info;
  23. }
  24. return $array;
  25. };
  26. return array
  27. (
  28. # 表名
  29. 'name' => 'content',
  30. # 显示给用户看的名称
  31. 'lang' => '内页管理',
  32. 'menu' => false,
  33. 'gettype' => $type,
  34. # 数据结构
  35. 'struct' => array
  36. (
  37. 'id' => array
  38. (
  39. 'type' => 'int-11',
  40. 'name' => 'ID',
  41. 'default' => '',
  42. 'desc' => '',
  43. 'match' => 'is_numeric',
  44. //'search' => 'order',
  45. //'list' => true,
  46. ),
  47. 'info_id' => array
  48. (
  49. 'type' => 'int-11',
  50. 'name' => '小刊',
  51. 'default' => '',
  52. 'desc' => '小刊',
  53. 'match' => 'is_numeric',
  54. 'update' => 'hidden',
  55. 'value' => Dever::input('search_option_info_id')
  56. ),
  57. 'type' => array
  58. (
  59. 'type' => 'int-11',
  60. 'name' => '类型',
  61. 'default' => '3',
  62. 'desc' => '类型',
  63. 'match' => 'is_numeric',
  64. 'update' => 'radio',
  65. 'option' => $type,
  66. 'control' => 'type',
  67. ),
  68. 'name' => array
  69. (
  70. 'type' => 'varchar-80',
  71. 'name' => '标题',
  72. 'default' => '',
  73. 'desc' => '标题',
  74. 'match' => 'is_string',
  75. 'update' => 'text',
  76. 'list' => true,
  77. //增加预览
  78. 'preview' => true,
  79. 'show' => 'type=3',
  80. ),
  81. 'focus' => array
  82. (
  83. 'type' => 'text-255',
  84. 'name' => '焦点图',
  85. 'default' => '',
  86. 'desc' => '焦点图',
  87. 'match' => 'option',
  88. 'update' => 'image',
  89. 'key' => '1',
  90. 'place' => '150',
  91. 'show' => 'type=3',
  92. ),
  93. 'author_id' => array
  94. (
  95. 'type' => 'int-11',
  96. 'name' => '作者',
  97. 'default' => '1',
  98. 'desc' => '作者',
  99. 'match' => 'is_numeric',
  100. 'update' => 'select',
  101. 'option' => $author,
  102. //'search' => 'select',
  103. 'show' => 'type=3',
  104. ),
  105. 'content' => array
  106. (
  107. 'type' => 'text-255',
  108. 'name' => '内容',
  109. 'default' => '',
  110. 'desc' => '请输入内容',
  111. 'match' => 'is_string',
  112. 'update' => 'editor',
  113. 'show' => 'type=3',
  114. //自定义编辑器右侧按钮
  115. 'editor' => array
  116. (
  117. 'name' => '选择插入模块',
  118. 'button' => array
  119. (
  120. array
  121. (
  122. # 名称
  123. 'name' => '图片',
  124. # 资源库id
  125. 'key' => 1,
  126. # 类型
  127. 'type' => 'image',
  128. ),
  129. array
  130. (
  131. 'name' => '音频',
  132. 'key' => 2,
  133. 'type' => 'media',
  134. ),
  135. array
  136. (
  137. 'name' => '视频',
  138. 'key' => 'video/lib/core.vod',
  139. ),
  140. array
  141. (
  142. 'name' => '直播',
  143. 'key' => 'video/lib/core.live',
  144. ),
  145. ),
  146. ),
  147. ),
  148. 'pic' => array
  149. (
  150. 'type' => 'varchar-150',
  151. 'name' => '图片',
  152. 'default' => '',
  153. 'desc' => '图片',
  154. 'match' => 'option',
  155. 'update' => 'image',
  156. 'key' => '1',
  157. 'place' => '150',
  158. 'show' => 'type=1,2',
  159. ),
  160. 'is_button' => array
  161. (
  162. 'type' => 'int-11',
  163. 'name' => '是否显示保存按钮',
  164. 'default' => '1',
  165. 'desc' => '是否显示保存按钮',
  166. 'match' => 'is_numeric',
  167. 'update' => 'radio',
  168. 'option' => $is_button,
  169. // 'search' => 'select',
  170. 'show' => 'type=1',
  171. 'control' => 'is_button',
  172. ),
  173. 'button_name' => array
  174. (
  175. 'type' => 'varchar-80',
  176. 'name' => '保存按钮文字内容',
  177. 'default' => '保存图片',
  178. 'desc' => '保存按钮文字内容',
  179. 'match' => 'option',
  180. 'update' => 'textarea',
  181. 'show' => 'type=1',
  182. ),
  183. 'button_color' => array
  184. (
  185. 'type' => 'varchar-10',
  186. 'name' => '保存按钮文字颜色',
  187. 'default' => '#000000',
  188. 'desc' => '保存按钮文字颜色',
  189. 'match' => 'option',
  190. 'update' => 'color',
  191. 'show' => 'type=1',
  192. ),
  193. 'article_id' => array
  194. (
  195. 'type' => 'int-11',
  196. 'name' => '关联图文',
  197. 'default' => '',
  198. 'desc' => '关联图文',
  199. 'match' => 'option',
  200. 'update' => 'select',
  201. 'show' => 'type=11',
  202. 'update_search' => 'journal/lib/manage.search_article',
  203. ),
  204. 'vod_id' => array
  205. (
  206. 'type' => 'int-11',
  207. 'name' => '关联视频',
  208. 'default' => '',
  209. 'desc' => '关联视频',
  210. 'match' => 'option',
  211. 'update' => 'select',
  212. 'show' => 'type=12',
  213. 'update_search' => 'journal/lib/manage.search_vod',
  214. ),
  215. 'live_id' => array
  216. (
  217. 'type' => 'int-11',
  218. 'name' => '关联直播',
  219. 'default' => '',
  220. 'desc' => '关联直播',
  221. 'match' => 'option',
  222. 'update' => 'select',
  223. 'show' => 'type=13',
  224. 'update_search' => 'journal/lib/manage.search_live',
  225. ),
  226. 'reorder' => array
  227. (
  228. 'type' => 'int-11',
  229. 'name' => '页号',
  230. 'default' => '1',
  231. 'desc' => '请输入排序',
  232. 'match' => 'option',
  233. //'update' => 'text',
  234. 'search' => 'order',
  235. 'list' => true,
  236. 'order' => 'asc',
  237. 'edit' => true,
  238. ),
  239. 'state' => array
  240. (
  241. 'type' => 'tinyint-1',
  242. 'name' => '状态',
  243. 'default' => '1',
  244. 'desc' => '请选择状态',
  245. 'match' => 'is_numeric',
  246. ),
  247. 'cdate' => array
  248. (
  249. 'type' => 'int-11',
  250. 'name' => '创建时间',
  251. 'match' => array('is_numeric', time()),
  252. 'desc' => '',
  253. # 只有insert时才生效
  254. 'insert' => true,
  255. 'search' => 'date',
  256. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  257. ),
  258. ),
  259. 'manage' => array
  260. (
  261. 'insert' => false,
  262. 'edit' => false,
  263. //'delete' => false,
  264. 'num' => false,
  265. 'page_list_table' => 'journal',
  266. # 自定义快捷新增和编辑
  267. 'button' => array
  268. (
  269. '新增内页' => array('fasts'),
  270. '预览' => array('fast', 'main/preview.get?type=4&id=' . Dever::input('search_option_info_id')),
  271. ),
  272. ),
  273. );