ossim_valid($order, OSS_ALPHA, 'illegal: iSortCol_0'); ossim_valid($torder, OSS_DIGIT, 'illegal: sSortDir_0'); ossim_valid($sec, OSS_DIGIT, 'illegal: sEcho'); if (ossim_error()) { $response['sEcho'] = 1; $response['iTotalRecords'] = 0; $response['iTotalDisplayRecords'] = 0; $response['aaData'] = ''; echo json_encode($response); exit; } /* If $all_list = TRUE, then the asset list will be load from host because there are no filters to be applied If $all_list = FALSE, then the asset list will be load from user_host_filter because there are already some filters applied */ $filters = Asset_filter_list::retrieve_filter_list_session(); if ($filters === FALSE) { $all_list = TRUE; } else { $cont = $filters->get_num_filter_added(); $all_list = $cont > 0 ? FALSE : TRUE; } // Order by column switch ($order) { case 0: $order = 'host.hostname'; break; default: $order = 'host.hostname'; } $maxrows = $maxrows > 50 ? 50 : $maxrows;
function get_selected_values($id) { //Getting the object with the filters. $filters = Asset_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(); }