mirror of
https://github.com/mediacms-io/mediacms.git
synced 2026-05-06 20:39:47 -04:00
wtv
This commit is contained in:
@@ -259,12 +259,31 @@ class text_filter extends \core_filters\text_filter {
|
||||
return $anchor_html;
|
||||
}
|
||||
|
||||
$courseid = isset($COURSE->id) ? (int)$COURSE->id : 0;
|
||||
|
||||
$view_url = new moodle_url('/filter/mediacms/my_media.php', [
|
||||
'token' => $token,
|
||||
'courseid' => isset($COURSE->id) ? (int)$COURSE->id : 0,
|
||||
'courseid' => $courseid,
|
||||
]);
|
||||
|
||||
return html_writer::tag('a', $text_matches[1], [
|
||||
$launch_url = new moodle_url('/filter/mediacms/launch.php', [
|
||||
'token' => $token,
|
||||
'courseid' => $courseid,
|
||||
]);
|
||||
|
||||
// Hidden iframe fires the LTI launch silently on every page load.
|
||||
// When the media owner (teacher) loads the page, EmbedMediaLTIView's
|
||||
// auto-share logic runs, marking the media as shared — same as for
|
||||
// regular embedded iframes. Visits by non-owners are harmless.
|
||||
$hidden_iframe = html_writer::tag('iframe', '', [
|
||||
'src' => $launch_url->out(false),
|
||||
'style' => 'display:none;width:0;height:0;border:0;',
|
||||
'title' => '',
|
||||
'tabindex' => '-1',
|
||||
'aria-hidden' => 'true',
|
||||
]);
|
||||
|
||||
return $hidden_iframe . html_writer::tag('a', $text_matches[1], [
|
||||
'href' => $view_url->out(false),
|
||||
'target' => '_blank',
|
||||
'rel' => 'noopener noreferrer',
|
||||
|
||||
Reference in New Issue
Block a user