menu.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <?php
  2. # 项目列表中的管理选项:
  3. # 数据库基本配置与数据管理、模板列表与生成、项目基本配置与管理等
  4. # 这里面很多都是demo
  5. $view
  6. # 项目管理的链接
  7. /*
  8. ->fetch('#project-url@href', function()
  9. {
  10. return Dever::load('manage/menu.link#project');//这里可以改写成Dever::object('manage/menu.link')->project
  11. })
  12. # 日志的链接
  13. ->fetch('#log-url@href', function()
  14. {
  15. return Dever::load('manage/menu.link#log');
  16. })
  17. */
  18. ->fetch('#manage-name', 'manage/auth.info#username', 'none')
  19. ->fetch('#manage-group', 'manage/auth.info#rolename', 'none')
  20. ->fetch(array('.admin-manage@style', 0), 'manage/auth.manage')
  21. ->fetch(array('.admin-manage@style', 1), 'manage/auth.manage')
  22. # 另外一种形式
  23. # 退出的链接
  24. //->fetch('#logout-url@href', 'manage/menu.link#logout')
  25. # 首页的链接
  26. ->fetch('#index-url@href', 'manage/menu.link#index')
  27. /*
  28. ->fetch('.banner', 'manage/database.banner', 'none')
  29. ->fetch('.topbar', 'manage/auth.test', array
  30. (
  31. 'style' => array('height:70px;border-top:1px solid #eeeeee;', 'display:none;'),
  32. 'test' => '<{$v.name}>',
  33. 'span|$v.data' => '<{$v1.name}>',
  34. ))
  35. */
  36. /*
  37. ->render('manage/auth.test', array
  38. (
  39. '.topbar@style' => array('height:70px;border-top:1px solid #eeeeee;', 'none'),
  40. '#menu@test' => '<{$v.name}>',
  41. '.topbar span|$v.check' => array('test', 'none'),
  42. '.topbar span' => array
  43. (
  44. 'self|$v.data' => '<{$v1.name}>',
  45. )
  46. ))
  47. */
  48. # 项目列表
  49. ->loop
  50. (
  51. '.project-list',
  52. 'manage/menu.left',
  53. array
  54. (
  55. 'a' => array
  56. (
  57. 'data-target' => '.<{$v.key}>-menu',
  58. 'class++' => '<{if(Dever::input("menu") != $v.key && $v.type != 1):?> collapsed<{endif;}> <{if(Dever::input("menu") == $v.key):?> active<{endif;}>',
  59. ),
  60. '.project-name' => array
  61. (
  62. 'html' => '<{$v.name}>',
  63. ),
  64. 'i' => array
  65. (
  66. 'class' => '<{$v.icon ? $v.icon : "glyphicon glyphicon-folder-close"}>',
  67. ),
  68. 'ul' => array
  69. (
  70. 'id' => '<{$v.key}>-menu',
  71. //'class' => '<{$v.key}>-menu',
  72. # 此处实际上是个例子,处理多个classname的问题
  73. 'class--' => ' in', //菜单关闭状态
  74. # 第一个默认打开
  75. //'class++' => ' <{Dever::first("am-in", $i)}>',
  76. //'class++' => ' am-in', //菜单打开状态
  77. //根据当前url打开
  78. 'class++' => ' <{$v.key}>-menu <{if(Dever::input("menu") == $v.key || $v.type == 1):?> ins<{endif;}>',
  79. 'li|$v.child' => array
  80. (
  81. 'class--' => 'active', //菜单关闭状态
  82. 'class++' => '<{if(Dever::input("menu_id") == $v1.id):?>active<{endif;}>',
  83. 'a' => array
  84. (
  85. 'href' => '<{$v1.link}>',
  86. 'class' => '<{if(Dever::input("menu_id") == $v1.id):?>subdrop<{endif;}>',
  87. 'html' => '<span class="glyphicon glyphicon-chevron-right"></span>&nbsp;&nbsp;<{$v1.name}>',
  88. )
  89. ),
  90. ),
  91. )
  92. )
  93. //->fetch('#menu@style', '<{Dever::load("manage/auth.loading") ? "display:none;" : (Dever::load("manage/database.banner") ? "top:120px;" : "")}>')
  94. # display
  95. ->display();