button.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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' => 'option',
  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. 'desc' => array
  89. (
  90. 'type' => 'varchar-800',
  91. 'name' => '描述-当该按钮链接为空时,将弹出描述,如果未填写描述,将提示敬请期待',
  92. 'default' => '',
  93. 'desc' => '描述',
  94. 'match' => 'option',
  95. 'update' => 'textarea',
  96. ),
  97. 'reorder' => array
  98. (
  99. 'type' => 'int-11',
  100. 'name' => '排序(数值越大越靠前)',
  101. 'default' => '1',
  102. 'desc' => '请输入排序',
  103. 'match' => 'option',
  104. //'update' => 'text',
  105. 'search' => 'order',
  106. 'list' => true,
  107. 'order' => 'desc',
  108. 'edit' => true,
  109. ),
  110. 'state' => array
  111. (
  112. 'type' => 'tinyint-1',
  113. 'name' => '状态',
  114. 'default' => '1',
  115. 'desc' => '请选择状态',
  116. 'match' => 'is_numeric',
  117. ),
  118. 'cdate' => array
  119. (
  120. 'type' => 'int-11',
  121. 'name' => '录入时间',
  122. 'match' => array('is_numeric', time()),
  123. 'desc' => '',
  124. # 只有insert时才生效
  125. 'insert' => true,
  126. ),
  127. ),
  128. # 管理功能
  129. 'manage' => array
  130. (
  131. ),
  132. # request 请求接口定义
  133. 'request' => array
  134. (
  135. ),
  136. );
  137. return $config;