This commit is contained in:
Markos Gogoulos
2026-02-20 13:28:26 +02:00
parent 58d336478c
commit cdbed4bc1d
3 changed files with 24 additions and 2 deletions

View File

@@ -208,6 +208,7 @@ class text_filter extends \core_filters\text_filter {
$launch_url = new moodle_url('/filter/mediacms/launch.php', [
'token' => $token,
'courseid' => isset($COURSE->id) ? (int)$COURSE->id : 0,
'show_media_page' => 'true',
]);
if (!self::$textlink_js_added) {

View File

@@ -28,6 +28,7 @@ $showRelated = optional_param('showRelated', '', PARAM_TEXT);
$showUserAvatar = optional_param('showUserAvatar', '', PARAM_TEXT);
$linkTitle = optional_param('linkTitle', '', PARAM_TEXT);
$startTime = optional_param('t', '', PARAM_TEXT);
$show_media_page = optional_param('show_media_page', '', PARAM_TEXT);
// Get configuration
$mediacmsurl = get_config('filter_mediacms', 'mediacmsurl');
@@ -89,6 +90,9 @@ if ($linkTitle !== '') {
if ($startTime !== '') {
$custom_params[] = "embed_start_time=" . $startTime;
}
if ($show_media_page === 'true') {
$custom_params[] = "show_media_page=true";
}
$instance->instructorcustomparameters = implode("\n", $custom_params);
$instance->name = 'MediaCMS Video: ' . $mediatoken;
@@ -117,6 +121,9 @@ if ($linkTitle !== '') {
if ($startTime !== '') {
$page_params['t'] = $startTime;
}
if ($show_media_page === 'true') {
$page_params['show_media_page'] = 'true';
}
$PAGE->set_url(new moodle_url('/filter/mediacms/launch.php', $page_params));
$PAGE->set_context($context);
@@ -149,6 +156,9 @@ if ($linkTitle !== '') {
if ($startTime !== '') {
$hidden_fields .= '<input type="hidden" name="embed_start_time" value="' . htmlspecialchars($startTime, ENT_QUOTES) . '" />';
}
if ($show_media_page === 'true') {
$hidden_fields .= '<input type="hidden" name="show_media_page" value="true" />';
}
if ($width) {
$hidden_fields .= '<input type="hidden" name="embed_width" value="' . htmlspecialchars($width, ENT_QUOTES) . '" />';
}