本文整理匯總了PHP中lesson_page::get_jumptooptions方法的典型用法代碼示例。如果您正苦於以下問題:PHP lesson_page::get_jumptooptions方法的具體用法?PHP lesson_page::get_jumptooptions怎麽用?PHP lesson_page::get_jumptooptions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類lesson_page
的用法示例。
在下文中一共展示了lesson_page::get_jumptooptions方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: get_coursemodule_from_id
$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
$lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST));
require_login($course, false, $cm);
$context = context_module::instance($cm->id);
require_capability('mod/lesson:edit', $context);
$PAGE->set_url('/mod/lesson/editpage.php', array('pageid' => $pageid, 'id' => $id, 'qtype' => $qtype));
$PAGE->set_pagelayout('admin');
if ($edit) {
$editpage = lesson_page::load($pageid, $lesson);
$qtype = $editpage->qtype;
$edit = true;
} else {
$edit = false;
}
$jumpto = lesson_page::get_jumptooptions($pageid, $lesson);
$manager = lesson_page_type_manager::get($lesson);
$editoroptions = array('noclean' => true, 'maxfiles' => EDITOR_UNLIMITED_FILES, 'maxbytes' => $CFG->maxbytes);
// If the previous page was the Question type selection form, this form
// will have a different name (e.g. _qf__lesson_add_page_form_selection
// versus _qf__lesson_add_page_form_multichoice). This causes confusion
// in moodleform::_process_submission because the array key check doesn't
// tie up with the current form name, which in turn means the "submitted"
// check ends up evaluating as false, thus it's not possible to check whether
// the Question type selection was cancelled. For this reason, a dummy form
// is created here solely to check whether the selection was cancelled.
if ($qtype) {
$mformdummy = $manager->get_page_form(0, array('editoroptions' => $editoroptions, 'jumpto' => $jumpto, 'lesson' => $lesson, 'edit' => $edit, 'maxbytes' => $PAGE->course->maxbytes, 'returnto' => $returnto));
if ($mformdummy->is_cancelled()) {
redirect($returnto);
exit;