summaryrefslogtreecommitdiffstats
path: root/application/views/scripts/navigation/shared.phtml
blob: e9e9164313a0f34154b6c4bd20e8ce0b35da364d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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>