コード例 #1
0
if ($userid) {
    $vpl->prepare_page('forms/submission.php', array('id' => $id, 'userid' => $userid));
} else {
    $vpl->prepare_page('forms/submission.php', array('id' => $id));
}
if (!$vpl->is_submit_able()) {
    notice(get_string('notavailable'));
}
if (!$userid || $userid == $USER->id) {
    //Make own submission
    $userid = $USER->id;
    if ($vpl->get_instance()->restrictededitor) {
        $vpl->require_capability(VPL_MANAGE_CAPABILITY);
    }
    $vpl->require_capability(VPL_SUBMIT_CAPABILITY);
    $vpl->network_check();
    $vpl->password_check();
} else {
    //Make other user submission
    $vpl->require_capability(VPL_MANAGE_CAPABILITY);
}
$instance = $vpl->get_instance();
$vpl->print_header(get_string('submission', VPL));
$vpl->print_view_tabs(basename(__FILE__));
$mform = new mod_vpl_submission_form('submission.php', $vpl);
if ($mform->is_cancelled()) {
    vpl_inmediate_redirect(vpl_mod_href('view.php', 'id', $id));
    die;
}
if ($fromform = $mform->get_data()) {
    $raw_POST_size = strlen(file_get_contents("php://input"));