Example #1
0
function restart_search($conn, $data)
{
    $return['error'] = FALSE;
    $return['msg'] = '';
    $type = $data['type'];
    ossim_valid($type, 'asset', 'group', 'network', 'illegal:' . _("List Type"));
    if (ossim_error()) {
        $error = ossim_get_error();
        ossim_clean_error();
        $return['error'] = TRUE;
        $return['msg'] = $error;
        return $return;
    }
    Filter_list::delete_filters_from_session();
    try {
        $object = 'Filter_' . $type . '_list';
        if (!class_exists($object)) {
            Av_exception::throw_error(Av_exception::USER_ERROR, _('Invalid List Type'));
        }
        $filter_list = new $object($conn);
        $filter_list->store_filter_list_session();
    } catch (Exception $e) {
        $return['error'] = TRUE;
        $return['msg'] = $e->getMessage();
    }
    return $return;
}