summaryrefslogtreecommitdiffstats
path: root/application/views/scripts/dashboard/settings.phtml
blob: 52d4f14e2aef792a4f3466062402d078627c1c75 (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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<div class="controls">
    <?= $this->tabs ?>
</div>
<div class="content">
    <h1><?= t('Dashboard Settings'); ?></h1>

    <table class="avp action" data-base-target="_next">
        <thead>
            <tr>
                <th>
                    <strong><?= t('Dashlet Name') ?></strong>
                </th>
                <th>
                    <strong><?= t('Url') ?></strong>
                </th>
                <th class="icon-col">&nbsp;</th>
            </tr>
        </thead>
        <tbody>
            <?php foreach ($this->dashboard->getPanes() as $pane): ?>
                <?php if ($pane->getDisabled()) continue; ?>
                <tr>
                    <th colspan="2">
                    <?php if ($pane->isUserWidget()): ?>
                        <?= $this->qlink(
                            $pane->getName(),
                            'dashboard/rename-pane',
                            array('pane' => $pane->getName()),
                            array('title' => sprintf($this->translate('Edit pane %s'), $pane->getName()))
                        ) ?>
                    <?php else: ?>
                        <?= $this->escape($pane->getName()) ?>
                    <?php endif ?>
                    </th>
                    <th>
                        <?= $this->qlink(
                            '',
                            'dashboard/remove-pane',
                            array('pane' => $pane->getName()),
                            array(
                                'icon'  => 'trash',
                                'title' => sprintf($this->translate('Remove pane %s'), $pane->getName())
                            )
                        ); ?>
                    </th>
                </tr>
                <?php $dashlets = $pane->getDashlets(); ?>
                <?php if(empty($dashlets)): ?>
                    <tr>
                        <td colspan="3">
                            <?= $this->translate('No dashlets added to dashboard') ?>.
                        </td>
                    </tr>
                <?php else: ?>
                    <?php foreach ($dashlets as $dashlet): ?>
                    <?php if ($dashlet->getDisabled()) continue; ?>
                        <tr>
                            <td>
                                <?= $this->qlink(
                                    $dashlet->getTitle(),
                                    'dashboard/update-dashlet',
                                    array('pane' => $pane->getName(), 'dashlet' => $dashlet->getName()),
                                    array('title' => sprintf($this->translate('Edit dashlet %s'), $dashlet->getTitle()))
                                ); ?>
                            </td>
                            <td>
                                <?= $this->qlink(
                                    $dashlet->getUrl()->getRelativeUrl(),
                                    $dashlet->getUrl()->getRelativeUrl(),
                                    null,
                                    array('title' => sprintf($this->translate('Show dashlet %s'), $dashlet->getTitle()))
                                ); ?>
                            </td>
                            <td>
                                <?= $this->qlink(
                                    '',
                                    'dashboard/remove-dashlet',
                                    array('pane' => $pane->getName(), 'dashlet' => $dashlet->getName()),
                                    array(
                                        'icon'  => 'trash',
                                        'title' => sprintf($this->translate('Remove dashlet %s from pane %s'), $dashlet->getTitle(), $pane->getTitle())
                                    )
                                ); ?>
                            </td>
                        </tr>
                    <?php endforeach; ?>
                <?php endif; ?>
            <?php endforeach; ?>
        </tbody>
    </table>
</div>