pic_water.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <?php
  2. /**
  3. * 上传表
  4. */
  5. # 定义几个常用的选项
  6. $option = 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. );
  21. return array
  22. (
  23. # 表名
  24. 'name' => 'pic_water',
  25. # 显示给用户看的名称
  26. 'lang' => '图片水印配置',
  27. 'menu' => false,
  28. # 数据结构
  29. 'struct' => array
  30. (
  31. 'id' => array
  32. (
  33. 'type' => 'int-11',
  34. 'name' => '配置ID',
  35. 'default' => '',
  36. 'desc' => '',
  37. 'match' => 'is_numeric',
  38. 'search' => 'order',
  39. 'list' => true,
  40. ),
  41. 'name' => array
  42. (
  43. 'type' => 'varchar-24',
  44. 'name' => '配置名',
  45. 'default' => '',
  46. 'desc' => '请输入配置名',
  47. 'match' => 'is_string',
  48. 'update' => 'text',
  49. 'search' => 'fulltext',
  50. 'list' => true,
  51. ),
  52. 'water' => array
  53. (
  54. 'type' => 'varchar-150',
  55. 'name' => '水印图',
  56. 'default' => '',
  57. 'desc' => '请选择水印图',
  58. 'match' => 'option',
  59. 'update' => 'image',
  60. 'key' => '1',
  61. 'place' => '150X150',
  62. ),
  63. 'water_position' => array
  64. (
  65. 'type' => 'int-1',
  66. 'name' => '水印图位置',
  67. 'default' => '1',
  68. 'desc' => '请选择水印图位置',
  69. 'match' => 'is_numeric',
  70. 'option' => $water,
  71. 'update' => 'select',
  72. //'list' => true,
  73. ),
  74. 'state' => array
  75. (
  76. 'type' => 'tinyint-1',
  77. 'name' => '状态',
  78. 'default' => '1',
  79. 'desc' => '请选择状态',
  80. 'match' => 'is_numeric',
  81. ),
  82. 'cdate' => array
  83. (
  84. 'type' => 'int-11',
  85. 'name' => '录入时间',
  86. 'match' => array('is_numeric', time()),
  87. 'desc' => '',
  88. # 只有insert时才生效
  89. 'insert' => true,
  90. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  91. ),
  92. ),
  93. # request 请求接口定义
  94. 'request' => array
  95. (
  96. # info 取一条正常的数据
  97. 'info' => array
  98. (
  99. # 匹配的正则或函数 必填项
  100. 'where' => array
  101. (
  102. 'id' => 'is_numeric',
  103. 'state' => 1,
  104. ),
  105. 'type' => 'one',
  106. ),
  107. ),
  108. );