template.php 2.9 KB

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