Example #1
0
    $nt->show();
}
$back = intval(GET('back'));
$notif = GET('notif');
ossim_valid($notif, OSS_TEXT, OSS_NULLABLE, 'illegal:' . _('Notification Message'));
if (ossim_error()) {
    die(ossim_error());
}
//This params are validated in the class.
$filter_id = GET("filter_id");
$filter_val = GET("filter_value");
$cond_filter = $filter_id != '' && $filter_val != '';
$db = new ossim_db();
$conn = $db->connect();
//Getting the object with the filters. Unserialize needed.
$filter_list = Filter_list::retrieve_filter_list_session();
//If we don't have any object, we create a new one.
if (!$filter_list instanceof Filter_network_list || !$back || $cond_filter) {
    try {
        $filter_list = new Filter_network_list($conn);
        if ($cond_filter) {
            $filter_list->modify_filter($filter_id, $filter_val, 0);
        }
        $filter_list->store_filter_list_session();
    } catch (Exception $e) {
        show_notif($e->getMessage(), 'nf_error');
    }
}
$cont = $filter_list->get_num_filter_added();
if ($cont > 0) {
    try {
Example #2
0
function get_selected_values($id)
{
    //Getting the object with the filters.
    $filters = Filter_list::retrieve_filter_list_session();
    //If the filters object is not an object, returns empty
    if ($filters === FALSE) {
        return array();
    }
    $filter = $filters->get_filter($id);
    //If the concrete filter is not an object, returns empty.
    if (!is_object($filter)) {
        return array();
    }
    //Returns the selected values
    return $filter->get_values();
}