page.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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-80',
  28. 'name' => '标题',
  29. 'default' => '',
  30. 'desc' => '标题',
  31. 'match' => 'is_string',
  32. 'update' => 'text',
  33. 'search' => 'fulltext',
  34. 'list' => true,
  35. ),
  36. 'key' => array
  37. (
  38. 'type' => 'varchar-80',
  39. 'name' => '标识',
  40. 'default' => '',
  41. 'desc' => '标识',
  42. 'match' => 'is_string',
  43. 'update' => 'text',
  44. //'search' => 'fulltext',
  45. 'list' => true,
  46. ),
  47. 'content' => array
  48. (
  49. 'type' => 'text-255',
  50. 'name' => '内容',
  51. 'default' => '',
  52. 'desc' => '内容',
  53. 'match' => 'is_string',
  54. 'update' => 'editor',
  55. 'list_name' => '链接',
  56. 'list' => 'Dever::load("content/lib/page.link", {id})',
  57. ),
  58. 'state' => array
  59. (
  60. 'type' => 'tinyint-1',
  61. 'name' => '状态',
  62. 'default' => '1',
  63. 'desc' => '请选择状态',
  64. 'match' => 'is_numeric',
  65. ),
  66. 'cdate' => array
  67. (
  68. 'type' => 'int-11',
  69. 'name' => '录入时间',
  70. 'match' => array('is_numeric', time()),
  71. 'desc' => '',
  72. # 只有insert时才生效
  73. 'insert' => true,
  74. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  75. ),
  76. ),
  77. 'manage' => array
  78. (
  79. ),
  80. 'request' => array
  81. (
  82. )
  83. );
  84. # 获取小刊分类权限
  85. $auth = Dever::tops();
  86. if ($auth && $auth != 1) {
  87. $config['request']['list'] = array
  88. (
  89. # 匹配的正则或函数 选填项
  90. 'option' => array
  91. (
  92. 'name' => array('yes', 'like'),
  93. 'key' => array('_' . $auth, 'like'),
  94. ),
  95. 'type' => 'all',
  96. 'order' => array('id' => 'desc'),
  97. 'page' => array(20, 'list'),
  98. 'col' => '*|id',
  99. );
  100. }
  101. return $config;