本文整理汇总了PHP中lesson::is_sub_page_of_type方法的典型用法代码示例。如果您正苦于以下问题:PHP lesson::is_sub_page_of_type方法的具体用法?PHP lesson::is_sub_page_of_type怎么用?PHP lesson::is_sub_page_of_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lesson
的用法示例。
在下文中一共展示了lesson::is_sub_page_of_type方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_jumptooptions
/**
* Returns an array of options to display when choosing the jumpto for a page/answer
* @static
* @param int $pageid
* @param lesson $lesson
* @return array
*/
public static function get_jumptooptions($pageid, lesson $lesson)
{
global $DB;
$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 ($pageid == 0) {
return $jump;
}
$pages = $lesson->load_all_pages();
if ($pages[$pageid]->qtype == LESSON_PAGE_BRANCHTABLE || $lesson->is_sub_page_of_type($pageid, array(LESSON_PAGE_BRANCHTABLE), array(LESSON_PAGE_ENDOFBRANCH, LESSON_PAGE_CLUSTER))) {
$jump[LESSON_UNSEENBRANCHPAGE] = get_string("unseenpageinbranch", "lesson");
$jump[LESSON_RANDOMPAGE] = get_string("randompageinbranch", "lesson");
}
if ($pages[$pageid]->qtype == LESSON_PAGE_CLUSTER || $lesson->is_sub_page_of_type($pageid, array(LESSON_PAGE_CLUSTER), array(LESSON_PAGE_ENDOFCLUSTER))) {
$jump[LESSON_CLUSTERJUMP] = get_string("clusterjump", "lesson");
}
if (!optional_param('firstpage', 0, PARAM_INT)) {
$apageid = $DB->get_field("lesson_pages", "id", array("lessonid" => $lesson->id, "prevpageid" => 0));
while (true) {
if ($apageid) {
$title = $DB->get_field("lesson_pages", "title", array("id" => $apageid));
$jump[$apageid] = strip_tags(format_string($title, true));
$apageid = $DB->get_field("lesson_pages", "nextpageid", array("id" => $apageid));
} else {
// last page reached
break;
}
}
}
return $jump;
}