pagepath = 'mod/lesson/addbranchtable'; // first get the preceeding page $pageid = required_param('pageid', PARAM_INT); // set of jump array $jump = array(); $jump[0] = get_string("thispage", "lesson"); $jump[LESSON_NEXTPAGE] = get_string("nextpage", "lesson"); $jump[LESSON_PREVIOUSPAGE] = get_string("previouspage", "lesson"); $jump[LESSON_EOL] = get_string("endoflesson", "lesson"); if (!optional_param('firstpage', 0, PARAM_INT)) { if (!$apageid = get_field("lesson_pages", "id", "lessonid", $lesson->id, "prevpageid", 0)) { error("Add page: first page not found"); } while (true) { if ($apageid) { $title = get_field("lesson_pages", "title", "id", $apageid); $jump[$apageid] = $title; $apageid = get_field("lesson_pages", "nextpageid", "id", $apageid); } else { // last page reached break; } } } // give teacher a blank proforma print_heading_with_help(get_string("addabranchtable", "lesson"), "overview", "lesson"); ?>