本文整理汇总了PHP中Core\Session\manager::keepalive方法的典型用法代码示例。如果您正苦于以下问题:PHP manager::keepalive方法的具体用法?PHP manager::keepalive怎么用?PHP manager::keepalive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Core\Session\manager
的用法示例。
在下文中一共展示了manager::keepalive方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
require_once __DIR__ . '/edit_form.php';
require_once $CFG->dirroot . '/grade/grading/lib.php';
$areaid = required_param('areaid', PARAM_INT);
$manager = get_grading_manager($areaid);
list($context, $course, $cm) = get_context_info_array($manager->get_context()->id);
require_login($course, true, $cm);
require_capability('moodle/grade:managegradingforms', $context);
$controller = $manager->get_controller('guide');
$PAGE->set_url(new moodle_url('/grade/grading/form/guide/edit.php', array('areaid' => $areaid)));
$PAGE->set_title(get_string('definemarkingguide', 'gradingform_guide'));
$PAGE->set_heading(get_string('definemarkingguide', 'gradingform_guide'));
$mform = new gradingform_guide_editguide(null, array('areaid' => $areaid, 'context' => $context, 'allowdraft' => !$controller->has_active_instances()), 'post', '', array('class' => 'gradingform_guide_editform'));
$data = $controller->get_definition_for_editing(true);
$returnurl = optional_param('returnurl', $manager->get_management_url(), PARAM_LOCALURL);
$data->returnurl = $returnurl;
$mform->set_data($data);
if ($mform->is_cancelled()) {
redirect($returnurl);
} else {
if ($mform->is_submitted() && $mform->is_validated() && !$mform->need_confirm_regrading($controller)) {
// Everything ok, validated, re-grading confirmed if needed. Make changes to the rubric.
$controller->update_definition($mform->get_data());
redirect($returnurl);
}
}
// Try to keep the session alive on this page as it may take some time
// before significant interaction happens with the server.
\core\session\manager::keepalive();
echo $OUTPUT->header();
$mform->display();
echo $OUTPUT->footer();