require_once 'editreport_form.php'; if (!empty($report)) { $editform = new report_edit_form('editreport.php', compact('report', 'courseid', 'context')); } else { $editform = new report_edit_form('editreport.php', compact('courseid', 'context')); } if (!empty($report)) { $export = explode(',', $report->export); if (!empty($export)) { foreach ($export as $e) { $report->{'export_' . $e} = 1; } } $editform->set_data($report); } if ($editform->is_cancelled()) { if (!empty($report)) { redirect($CFG->wwwroot . '/report/configreports/editreport.php?id=' . $report->id); } else { redirect($CFG->wwwroot . '/report/configreports/editreport.php'); } } else { if ($data = $editform->get_data()) { require_once $CFG->dirroot . '/report/configreports/report.class.php'; require_once $CFG->dirroot . '/report/configreports/reports/' . $data->type . '/report.class.php'; if (empty($report)) { $reportclassname = 'report_' . $data->type; } else { $reportclassname = 'report_' . $report->type; } $arraydata = (array) $data;
function check_filters_request() { global $DB, $CFG; $components = cr_unserialize($this->config->components); $filters = isset($components['filters']['elements']) ? $components['filters']['elements'] : array(); if (!empty($filters)) { $formdata = new stdclass(); $request = array_merge($_POST, $_GET); if ($request) { foreach ($request as $key => $val) { if (strpos($key, 'filter_') !== false) { $formdata->{$key} = $val; } } } require_once 'filter_form.php'; $filterform = new report_edit_form(null, $this); $filterform->set_data($formdata); if ($filterform->is_cancelled()) { redirect("{$CFG->wwwroot}/blocks/configurable_reports/viewreport.php?id=" . $this->config->id . "&courseid=" . $this->config->courseid); die; } $this->filterform = $filterform; } }