button.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <?php
  2. $status = Dever::config('base')->status;
  3. $cate = function()
  4. {
  5. $array = array();
  6. $info = Dever::db('main/cate')->state();
  7. if($info)
  8. {
  9. $array += $info;
  10. }
  11. return $array;
  12. };
  13. $config = array
  14. (
  15. # 表名
  16. 'name' => 'info',
  17. # 显示给用户看的名称
  18. 'lang' => '首页按钮',
  19. 'order' => 100,
  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. 'list' => true,
  31. ),
  32. 'name' => array
  33. (
  34. 'type' => 'varchar-180',
  35. 'name' => '标题-图标参考:https://www.graceui.com/graceUIIcons, 直接输入图标的代码即可',
  36. 'default' => '',
  37. 'desc' => '标题',
  38. 'match' => 'is_string',
  39. 'update' => 'text',
  40. 'search' => 'fulltext',
  41. 'list' => true,
  42. ),
  43. 'cate_id' => array
  44. (
  45. 'type' => 'int-11',
  46. 'name' => '分类',
  47. 'default' => '1',
  48. 'desc' => '分类',
  49. 'match' => 'is_numeric',
  50. 'update' => 'select',
  51. 'option' => $cate,
  52. 'search' => 'select',
  53. //'list' => true,
  54. ),
  55. 'link' => array
  56. (
  57. 'type' => 'varchar-2000',
  58. 'name' => '链接-可以直接输入路径,也可以输入链接',
  59. 'default' => '',
  60. 'desc' => '链接',
  61. 'match' => 'is_string',
  62. 'update' => 'text',
  63. 'search' => 'fulltext',
  64. 'list' => true,
  65. ),
  66. 'icon' => array
  67. (
  68. 'type' => 'varchar-150',
  69. 'name' => '图标-这里的图标是图片',
  70. 'default' => '',
  71. 'desc' => '封面图',
  72. 'match' => 'option',
  73. 'update' => 'image',
  74. 'key' => '1',
  75. 'place' => '100*100',
  76. ),
  77. 'bgcolor' => array
  78. (
  79. 'type' => 'varchar-180',
  80. 'name' => '文字背景颜色',
  81. 'default' => '',
  82. 'desc' => '文字背景颜色',
  83. 'match' => 'option',
  84. 'update' => 'color',
  85. 'search' => 'fulltext',
  86. 'list' => true,
  87. ),
  88. 'cate_id' => array
  89. (
  90. 'type' => 'int-11',
  91. 'name' => '分类',
  92. 'default' => '1',
  93. 'desc' => '分类',
  94. 'match' => 'is_numeric',
  95. 'update' => 'select',
  96. 'option' => $cate,
  97. 'search' => 'select',
  98. //'list' => true,
  99. ),
  100. 'reorder' => array
  101. (
  102. 'type' => 'int-11',
  103. 'name' => '排序(数值越大越靠前)',
  104. 'default' => '1',
  105. 'desc' => '请输入排序',
  106. 'match' => 'option',
  107. //'update' => 'text',
  108. 'search' => 'order',
  109. 'list' => true,
  110. 'order' => 'desc',
  111. 'edit' => true,
  112. ),
  113. 'state' => array
  114. (
  115. 'type' => 'tinyint-1',
  116. 'name' => '状态',
  117. 'default' => '1',
  118. 'desc' => '请选择状态',
  119. 'match' => 'is_numeric',
  120. ),
  121. 'cdate' => array
  122. (
  123. 'type' => 'int-11',
  124. 'name' => '录入时间',
  125. 'match' => array('is_numeric', time()),
  126. 'desc' => '',
  127. # 只有insert时才生效
  128. 'insert' => true,
  129. ),
  130. ),
  131. # 管理功能
  132. 'manage' => array
  133. (
  134. ),
  135. # request 请求接口定义
  136. 'request' => array
  137. (
  138. ),
  139. );
  140. return $config;