left-side.phtml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <!--
  2. -->
  3. <?php
  4. /**
  5. * left navigation view partial
  6. * should only be called by the navigation view helper
  7. *
  8. * labels are already translated in page class
  9. *
  10. */
  11. $counter = 0;
  12. ?>
  13. <div class="sidebar">
  14. <ul class="nav nav-list">
  15. <li class="nav-header">
  16. <?php if (isset($this->menu->icon)) { ?>
  17. <i class="<?php echo $this->menu->icon; ?>"></i>
  18. <?php } ?>
  19. <?php echo $this->menu->label; ?>
  20. </li>
  21. <?php foreach ($this->menu->pages as $key => $page) { ?>
  22. <?php if ($page->hidden != 'true' && $page->filter != 'true' && $this->navigation()->accept($page)) { ?>
  23. <?php
  24. $class = array();
  25. $mainMenuActive = false;
  26. $activeAccordion = '';
  27. if ($page->isActive(true)) {
  28. $class[] = 'active';
  29. $mainMenuActive = true;
  30. }
  31. if (!empty($page->pages) && $page->hidden_children != 'true') {
  32. $class[] = 'accordion-menu';
  33. foreach ($page->pages as $subPage) {
  34. if ($subPage->isActive(true)) {
  35. $activeAccordion = 'in';
  36. if (!$mainMenuActive) {
  37. $class[] = 'active';
  38. }
  39. }
  40. if (!empty($subPage->pages)) {
  41. foreach ($subPage->pages as $subSubPage) {
  42. if ($subSubPage->isActive(true)) {
  43. $activeAccordion = 'in';
  44. if (!$mainMenuActive) {
  45. $class[] = 'active';
  46. }
  47. }
  48. }
  49. }
  50. }
  51. }
  52. ?>
  53. <li <?php echo (count($class) > 0) ? 'class="' . implode(' ', $class) . '"' : ''; ?>>
  54. <a <?php echo (!empty($page->pages) && $page->hidden_children != 'true') ?
  55. 'href="#' . $counter . '" data-toggle="collapse" class="accordion-toggle"' : 'href="' . $this->url($page->params) . '"'; ?>>
  56. <span>
  57. <?php echo $page->label; ?>
  58. <?php if (!empty($page->pages) && $page->hidden_children != 'true') { ?>
  59. <i class="fa fa-chevron-down pull-right"></i>
  60. <?php } ?>
  61. </span>
  62. </a>
  63. <?php if (!empty($page->pages) && $page->hidden_children != 'true') { ?>
  64. <div class="accordion-body collapse <?php echo $activeAccordion; ?> dropdown"
  65. id="<?php echo $counter++; ?>">
  66. <div class="accordion-inner">
  67. <ul class="nav nav-list">
  68. <?php
  69. foreach ($page->pages as $subKey => $subPage) {
  70. if ($subPage->hidden != 'true' && $this->navigation()->accept($subPage)) {
  71. $class = array();
  72. $mainMenuActive = false;
  73. $activeAccordion = '';
  74. if ($subPage->isActive(true)) {
  75. $class[] = 'active';
  76. $mainMenuActive = true;
  77. }
  78. if (!empty($subPage->pages)) {
  79. $class[] = 'accordion-menu';
  80. foreach ($subPage->pages as $subSubPage) {
  81. if ($subSubPage->isActive(true)) {
  82. $activeAccordion = 'in';
  83. if (!$mainMenuActive) {
  84. $class[] = 'active';
  85. }
  86. }
  87. }
  88. }
  89. ?>
  90. <li <?php echo (count($class) > 0) ? 'class="' . implode(' ',
  91. $class) . '"' : ''; ?>>
  92. <a <?php echo (!empty($subPage->pages) && $subPage->hidden != 'true') ?
  93. 'href="#' . $counter . '" data-toggle="collapse" class="accordion-toggle"' : 'href="' . $this->url($subPage->params) . '"'; ?>>
  94. <span><?php echo $subPage->label; ?></span>
  95. <?php if (!empty($subPage->pages)) { ?>
  96. <i class="fa fa-chevron-down pull-right"></i>
  97. <?php } ?>
  98. </a>
  99. <?php if (!empty($subPage->pages)) { // here the hidden tag wont work ?>
  100. <div
  101. class="accordion-body collapse <?php echo $activeAccordion; ?> dropdown"
  102. id="<?php echo $counter++; ?>">
  103. <div class="accordion-inner">
  104. <ul class="nav nav-list">
  105. <?php foreach ((array)$subPage->pages as $subSubPage) { ?>
  106. <?php if ($this->navigation()->accept($subSubPage)) { ?>
  107. <li <?php echo ($subSubPage->isActive(true)) ? 'class="active"' : ''; ?>>
  108. <a href="<?php echo $this->url($subSubPage->params); ?>"><?php echo $subSubPage->label; ?></a>
  109. </li>
  110. <?php } ?>
  111. <?php } ?>
  112. </ul>
  113. </div>
  114. </div>
  115. <?php } ?>
  116. </li>
  117. <?php
  118. }
  119. } ?>
  120. </ul>
  121. </div>
  122. </div>
  123. <?php } ?>
  124. </li>
  125. <?php } ?>
  126. <?php } ?>
  127. </ul>
  128. </div>