/**
* @throws Kronolith_Exception
*/
public function execute()
{
if ($this->_vars->get('submitbutton') == _("Cancel")) {
Horde::url($GLOBALS['prefs']->getValue('defaultview') . '.php', true)->redirect();
}
if (!$this->_resource->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
throw new Kronolith_Exception(_("Permission denied"));
}
// Delete the resource.
try {
Kronolith::getDriver('Resource')->delete($this->_resource);
} catch (Exception $e) {
throw new Kronolith_Exception(sprintf(_("Unable to delete \"%s\": %s"), $this->_resource->get('name'), $e->getMessage()));
}
}