pic_water.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <?php
  2. /**
  3. * 上传表
  4. */
  5. # 定义几个常用的选项
  6. $type = array
  7. (
  8. 1 => '图片水印',
  9. //2 => '文字水印',
  10. );
  11. $water = array
  12. (
  13. 1 => '左上',
  14. 2 => '左下',
  15. 3 => '右上',
  16. 4 => '右下',
  17. 5 => '居中',
  18. 6 => '上中',
  19. 7 => '下中',
  20. 8 => '左中',
  21. 9 => '右中',
  22. 10 => '平铺',
  23. );
  24. return array
  25. (
  26. # 表名
  27. 'name' => 'pic_water',
  28. # 显示给用户看的名称
  29. 'lang' => '图片水印配置',
  30. 'menu' => false,
  31. # 数据结构
  32. 'struct' => array
  33. (
  34. 'id' => array
  35. (
  36. 'type' => 'int-11',
  37. 'name' => '配置ID',
  38. 'default' => '',
  39. 'desc' => '',
  40. 'match' => 'is_numeric',
  41. 'search' => 'order',
  42. 'list' => true,
  43. ),
  44. 'name' => array
  45. (
  46. 'type' => 'varchar-24',
  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' => 'tinyint-1',
  58. 'name' => '水印类型',
  59. 'default' => '1',
  60. 'desc' => '水印类型',
  61. 'match' => 'is_numeric',
  62. 'update' => 'radio',
  63. 'option' => $type,
  64. 'list' => true,
  65. 'control' => 'type',
  66. ),
  67. 'water' => array
  68. (
  69. 'type' => 'varchar-150',
  70. 'name' => '水印图',
  71. 'default' => '',
  72. 'desc' => '请选择水印图',
  73. 'match' => 'option',
  74. 'update' => 'image',
  75. 'key' => '1',
  76. 'place' => '150X150',
  77. 'show' => 'type=1',
  78. ),
  79. 'water_position' => array
  80. (
  81. 'type' => 'int-1',
  82. 'name' => '水印位置',
  83. 'default' => '1',
  84. 'desc' => '请选择水印位置',
  85. 'match' => 'is_numeric',
  86. 'option' => $water,
  87. 'update' => 'select',
  88. //'list' => true,
  89. ),
  90. 'state' => array
  91. (
  92. 'type' => 'tinyint-1',
  93. 'name' => '状态',
  94. 'default' => '1',
  95. 'desc' => '请选择状态',
  96. 'match' => 'is_numeric',
  97. ),
  98. 'cdate' => array
  99. (
  100. 'type' => 'int-11',
  101. 'name' => '录入时间',
  102. 'match' => array('is_numeric', time()),
  103. 'desc' => '',
  104. # 只有insert时才生效
  105. 'insert' => true,
  106. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  107. ),
  108. ),
  109. # request 请求接口定义
  110. 'request' => array
  111. (
  112. # info 取一条正常的数据
  113. 'info' => array
  114. (
  115. # 匹配的正则或函数 必填项
  116. 'where' => array
  117. (
  118. 'id' => 'is_numeric',
  119. 'state' => 1,
  120. ),
  121. 'type' => 'one',
  122. ),
  123. ),
  124. );