menu.php 3.4 KB

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