本文整理汇总了PHP中DataForm::validate方法的典型用法代码示例。如果您正苦于以下问题:PHP DataForm::validate方法的具体用法?PHP DataForm::validate怎么用?PHP DataForm::validate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataForm
的用法示例。
在下文中一共展示了DataForm::validate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$flatviewtable->set_additional_parameters($parameters);
$params = array();
if (isset($_GET['export_pdf']) && $_GET['export_pdf'] == 'category') {
$params['only_total_category'] = true;
$params['join_firstname_lastname'] = true;
$params['show_official_code'] = true;
$params['export_pdf'] = true;
if ($cat[0]->is_locked() == true || api_is_platform_admin()) {
Display::set_header(null, false, false);
GradebookUtils::export_pdf_flatview($flatviewtable, $cat, $users, $alleval, $alllinks, $params, $mainCourseCategory[0]);
}
}
if (isset($_GET['exportpdf'])) {
$interbreadcrumb[] = array('url' => api_get_self() . '?selectcat=' . Security::remove_XSS($_GET['selectcat']), 'name' => get_lang('FlatView'));
$export_pdf_form = new DataForm(DataForm::TYPE_EXPORT_PDF, 'export_pdf_form', null, api_get_self() . '?exportpdf=&offset=' . intval($_GET['offset']) . '&selectcat=' . intval($_GET['selectcat']) . '&' . api_get_cidreq(), '_blank', '');
if ($export_pdf_form->validate()) {
$params = $export_pdf_form->exportValues();
Display::set_header(null, false, false);
$params['join_firstname_lastname'] = true;
$params['show_official_code'] = true;
$params['export_pdf'] = true;
$params['only_total_category'] = false;
GradebookUtils::export_pdf_flatview($flatviewtable, $cat, $users, $alleval, $alllinks, $params, $mainCourseCategory[0]);
} else {
Display::display_header(get_lang('ExportPDF'));
}
}
if (isset($_GET['print'])) {
$printable_data = GradebookUtils::get_printable_data($cat[0], $users, $alleval, $alllinks, $params, $mainCourseCategory[0]);
echo print_table($printable_data[1], $printable_data[0], get_lang('FlatView'), $cat[0]->get_name());
exit;
示例2: header
header('Location: ' . api_get_self() . '?selecteval=' . Security::remove_XSS($_GET['selecteval']) . '&importoverwritescore=' . $overwritescore);
exit;
}
if ($nr_results_added == 0) {
header('Location: ' . api_get_self() . '?selecteval=' . Security::remove_XSS($_GET['selecteval']) . '¬hingadded=');
exit;
}
header('Location: ' . api_get_self() . '?selecteval=' . Security::remove_XSS($_GET['selecteval']) . '&importok=');
exit;
}
}
if (isset($_GET['export'])) {
$interbreadcrumb[] = array('url' => 'gradebook_view_result.php?selecteval=' . Security::remove_XSS($_GET['selecteval']), 'name' => get_lang('ViewResult'));
$locked_status = $eval[0]->get_locked();
$export_result_form = new DataForm(DataForm::TYPE_EXPORT, 'export_result_form', null, api_get_self() . '?export=&selecteval=' . $_GET['selecteval'], '_blank', $locked_status);
if (!$export_result_form->validate()) {
Display::display_header(get_lang('Export'));
}
if ($export_result_form->validate()) {
$export = $export_result_form->exportValues();
$file_type = $export['file_type'];
$filename = 'export_results_' . gmdate('Y-m-d_H-i-s');
$results = Result::load(null, null, Security::remove_XSS($_GET['selecteval']));
$data = array();
//when file type is csv, add a header to the output file
if ($file_type == 'csv') {
$alldata[] = array('username', 'official_code', 'lastname', 'firstname', 'score', 'date');
}
// export results to pdf file
if ($file_type == 'pdf') {
$number_decimals = api_get_setting('gradebook_number_decimals');