}
/* Check our results. */
if (!empty($haveError)) {
$notification->push(sprintf(_("There was an error saving the note: %s"), $haveError), 'horde.warning');
} else {
$notification->push(sprintf(_("Successfully saved \"%s\"."), $memo_desc), 'horde.success');
}
}
/* Return to the notepad view. */
if (!Horde_Util::getFormData('save_only')) {
Horde::url('list.php', true)->redirect();
}
break;
case 'delete_memos':
/* Delete the note if we're provided with a valid note ID. */
if (!is_null($memo_id) && Mnemo::getMemo($memolist_id, $memo_id)) {
if (getShare($memolist_id)->hasPermission($user, Horde_Perms::DELETE)) {
$storage = $injector->getInstance('Mnemo_Factory_Driver')->create($memolist_id);
try {
$storage->delete($memo_id);
$notification->push(_("The note was deleted."), 'horde.success');
} catch (Mnemo_Exception $e) {
$notification->push(sprintf(_("There was an error removing the note: %s"), $e->getMessage()), 'horde.warning');
}
} else {
$notification->push(_("Access denied deleting note."), 'horde.warning');
}
}
/* Return to the notepad. */
Horde::url('list.php', true)->redirect();
default: