diff options
Diffstat (limited to 'application/views/scripts/navigation/shared.phtml')
-rw-r--r-- | application/views/scripts/navigation/shared.phtml | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/application/views/scripts/navigation/shared.phtml b/application/views/scripts/navigation/shared.phtml new file mode 100644 index 0000000..e9e9164 --- /dev/null +++ b/application/views/scripts/navigation/shared.phtml @@ -0,0 +1,68 @@ +<?php + +use Icinga\Web\Url; + +if (! $this->compact): ?> +<div class="controls"> + <?= $this->tabs; ?> + <div class="grid"> + <?= $this->sortBox ?> + </div> +</div> +<?php endif ?> +<div class="content" data-base-target="_next"> +<?php if (count($items) === 0): ?> + <p><?= $this->translate('There are currently no navigation items being shared'); ?></p> +<?php else: ?> + <table class="table-row-selectable common-table"> + <thead> + <th><?= $this->translate('Shared Navigation'); ?></th> + <th><?= $this->translate('Type'); ?></th> + <th><?= $this->translate('Owner'); ?></th> + <th><?= $this->translate('Unshare'); ?></th> + </thead> + <tbody> + <?php foreach ($items as $item): ?> + <tr> + <td><?= $this->qlink( + $item->name, + 'navigation/edit', + array( + 'name' => $item->name, + 'type' => $item->type, + 'owner' => $item->owner, + 'referrer' => 'shared' + ), + array( + 'title' => sprintf($this->translate('Edit shared navigation item %s'), $item->name) + ) + ); ?></td> + <td><?= $item->type && isset($types[$item->type]) + ? $this->escape($types[$item->type]) + : $this->escape($this->translate('Unknown')); ?></td> + <td><?= $this->escape($item->owner); ?></td> + <?php if ($item->parent): ?> + <td><?= $this->icon( + 'block', + sprintf( + $this->translate( + 'This is a child of the navigation item %1$s. You can' + . ' only unshare this item by unsharing %1$s' + ), + $item->parent + ) + ); ?></td> + <?php else: ?> + <td data-base-target="_self" class="remove-nav-item"><?= $removeForm + ->setDefault('name', $item->name) + ->setAction(Url::fromPath( + 'navigation/unshare', + array('type' => $item->type, 'owner' => $item->owner) + )); ?></td> + <?php endif ?> + </tr> + <?php endforeach ?> + </tbody> + </table> +<?php endif ?> +</div> |