page.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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' => Dever::input('where_id') > 0 ? 'hidden' : '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. $auth = Dever::tops();
  85. if ($auth && $auth != 1) {
  86. $config['request']['list'] = array
  87. (
  88. # 匹配的正则或函数 选填项
  89. 'option' => array
  90. (
  91. 'name' => array('yes', 'like'),
  92. 'key' => array('_' . $auth, 'like'),
  93. ),
  94. 'type' => 'all',
  95. 'order' => array('id' => 'desc'),
  96. 'page' => array(20, 'list'),
  97. 'col' => '*|id',
  98. );
  99. }
  100. return $config;