pic_grid.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <?php
  2. $status = Dever::config('base')->status;
  3. $palaces = array
  4. (
  5. 1 => '上左',
  6. 2 => '上右',
  7. 3 => '下左',
  8. 4 => '下右',
  9. );
  10. return array
  11. (
  12. # 表名
  13. 'name' => 'pic_grid',
  14. # 显示给用户看的名称
  15. 'lang' => '四宫格图片',
  16. 'order' => 100,
  17. 'menu' => false,
  18. # 数据结构
  19. 'struct' => array
  20. (
  21. 'id' => array
  22. (
  23. 'type' => 'int-11',
  24. 'name' => 'ID',
  25. 'default' => '',
  26. 'desc' => '',
  27. 'match' => 'is_numeric',
  28. //'list' => true,
  29. ),
  30. 'info_id' => array
  31. (
  32. 'type' => 'int-11',
  33. 'name' => '合集',
  34. 'default' => '',
  35. 'desc' => '合集',
  36. 'match' => 'is_numeric',
  37. 'update' => 'hidden',
  38. 'value' => Dever::input('search_option_info_id')
  39. ),
  40. 'content_id' => array
  41. (
  42. 'type' => 'int-11',
  43. 'name' => '合集内容id',
  44. 'default' => '',
  45. 'desc' => '合集内容id',
  46. 'match' => 'is_numeric',
  47. 'update' => 'hidden',
  48. 'value' => Dever::input('search_option_content_id')
  49. ),
  50. 'text' => array
  51. (
  52. 'type' => 'text-1000',
  53. 'name' => '四宫格图片',
  54. 'default' => '',
  55. 'desc' => '四宫格图片',
  56. 'match' => 'is_string',
  57. 'option' => $palaces,
  58. 'show' => 'type=13',
  59. 'list' => 'Dever::load("content/lib/manage.picGrid", "{text}")',
  60. 'update' => array
  61. (
  62. array
  63. (
  64. 'col' => 'pic',
  65. 'name' => '图片',
  66. 'default' => '',
  67. 'desc' => '图片',
  68. 'match' => 'is_string',
  69. 'update' => 'image',
  70. 'key' => 1,
  71. ),
  72. ),
  73. ),
  74. 'udate' => array
  75. (
  76. 'type' => 'int-11',
  77. 'name' => '更新时间',
  78. 'match' => array('is_numeric', time()),
  79. 'desc' => '',
  80. ),
  81. 'status' => array
  82. (
  83. 'type' => 'int-11',
  84. 'name' => '发布状态',
  85. 'default' => '1',
  86. 'desc' => '发布状态',
  87. 'match' => 'is_numeric',
  88. //'update' => 'select',
  89. 'option' => $status,
  90. //'search' => 'select',
  91. //'list' => true,
  92. //'edit' => true,
  93. ),
  94. 'reorder' => array
  95. (
  96. 'type' => 'int-11',
  97. 'name' => '排序(数值越大越靠前)',
  98. 'default' => '1',
  99. 'desc' => '请输入排序',
  100. 'match' => 'option',
  101. //'update' => 'text',
  102. 'search' => 'order',
  103. 'list' => true,
  104. 'order' => 'desc',
  105. 'edit' => true,
  106. ),
  107. 'state' => array
  108. (
  109. 'type' => 'tinyint-1',
  110. 'name' => '状态',
  111. 'default' => '1',
  112. 'desc' => '请选择状态',
  113. 'match' => 'is_numeric',
  114. ),
  115. 'cdate' => array
  116. (
  117. 'type' => 'int-11',
  118. 'name' => '录入时间',
  119. 'match' => array('is_numeric', time()),
  120. 'desc' => '',
  121. # 只有insert时才生效
  122. 'insert' => true,
  123. ),
  124. ),
  125. # 管理功能
  126. 'manage' => array
  127. (
  128. ),
  129. # request 请求接口定义
  130. 'request' => array
  131. (
  132. 'getAll' => array
  133. (
  134. # 匹配的正则或函数 选填项
  135. 'option' => array
  136. (
  137. 'info_id' => 'yes',
  138. 'content_id' => 'yes',
  139. 'state' => 1,
  140. ),
  141. 'type' => 'all',
  142. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  143. 'col' => '*',
  144. ),
  145. ),
  146. );