page.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <?php
  2. $config = array
  3. (
  4. # 表名
  5. 'name' => 'page',
  6. # 显示给用户看的名称
  7. 'lang' => '单页管理',
  8. # 后台菜单排序
  9. 'order' => 2,
  10. 'check' => 'key',
  11. # 数据结构
  12. 'struct' => array
  13. (
  14. 'id' => array
  15. (
  16. 'type' => 'int-11',
  17. 'name' => 'ID',
  18. 'default' => '',
  19. 'desc' => '',
  20. 'match' => 'is_numeric',
  21. //'search' => 'order',
  22. //'list' => true,
  23. 'order' => 'desc',
  24. ),
  25. 'name' => array
  26. (
  27. 'type' => 'varchar-180',
  28. 'name' => '标题',
  29. 'default' => '',
  30. 'desc' => '标题',
  31. 'match' => 'is_string',
  32. 'update' => 'text',
  33. 'search' => 'fulltext',
  34. 'list' => true,
  35. ),
  36. 'ename' => array
  37. (
  38. 'type' => 'varchar-180',
  39. 'name' => '英文标题',
  40. 'default' => '',
  41. 'desc' => '英文标题',
  42. 'match' => 'is_string',
  43. 'update' => 'text',
  44. 'search' => 'fulltext',
  45. 'list' => true,
  46. ),
  47. 'key' => array
  48. (
  49. 'type' => 'varchar-80',
  50. 'name' => '标识',
  51. 'default' => '',
  52. 'desc' => '标识',
  53. 'match' => 'is_string',
  54. 'update' => 'text',
  55. //'search' => 'fulltext',
  56. 'list' => true,
  57. ),
  58. 'content' => array
  59. (
  60. 'type' => 'text-255',
  61. 'name' => '内容',
  62. 'default' => '',
  63. 'desc' => '内容',
  64. 'match' => 'is_string',
  65. 'update' => 'editor',
  66. 'list_name' => '链接',
  67. 'list' => 'Dever::load("content/lib/page.link", {id})',
  68. ),
  69. 'state' => array
  70. (
  71. 'type' => 'tinyint-1',
  72. 'name' => '状态',
  73. 'default' => '1',
  74. 'desc' => '请选择状态',
  75. 'match' => 'is_numeric',
  76. ),
  77. 'cdate' => array
  78. (
  79. 'type' => 'int-11',
  80. 'name' => '录入时间',
  81. 'match' => array('is_numeric', time()),
  82. 'desc' => '',
  83. # 只有insert时才生效
  84. 'insert' => true,
  85. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  86. ),
  87. ),
  88. 'manage' => array
  89. (
  90. ),
  91. 'request' => array
  92. (
  93. )
  94. );
  95. # 获取小刊分类权限
  96. $auth = Dever::tops();
  97. if ($auth && $auth != 1) {
  98. $config['request']['list'] = array
  99. (
  100. # 匹配的正则或函数 选填项
  101. 'option' => array
  102. (
  103. 'name' => array('yes', 'like'),
  104. 'key' => array('_' . $auth, 'like'),
  105. ),
  106. 'type' => 'all',
  107. 'order' => array('id' => 'desc'),
  108. 'page' => array(20, 'list'),
  109. 'col' => '*|id',
  110. );
  111. }
  112. return $config;