template.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <?php
  2. $type = array
  3. (
  4. 'gd' => 'GD库',
  5. 'im' => 'ImageMagic库',
  6. );
  7. $update = array
  8. (
  9. 1 => '每次访问都生成',
  10. 2 => '仅生成一次',
  11. );
  12. $create = array
  13. (
  14. 1 => '自动生成空白图',
  15. 2 => '手动上传',
  16. );
  17. return array
  18. (
  19. # 表名
  20. 'name' => 'template',
  21. # 显示给用户看的名称
  22. 'lang' => '模板设置',
  23. 'order' => 20,
  24. //'check' => 'key',
  25. # 数据结构
  26. 'struct' => array
  27. (
  28. 'id' => array
  29. (
  30. 'type' => 'int-11',
  31. 'name' => 'ID',
  32. 'default' => '',
  33. 'desc' => '',
  34. 'match' => 'is_numeric',
  35. 'search' => 'order',
  36. //'list' => true,
  37. ),
  38. 'name' => array
  39. (
  40. 'type' => 'varchar-32',
  41. 'name' => '模板名称',
  42. 'default' => '',
  43. 'desc' => '模板名称',
  44. 'match' => 'is_string',
  45. 'update' => 'text',
  46. 'search' => 'fulltext',
  47. 'list' => true,
  48. ),
  49. 'key' => array
  50. (
  51. 'type' => 'varchar-32',
  52. 'name' => '模板标识-调用模板时,使用该标识来获取模板信息,相同的模板标识,将随机抽取一条',
  53. 'default' => '',
  54. 'desc' => '模板标识',
  55. 'match' => 'is_string',
  56. 'update' => 'text',
  57. 'search' => 'fulltext',
  58. 'list' => true,
  59. ),
  60. 'type' => array
  61. (
  62. 'type' => 'varchar-32',
  63. 'name' => '使用的图形库',
  64. 'default' => 'gd',
  65. 'desc' => '使用的图形库',
  66. 'match' => 'is_string',
  67. 'update' => 'select',
  68. 'option' => $type,
  69. 'search' => 'select',
  70. ),
  71. 'update' => array
  72. (
  73. 'type' => 'tinyint-1',
  74. 'name' => '生成规则',
  75. 'default' => '2',
  76. 'desc' => '生成规则',
  77. 'match' => 'is_numeric',
  78. 'update' => 'select',
  79. 'option' => $update,
  80. ),
  81. 'create' => array
  82. (
  83. 'type' => 'int-11',
  84. 'name' => '模板背景图',
  85. 'default' => '2',
  86. 'desc' => '模板背景图',
  87. 'match' => 'is_numeric',
  88. 'update' => 'radio',
  89. 'option' => $create,
  90. 'search' => 'select',
  91. 'control' => 'create',
  92. ),
  93. 'width' => array
  94. (
  95. 'type' => 'varchar-11',
  96. 'name' => '背景图宽度',
  97. 'default' => '300',
  98. 'desc' => '背景图宽度',
  99. 'match' => 'is_string',
  100. 'update' => 'text',
  101. 'show' => 'create=1',
  102. ),
  103. 'height' => array
  104. (
  105. 'type' => 'varchar-11',
  106. 'name' => '背景图高度',
  107. 'default' => '300',
  108. 'desc' => '背景图高度',
  109. 'match' => 'is_string',
  110. 'update' => 'text',
  111. 'show' => 'create=1',
  112. ),
  113. 'background' => array
  114. (
  115. 'type' => 'varchar-150',
  116. 'name' => '模板背景图',
  117. 'default' => '',
  118. 'desc' => '模板背景图',
  119. 'match' => 'is_string',
  120. 'update' => 'image',
  121. 'key' => '1',
  122. 'show' => 'create=2',
  123. ),
  124. 'pic' => array
  125. (
  126. 'type' => 'varchar-150',
  127. 'name' => '样例图',
  128. 'default' => '',
  129. 'desc' => '样例图',
  130. 'match' => 'option',
  131. 'update' => 'image',
  132. 'key' => '1',
  133. ),
  134. 'state' => array
  135. (
  136. 'type' => 'tinyint-1',
  137. 'name' => '状态',
  138. 'default' => '1',
  139. 'desc' => '请选择状态',
  140. 'match' => 'is_numeric',
  141. ),
  142. 'cdate' => array
  143. (
  144. 'type' => 'int-11',
  145. 'name' => '录入时间',
  146. 'match' => array('is_numeric', time()),
  147. 'desc' => '',
  148. # 只有insert时才生效
  149. 'insert' => true,
  150. 'search' => 'date',
  151. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  152. ),
  153. ),
  154. # 管理功能
  155. 'manage' => array
  156. (
  157. # 列表
  158. 'list_button' => array
  159. (
  160. 'list' => array('设计', '"model&project=poster&search_option_template_id={id}&oper_parent=template&oper_project=poster&page_type=1"'),
  161. ),
  162. ),
  163. 'request' => array
  164. (
  165. 'getAll' => array
  166. (
  167. # 匹配的正则或函数 选填项
  168. 'option' => array
  169. (
  170. 'key' => 'yes',
  171. 'ids' => array('yes-id', 'in'),
  172. 'state' => 1,
  173. ),
  174. 'type' => 'all',
  175. 'order' => array('id' => 'desc'),
  176. 'col' => '*',
  177. ),
  178. )
  179. );