link.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <?php
  2. # 定义几个常用的选项
  3. $option = array
  4. (
  5. 1 => '开启',
  6. 2 => '关闭',
  7. );
  8. return array
  9. (
  10. # 表名
  11. 'name' => 'link',
  12. # 显示给用户看的名称
  13. 'lang' => '友情链接',
  14. 'order' => 8,
  15. # 数据结构
  16. 'struct' => array
  17. (
  18. 'id' => array
  19. (
  20. 'type' => 'int-11',
  21. 'name' => '友情链接ID',
  22. 'default' => '',
  23. 'desc' => '',
  24. 'match' => 'is_numeric',
  25. 'search' => 'order',
  26. 'list' => true,
  27. ),
  28. 'name' => array
  29. (
  30. 'type' => 'varchar-24',
  31. 'name' => '友情链接名称',
  32. 'default' => '',
  33. 'desc' => '请输入友情链接名称',
  34. 'match' => 'is_string',
  35. 'update' => 'text',
  36. 'search' => 'order,fulltext',
  37. 'list' => true,
  38. //'modal' => '点此打开',
  39. ),
  40. 'link' => array
  41. (
  42. 'type' => 'varchar-100',
  43. 'name' => '链接',
  44. 'default' => '',
  45. 'desc' => '请输入链接',
  46. 'match' => 'is_string',
  47. 'update' => 'text',
  48. 'list' => true,
  49. ),
  50. 'pic' => array
  51. (
  52. 'type' => 'varchar-150',
  53. 'name' => '图片-宽度为150的图片',
  54. 'default' => '',
  55. 'desc' => '请选择图片',
  56. 'match' => 'is_string',
  57. 'update' => 'image',
  58. 'key' => '1',
  59. 'place' => '150',
  60. ),
  61. 'info' => array
  62. (
  63. 'type' => 'varchar-100',
  64. 'name' => '介绍',
  65. 'default' => '',
  66. 'desc' => '请输入介绍',
  67. 'match' => 'option',
  68. 'update' => 'textarea',
  69. ),
  70. 'state' => array
  71. (
  72. 'type' => 'tinyint-1',
  73. 'name' => '状态',
  74. 'default' => '1',
  75. 'desc' => '请选择状态',
  76. 'match' => 'is_numeric',
  77. //'option' => $option,
  78. //'update' => 'radio',
  79. ),
  80. 'cdate' => array
  81. (
  82. 'type' => 'int-11',
  83. 'name' => '录入时间',
  84. 'match' => array('is_numeric', time()),
  85. 'desc' => '',
  86. # 只有insert时才生效
  87. 'insert' => true,
  88. ),
  89. ),
  90. # 索引
  91. 'index' => array
  92. (
  93. # 索引名 => 索引id
  94. ),
  95. # 管理功能
  96. 'manage' => array
  97. (
  98. ),
  99. # request 请求接口定义
  100. 'request' => array
  101. (
  102. # all 取所有链接
  103. 'getAll' => array
  104. (
  105. 'where' => array
  106. (
  107. 'state' => 1,
  108. ),
  109. 'type' => 'all',
  110. 'order' => array('id', 'desc'),
  111. 'limit' => array(10, 0),
  112. 'col' => '*',
  113. ),
  114. ),
  115. );