navbar.tpl 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. {foreach $navbar as $item}
  2. <li data-menuItemName="{$item->getName()}" class="{$item->getId()} d-block{if $item@first} no-collapse{/if}{if $item->hasChildren()} dropdown no-collapse{/if}{if $item->getClass()} {$item->getClass()}{/if}{if $item->getName() == "Home"} home-item{/if}">
  3. <a class="nav-link{if !isset($rightDrop) || !$rightDrop}{/if}{if $item->hasChildren()} dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" href="#"{else}" href="{$item->getUri()}"{/if}{if $item->getAttribute('target')} target="{$item->getAttribute('target')}"{/if}>
  4. {if $item->getName() == "Home"}<i class="fas fa-home"></i>{else}{if $item->hasIcon()}<i class="{$item->getIcon()}"></i>&nbsp;{/if}{/if}
  5. <span>{$item->getLabel()}</span>
  6. {if $item->hasBadge()}&nbsp;<span class="badge">{$item->getBadge()}</span>{/if}
  7. </a>
  8. {if $item->hasChildren()}
  9. <ul class="dropdown-menu{if isset($rightDrop) && $rightDrop} dropdown-menu-right{/if}{if $item->getName() eq "Account"} dropdown-user{/if}">
  10. {if $item->getName() == "Account" && $loggedin}
  11. <li class="dropdown-header">
  12. <div class="dropdown-header-title">
  13. {if $cuser}
  14. {$cuser->fullName}
  15. {else}
  16. {$client.fullname}
  17. {/if}
  18. </div>
  19. <div class="dropdown-header-desc">
  20. {if $cuser}
  21. {$cuser->email}
  22. {else}
  23. {$client.email}
  24. {/if}
  25. </div>
  26. </li>
  27. <li class="dropdown-divider">
  28. -----
  29. </li>
  30. <li data-menuItemName="Switch Accounts">
  31. <a href="{routePath('user-accounts')}" class="dropdown-item">
  32. <div class="dropdown-menu-item-name">{lang key='navSwitchAccount'}</div>
  33. </a>
  34. </li>
  35. <li class="dropdown-divider">
  36. -----
  37. </li>
  38. {/if}
  39. {foreach $item->getChildren() as $childItem}
  40. {if $childItem->getClass() && in_array($childItem->getClass(), ['dropdown-divider', 'nav-divider'])}
  41. <li class="dropdown-divider"></li>
  42. {else}
  43. <li data-menuItemName="{$childItem->getName()}" class="{if $childItem->getClass()} {$childItem->getClass()}{/if}">
  44. <a href="{$childItem->getUri()}" class="dropdown-item"{if $childItem->getAttribute('target')} target="{$childItem->getAttribute('target')}"{/if}>
  45. {if $childItem->hasIcon()}<i class="{$childItem->getIcon()}"></i>&nbsp;{/if}
  46. {$childItem->getLabel()}
  47. {if $childItem->hasBadge()}&nbsp;<span class="badge">{$childItem->getBadge()}</span>{/if}
  48. </a>
  49. </li>
  50. {/if}
  51. {/foreach}
  52. </ul>
  53. {/if}
  54. </li>
  55. {/foreach}