/**
* AJAX action: Re-sort the filters list.
*
* Variables used:
* - sort: (string) JSON serialized sort list of rule UIDs.
*
* @return boolean True on success.
*/
public function reSortFilters()
{
global $injector, $notification;
if (!Ingo::hasSharePermission(Horde_Perms::EDIT)) {
$notification->push(_("You do not have permission to edit filter rules."), 'horde.error');
return false;
}
$storage = $injector->getInstance('Ingo_Factory_Storage')->create();
try {
$storage->sort(json_decode($this->vars->sort));
$notification->push(_("Rule sort saved successfully."), 'horde.success');
} catch (Ingo_Exception $e) {
$notification->push(_("Rule sort not saved."), 'horde.error');
return false;
}
try {
$injector->getInstance('Ingo_Factory_Script')->activateAll();
} catch (Ingo_Exception $e) {
$notification->push($e, 'horde.warning');
}
return true;
}