本文整理汇总了PHP中workshop::submission_content_options方法的典型用法代码示例。如果您正苦于以下问题:PHP workshop::submission_content_options方法的具体用法?PHP workshop::submission_content_options怎么用?PHP workshop::submission_content_options使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类workshop
的用法示例。
在下文中一共展示了workshop::submission_content_options方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: redirect
$asid = $workshop->add_allocation($example, $USER->id, 0);
}
if ($asid == workshop::ALLOCATION_EXISTS) {
// the training assessment of the example was not found but the allocation already
// exists. this probably means that the user is the author of the reference assessment.
echo $output->header();
echo $output->box(get_string('assessmentreferenceconflict', 'workshop'));
echo $output->continue_button($workshop->view_url());
echo $output->footer();
die;
}
redirect($workshop->exassess_url($asid));
}
if ($edit and $canmanage) {
require_once dirname(__FILE__) . '/submission_form.php';
$example = file_prepare_standard_editor($example, 'content', $workshop->submission_content_options(), $workshop->context, 'mod_workshop', 'submission_content', $example->id);
$example = file_prepare_standard_filemanager($example, 'attachment', $workshop->submission_attachment_options(), $workshop->context, 'mod_workshop', 'submission_attachment', $example->id);
$mform = new workshop_submission_form($PAGE->url, array('current' => $example, 'workshop' => $workshop, 'contentopts' => $workshop->submission_content_options(), 'attachmentopts' => $workshop->submission_attachment_options()));
if ($mform->is_cancelled()) {
redirect($workshop->view_url());
} elseif ($canmanage and $formdata = $mform->get_data()) {
if ($formdata->example == 1) {
// this was used just for validation, it must be set to one when dealing with example submissions
unset($formdata->example);
} else {
throw new coding_exception('Invalid submission form data value: example');
}
$timenow = time();
if (is_null($example->id)) {
$formdata->workshopid = $workshop->id;
$formdata->example = 1;
示例2: elseif
} elseif ($submission->id and $ispublished) {
// ok you can go
$seenaspublished = true;
} elseif (is_null($submission->id) and $cansubmit) {
// ok you can go
} else {
print_error('nopermissions', 'error', $workshop->view_url(), 'view or create submission');
}
if ($assess and $submission->id and !$isreviewer and $canallocate and $workshop->assessing_allowed($USER->id)) {
require_sesskey();
$assessmentid = $workshop->add_allocation($submission, $USER->id);
redirect($workshop->assess_url($assessmentid));
}
if ($edit) {
require_once __DIR__ . '/submission_form.php';
$submission = file_prepare_standard_editor($submission, 'content', $workshop->submission_content_options(), $workshop->context, 'mod_workshop', 'submission_content', $submission->id);
$submission = file_prepare_standard_filemanager($submission, 'attachment', $workshop->submission_attachment_options(), $workshop->context, 'mod_workshop', 'submission_attachment', $submission->id);
$mform = new workshop_submission_form($PAGE->url, array('current' => $submission, 'workshop' => $workshop, 'contentopts' => $workshop->submission_content_options(), 'attachmentopts' => $workshop->submission_attachment_options()));
if ($mform->is_cancelled()) {
redirect($workshop->view_url());
} elseif ($cansubmit and $formdata = $mform->get_data()) {
if ($formdata->example == 0) {
// this was used just for validation, it must be set to zero when dealing with normal submissions
unset($formdata->example);
} else {
throw new coding_exception('Invalid submission form data value: example');
}
$timenow = time();
if (is_null($submission->id)) {
$formdata->workshopid = $workshop->id;
$formdata->example = 0;