mirror of
https://github.com/unraid/webgui.git
synced 2025-12-31 14:40:36 -06:00
81 lines
2.9 KiB
PHP
Executable File
81 lines
2.9 KiB
PHP
Executable File
<?
|
|
/**
|
|
* Template is used for both top navigation and sidebar navigation.
|
|
*
|
|
* @var $themeHelper ThemeHelper
|
|
* @var $taskPages array
|
|
* @var $buttonPages array
|
|
* @var $display array
|
|
* @var $task string
|
|
*/
|
|
?>
|
|
<div id="menu">
|
|
<? if ($themeHelper->isSidebarTheme()): ?>
|
|
<div id="nav-block">
|
|
<? endif; ?>
|
|
|
|
<div class="nav-tile">
|
|
<? foreach ($taskPages as $button): ?>
|
|
<? $pageName = $button['name']; ?>
|
|
<? $pageActive = $task == $pageName ? " active" : ""; ?>
|
|
<div class="nav-item<?= $pageActive ?>">
|
|
<a href="/<?= $pageName ?>" onclick="initab('/<?= $pageName ?>')">
|
|
<?= _(_var($button, 'Name', $pageName)) ?>
|
|
</a>
|
|
</div>
|
|
<? endforeach; ?>
|
|
<? unset($taskPages); ?>
|
|
</div>
|
|
|
|
<div class="nav-tile right">
|
|
<? if (isset($myPage['Lock'])): ?>
|
|
<div class="nav-item LockButton util">
|
|
<a href="#" class="hand" onclick="LockButton();return false;" title="<?= _('Unlock sortable items') ?>">
|
|
<b class="icon-u-lock system green-text"></b>
|
|
<span><?= _('Unlock sortable items') ?></span>
|
|
</a>
|
|
</div>
|
|
<? endif; ?>
|
|
|
|
<? if ($display['usage'] && ! $themeHelper->isSidebarTheme()): ?>
|
|
<? my_usage(); ?>
|
|
<? endif; ?>
|
|
<? if ($display['usage'] && $themeHelper->isSidebarTheme()): ?>
|
|
<script>$("#array-usage-sidenav").html("<?my_usage();?>");</script>
|
|
<? endif; ?>
|
|
<? foreach ($buttonPages as $button): ?>
|
|
<? if (empty($button['Link'])): ?>
|
|
<? $icon = $button['Icon']; ?>
|
|
<? if (substr($icon, -4) == '.png'): ?>
|
|
<? $icon = "<img src='/{$button['root']}/icons/$icon' class='system'>"; ?>
|
|
<? elseif (substr($icon, 0, 5) == 'icon-'): ?>
|
|
<? $icon = "<b class='$icon system'></b>"; ?>
|
|
<? else: ?>
|
|
<? if (substr($icon, 0, 3) != 'fa-'): ?>
|
|
<? $icon = "fa-$icon"; ?>
|
|
<? endif; ?>
|
|
<? $icon = "<b class='fa $icon system'></b>"; ?>
|
|
<? endif; ?>
|
|
|
|
<div class="nav-item <?= $button['name'] ?> util">
|
|
<a
|
|
href="<?= _var($button, 'Href', '#') ?>"
|
|
onclick="<?= $button['name'] ?>();return false;"
|
|
title="<?= _($button['Title']) ?>"
|
|
>
|
|
<?= $icon ?>
|
|
<span><?= _($button['Title']) ?></span>
|
|
</a>
|
|
</div>
|
|
<? else: ?>
|
|
<div class="<?= $button['Link'] ?>"></div>
|
|
<? endif; ?>
|
|
<? endforeach; ?>
|
|
<? unset($buttonPages, $button); ?>
|
|
|
|
<? if ($themeHelper->isSidebarTheme()): ?>
|
|
</div>
|
|
<? endif; ?>
|
|
</div>
|
|
</div>
|