Skip to content

Commit

Permalink
Issue #93: Add support for lesson_pages
Browse files Browse the repository at this point in the history
  • Loading branch information
petersistrom authored and brendanheywood committed Dec 9, 2024
1 parent ce6c555 commit 88f33f9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions classes/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ private static function build_search_query(db_search $search, string $table, dat
'book_chapters' => ['t.bookid as id, t.id as chapterid,', 'LEFT JOIN {book} t2 ON t.bookid = t2.id'],
'forum_posts' => ['t.id as id,', 'LEFT JOIN {forum_discussions} t2 ON t.discussion = t2.id
LEFT JOIN {forum} f ON t2.forum = f.id'],
'lesson_pages' => ['t.lessonid as id, t.id as pageid,', 'LEFT JOIN {lesson} t2 ON t.lessonid = t2.id'],
];

$regex = $search->get('regex');
Expand Down Expand Up @@ -611,6 +612,9 @@ public static function find_link_function($table, $column) {
} else if ($module->name == 'book' && isset($record->chapterid)) {
$url = new \moodle_url("/mod/{$module->name}/view.php", ['id' => $coursemodule->id, 'chapterid' => $record->chapterid]);
return $url->out(false);
} else if ($module->name == 'lesson' && isset($record->pageid)) {
$url = new \moodle_url("/mod/{$module->name}/view.php", ['id' => $coursemodule->id, 'pageid' => $record->pageid]);
return $url->out(false);
} else {
$url = new \moodle_url("/mod/{$module->name}/view.php", ['id' => $coursemodule->id]);
return $url->out();
Expand Down

0 comments on commit 88f33f9

Please sign in to comment.