plugin->test_constructor_gatekeeper(); $ids = get_input('assessment'); if (!is_array($ids) && $ids != "") $ids = array($ids); $forward_to = "assessments/view"; $input_values = get_inputs(); $_SESSION['input_values'] = $input_values; if (get_input('delete_button', false)) { if (!is_array($ids)) { $TeKe->add_system_message(_("Delete failed"), 'error'); forward($forward_to); } else { $delete_failed = false; foreach ($ids as $id) { if (!$TeKe->plugin->deleteType("assessment", $id)) { $delete_failed = true; } } if ($delete_failed) { $TeKe->add_system_message(_("At least one of the deletions failed."), 'error'); forward($forward_to); } } $TeKe->add_system_message(_("Deleted")); } else if (get_input('statistics_button', false)){ if (!is_array($ids)) { forward($forward_to); } header("Content-type: text/csv;charset=utf-8"); header("Content-Disposition: attachment; filename=statistics.csv"); $csv_content_list = $TeKe->plugin->assessments->getAssessmentsStatistics($ids); $filename = tempnam(sys_get_temp_dir(), "statistics.csv"); $csv_file = fopen($filename, "w"); foreach ($csv_content_list as $fields) { fputcsv($csv_file, $fields); } fclose($csv_file); $file_content = file_get_contents($filename); unlink($filename); echo $file_content; exit; } else { $TeKe->add_system_message(_("No action")); } forward($forward_to); ?>