当前位置: 首页>>代码示例>>PHP>>正文


PHP lesson_page::get_jumptooptions方法代码示例

本文整理汇总了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;
开发者ID:evltuma,项目名称:moodle,代码行数:31,代码来源:editpage.php


注:本文中的lesson_page::get_jumptooptions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。