header('Location: ' . Horde::applicationUrl('filters.php', true));
exit;
}
+
+ $tmp = $filters->getFilter($id);
if ($filters->deleteRule($id)) {
- $notification->push(_("Rule Deleted"), 'horde.success');
+ $notification->push(sprintf(_("Rule \"%s\" deleted."), $tmp['name']), 'horde.success');
}
break;
}
$notification->push($message, 'horde.error', array('content.raw'));
break 2;
- } elseif ($filters->copyRule($id)) {
- $notification->push(_("Rule Copied"), 'horde.success');
+ } else {
+ $tmp = $filters->getFilter($id);
+ if ($filters->copyRule($id)) {
+ $notification->push(sprintf(_("Rule \"%s\" copied."), $tmp['name']), 'horde.success');
+ }
}
break;
break;
case 'rule_disable':
+ $tmp = $filters->getFilter($id);
$filters->ruleDisable($id);
- $notification->push(_("Rule Disabled"), 'horde.success');
+ $notification->push(sprintf(_("Rule \"%s\" disabled."), $tmp['name']), 'horde.success');
break;
case 'rule_enable':
+ $tmp = $filters->getFilter($id);
$filters->ruleEnable($id);
- $notification->push(_("Rule Enabled"), 'horde.success');
+ $notification->push(sprintf(_("Rule \"%s\" enabled."), $tmp['name']), 'horde.success');
break;
}
}
/**
+ * Return the filter entry for a given ID.
+ *
+ * @return mixed The rule hash entry, or false if not defined.
+ */
+ public function getFilter($id)
+ {
+ return isset($this->_filters[$id])
+ ? $this->_filters[$id]
+ : false;
+ }
+
+ /**
* Returns a single rule hash.
*
* @param integer $id A rule number.