Skip to content

Commit

Permalink
[jan] Don't show admin alarm form if alarms are disabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Oct 24, 2013
1 parent 55d69cb commit 0d25249
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 19 deletions.
45 changes: 26 additions & 19 deletions horde/admin/alarms.php
Expand Up @@ -116,31 +116,38 @@
));
$view->addHelper('Text');

try {
$alarms = $horde_alarm->globalAlarms();
$url = Horde::url('admin/alarms.php');
foreach ($alarms as &$alarm) {
$url->add('alarm', $alarm['id']);
$alarm['edit_link'] = $url->link()
. htmlspecialchars($alarm['title'])
. '</a>';
$alarm['delete_link'] = $url->copy()
->add('delete', 1)
->link(array('title' => sprintf(_("Delete \"%s\""), $alarm['title']),
'onclick' => 'return confirm(\'' . addslashes(sprintf(_("Are you sure you want to delete '%s'?"), $alarm['title'])) . '\')'))
. Horde::img('delete.png')
. '</a>';
}
$view->alarms = $alarms;
} catch (Horde_Alarm_Exception $e) {
if ($horde_alarm instanceof Horde_Alarm_Null) {
$view->alarms = array();
$view->error = sprintf(_("Listing alarms failed: %s"), $e->getMessage());
$view->error = _("Alarms have been disabled in the configuration");
} else {
try {
$alarms = $horde_alarm->globalAlarms();
$url = Horde::url('admin/alarms.php');
foreach ($alarms as &$alarm) {
$url->add('alarm', $alarm['id']);
$alarm['edit_link'] = $url->link()
. htmlspecialchars($alarm['title'])
. '</a>';
$alarm['delete_link'] = $url->copy()
->add('delete', 1)
->link(array('title' => sprintf(_("Delete \"%s\""), $alarm['title']),
'onclick' => 'return confirm(\'' . addslashes(sprintf(_("Are you sure you want to delete '%s'?"), $alarm['title'])) . '\')'))
. Horde::img('delete.png')
. '</a>';
}
$view->alarms = $alarms;
} catch (Horde_Alarm_Exception $e) {
$view->alarms = array();
$view->error = sprintf(_("Listing alarms failed: %s"), $e->getMessage());
}
}

$page_output->header(array(
'title' => _("Alarms")
));
require HORDE_TEMPLATES . '/admin/menu.inc';
echo $view->render('list');
$form->renderActive();
if (!($horde_alarm instanceof Horde_Alarm_Null)) {
$form->renderActive();
}
$page_output->footer();
1 change: 1 addition & 0 deletions horde/docs/CHANGES
Expand Up @@ -2,6 +2,7 @@
v5.1.5-git
----------

[jan] Don't show admin alarm form if alarms are disabled.
[mms] Add horde-remove-user-data command-line script.
[mms] Add additional syntax checking for the configuration files in the test
script.
Expand Down
2 changes: 2 additions & 0 deletions horde/package.xml
Expand Up @@ -39,6 +39,7 @@
</stability>
<license uri="http://www.horde.org/licenses/lgpl">LGPL-2</license>
<notes>
* [jan] Don&apos;t show admin alarm form if alarms are disabled.
* [mms] Add horde-remove-user-data command-line script.
* [mms] Add additional syntax checking for the configuration files in the test script.
* [mms] Only update topbar if the underlying tree data has changed.
Expand Down Expand Up @@ -3776,6 +3777,7 @@
<date>2013-10-19</date>
<license uri="http://www.horde.org/licenses/lgpl">LGPL-2</license>
<notes>
* [jan] Don&apos;t show admin alarm form if alarms are disabled.
* [mms] Add horde-remove-user-data command-line script.
* [mms] Add additional syntax checking for the configuration files in the test script.
* [mms] Only update topbar if the underlying tree data has changed.
Expand Down

0 comments on commit 0d25249

Please sign in to comment.