times.php 6.6 KB

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