diff --git a/addvideo.php b/addvideo.php index 80600146..2e9d1d21 100644 --- a/addvideo.php +++ b/addvideo.php @@ -35,10 +35,9 @@ require_once($CFG->dirroot . '/repository/lib.php'); $courseid = required_param('courseid', PARAM_INT); -if ($courseid == $SITE->id) { - $series = optional_param('series', null, PARAM_ALPHANUMEXT); -} else { - $series = null; +$series = optional_param('intoseries', null, PARAM_ALPHANUMEXT); +if ($series && $courseid != $SITE->id) { + throw new coding_exception('intoseries parameter is not allowed in connection with a non-frontpage course.'); } $ocinstanceid = optional_param('ocinstanceid', settings_api::get_default_ocinstance()->id, PARAM_INT); @@ -47,7 +46,7 @@ 'courseid' => $courseid, ]; if ($series) { - $baseurlparams['series'] = $series; + $baseurlparams['intoseries'] = $series; } $baseurl = new moodle_url('/blocks/opencast/addvideo.php', $baseurlparams); @@ -121,12 +120,12 @@ $usereventdefaults = (!empty($userdefaults['event'])) ? $userdefaults['event'] : []; if ($series) { - $addvideoform = new addvideo_form(null, + $addvideoform = new addvideo_form($PAGE->url, ['courseid' => $courseid, 'metadata_catalog' => $metadatacatalog, 'eventdefaults' => $usereventdefaults, 'ocinstanceid' => $ocinstanceid, 'series' => $series, ] ); } else { - $addvideoform = new addvideo_form(null, + $addvideoform = new addvideo_form($PAGE->url, ['courseid' => $courseid, 'metadata_catalog' => $metadatacatalog, 'eventdefaults' => $usereventdefaults, 'ocinstanceid' => $ocinstanceid, ] ); diff --git a/overview_videos.php b/overview_videos.php index 22e3aaee..f16f64af 100644 --- a/overview_videos.php +++ b/overview_videos.php @@ -124,7 +124,7 @@ // Show "Add video" button. $addvideourl = new moodle_url('/blocks/opencast/addvideo.php', ['courseid' => $SITE->id, - 'ocinstanceid' => $ocinstanceid, 'series' => $series, ]); + 'ocinstanceid' => $ocinstanceid, 'intoseries' => $series, ]); $addvideobutton = $OUTPUT->single_button($addvideourl, get_string('addvideo', 'block_opencast'), 'get'); echo html_writer::div($addvideobutton);