times.php 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. <?php
  2. $parent_id = Dever::input('option_parent_id', -1);
  3. return array
  4. (
  5. # 表名
  6. 'name' => 'times',
  7. # 显示给用户看的名称
  8. 'lang' => '时光管理',
  9. # 是否显示在后台菜单
  10. 'order' => 1,
  11. 'menu' => false,
  12. # 数据结构
  13. 'struct' => array
  14. (
  15. 'id' => array
  16. (
  17. 'type' => 'int-11',
  18. 'name' => 'ID',
  19. 'default' => '',
  20. 'desc' => '',
  21. 'match' => 'is_numeric',
  22. 'order' => 'asc',
  23. 'list' => true,
  24. ),
  25. 'info_id' => array
  26. (
  27. 'type' => 'int-11',
  28. 'name' => '合集',
  29. 'default' => '',
  30. 'desc' => '合集',
  31. 'match' => 'is_numeric',
  32. 'update' => 'hidden',
  33. 'value' => Dever::input('search_option_info_id')
  34. ),
  35. 'source_id' => array
  36. (
  37. 'type' => 'int-11',
  38. 'name' => '来源id-一般为采集器的采集规则id,用以区分导入的数据是否重复',
  39. 'default' => '-1',
  40. 'desc' => '来源id',
  41. 'match' => 'is_numeric',
  42. ),
  43. 'name' => array
  44. (
  45. 'type' => 'varchar-150',
  46. 'name' => '时光名称',
  47. 'default' => '',
  48. 'desc' => '时光名称',
  49. 'match' => 'is_string',
  50. 'update' => 'text',
  51. 'search' => 'fulltext',
  52. 'list' => true,
  53. 'edit' => true,
  54. ),
  55. 'year' => array
  56. (
  57. 'type' => 'int-11',
  58. 'name' => '开始年份-影响当前时光下所有发布内容的时间,如果用户未选择时间,则自动使用开始年份作为时间的年份',
  59. 'default' => '',
  60. 'desc' => '年份',
  61. 'match' => 'is_numeric',
  62. 'update' => $parent_id < 0 ? 'hidden': 'year',
  63. 'search' => 'text',
  64. //'order' => 'desc',
  65. 'list' => true,
  66. ),
  67. 'end_year' => array
  68. (
  69. 'type' => 'int-11',
  70. 'name' => '结束年份-影响当前时光下所有发布内容的时间',
  71. 'default' => '',
  72. 'desc' => '年份',
  73. 'match' => 'option',
  74. 'update' => $parent_id < 0 ? 'hidden': 'year',
  75. 'search' => 'text',
  76. 'order' => 'desc',
  77. 'list' => true,
  78. ),
  79. 'parent_id' => array
  80. (
  81. 'type' => 'int-11',
  82. 'name' => '上级时光',
  83. 'default' => '-1',
  84. 'desc' => '请选择上级时光',
  85. 'match' => 'is_numeric',
  86. 'update' => 'hidden',
  87. 'value' => $parent_id,
  88. 'list' => '{parent_id} > 0 ? Dever::load("collection/times-one#name", {parent_id}) : "主时间线"',
  89. ),
  90. 'icon' => array
  91. (
  92. 'type' => 'varchar-150',
  93. 'name' => '时光图标-图片尺寸80*80px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  94. 'default' => '',
  95. 'desc' => '时光图标',
  96. 'match' => 'option',
  97. 'update' => $parent_id < 0 ? 'hidden': 'image',
  98. 'key' => '1',
  99. 'place' => '80*80',
  100. ),
  101. 'pic' => array
  102. (
  103. 'type' => 'varchar-150',
  104. 'name' => '图片-图片尺寸330*330px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  105. 'default' => '',
  106. 'desc' => '图片',
  107. 'match' => 'option',
  108. 'update' => $parent_id < 0 ? 'hidden': 'image',
  109. 'key' => '1',
  110. 'place' => '330*330',
  111. ),
  112. 'desc' => array
  113. (
  114. 'type' => 'varchar-800',
  115. 'name' => '描述',
  116. 'default' => '',
  117. 'desc' => '描述',
  118. 'match' => 'option',
  119. 'update' => $parent_id < 0 ? 'hidden': 'text',
  120. //'list' => true,
  121. ),
  122. 'color' => array
  123. (
  124. 'type' => 'varchar-10',
  125. 'name' => '文字颜色-默认为白色',
  126. 'default' => '#ffffff',
  127. 'desc' => '文字颜色',
  128. 'match' => 'is_string',
  129. 'update' => $parent_id < 0 ? 'hidden': 'color',
  130. ),
  131. 'bgcolor' => array
  132. (
  133. 'type' => 'varchar-10',
  134. 'name' => '背景颜色-默认为灰色',
  135. 'default' => '#cccccc',
  136. 'desc' => '背景颜色',
  137. 'match' => 'is_string',
  138. 'update' => $parent_id < 0 ? 'hidden': 'color',
  139. ),
  140. 'reorder' => array
  141. (
  142. 'type' => 'int-11',
  143. 'name' => '排序(数值越小越靠前)',
  144. 'default' => '1',
  145. 'desc' => '请输入排序',
  146. 'match' => 'option',
  147. 'update' => 'text',
  148. 'search' => 'order',
  149. 'list_name' => '排序',
  150. 'list' => true,
  151. 'order' => 'asc',
  152. 'edit' => true,
  153. ),
  154. 'state' => array
  155. (
  156. 'type' => 'tinyint-1',
  157. 'name' => '状态',
  158. 'default' => '1',
  159. 'desc' => '请选择状态',
  160. 'match' => 'is_numeric',
  161. ),
  162. 'cdate' => array
  163. (
  164. 'type' => 'int-11',
  165. 'name' => '录入时间',
  166. 'match' => array('is_numeric', time()),
  167. 'desc' => '',
  168. # 只有insert时才生效
  169. 'insert' => true,
  170. 'order' => 'asc',
  171. //'search' => 'date',
  172. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  173. ),
  174. ),
  175. 'manage' => array
  176. (
  177. # 列表页的类型
  178. 'list_type' => 'tree',
  179. 'list_button' => array
  180. (
  181. 'update' => array('编辑', 'times&option_parent_id={parent_id}'),
  182. 'add' => array('新增时间线', '"{parent_id}" == -1 ? "times&option_parent_id={id}" : "times&option_parent_id={parent_id},{id}"', '{parent_id} == -1'),
  183. 'list5' => array('章节', '"page&search_option_info_id={info_id}&search_option_times_id_parent={times_id}&search_option_times_id={id}&oper_table=times&top_table=info"' , '{parent_id} > 0'),
  184. 'delete' => '删除',
  185. ),
  186. ),
  187. 'request' => array
  188. (
  189. 'child' => array
  190. (
  191. 'option' => array
  192. (
  193. 'state' => 1,
  194. 'parent_id' => 'yes',
  195. 'info_id' => 'yes',
  196. ),
  197. 'type' => 'all',
  198. 'order' => array('year' => 'asc', 'reorder' => 'asc', 'id' => 'asc'),
  199. 'col' => '*',
  200. ),
  201. 'main' => array
  202. (
  203. 'option' => array
  204. (
  205. 'state' => 1,
  206. 'parent_id' => -1,
  207. 'info_id' => 'yes',
  208. ),
  209. 'type' => 'all',
  210. 'order' => array('year' => 'asc', 'reorder' => 'asc', 'id' => 'asc'),
  211. 'col' => '*',
  212. ),
  213. 'mainAll' => array
  214. (
  215. 'option' => array
  216. (
  217. 'state' => 1,
  218. 'parent_id' => -1,
  219. 'info_id' => 'yes',
  220. ),
  221. 'type' => 'all',
  222. 'order' => array('year' => 'asc', 'reorder' => 'asc', 'id' => 'asc'),
  223. 'col' => '*|id',
  224. ),
  225. # 取所有下级
  226. 'childAll' => array
  227. (
  228. 'option' => array
  229. (
  230. 'parent_id' => array(1, '>='),
  231. 'info_id' => 'yes',
  232. 'state' => 1,
  233. ),
  234. 'type' => 'all',
  235. 'order' => array('year' => 'asc', 'reorder' => 'asc', 'id' => 'asc'),
  236. 'col' => '*|parent_id|id|',
  237. ),
  238. 'getNew' => array
  239. (
  240. 'option' => array
  241. (
  242. 'state' => 1,
  243. 'parent_id' => array(1, '>='),
  244. 'year' => 'yes',
  245. 'info_id' => 'yes',
  246. ),
  247. 'type' => 'one',
  248. 'order' => array('year' => 'asc', 'reorder' => 'asc', 'id' => 'asc'),
  249. 'col' => '*',
  250. ),
  251. )
  252. );