Skip to content

Commit 85ea8cc

Browse files
committed
Merge branch 'upgrade-500'
2 parents b7aa7ce + 0bd8bac commit 85ea8cc

13 files changed

+59
-49
lines changed

.github/workflows/config.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"main-moodle": "MOODLE_405_STABLE",
2+
"main-moodle": "MOODLE_500_STABLE",
33
"main-php": "8.3",
4-
"main-oc": "17.1",
4+
"main-oc": "16.7",
55
"ocs": ["17.1", "16.7", "15.11"],
66
"main-db": "mariadb",
77
"moodle-php": {
8-
"MOODLE_405_STABLE": ["8.1", "8.2"]
8+
"MOODLE_500_STABLE": ["8.2", "8.3"]
99
},
10-
"moodle-plugin-ci": "4.4.5"
10+
"moodle-plugin-ci": "4.5.6"
1111
}

.github/workflows/moodle-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ jobs:
1111
uses: Opencast-Moodle/moodle-workflows-opencast/.github/workflows/moodle-ci.yml@main
1212
with:
1313
requires-tool-plugin: true
14-
branch-tool-plugin: MOODLE_405_STABLE
14+
branch-tool-plugin: upgrade-500

.github/workflows/moodle-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212
call-moodle-release-workflow:
13-
uses: Opencast-Moodle/moodle-workflows-opencast/.github/workflows/moodle-release.yml@master
13+
uses: Opencast-Moodle/moodle-workflows-opencast/.github/workflows/moodle-release.yml@main
1414
with:
1515
plugin-name: 'mod_opencast'
1616
secrets: inherit

CHANGELOG.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
CHANGELOG
22
=========
33

4-
4.5.4 (2025-08-01)
4+
5.0.0 (2024-08-01)
55
------------------
6-
* [FEATURE] #79 Pass event ID to Paella and update dependencies
7-
* [FEATURE] #69 Add quality selector for progressive download videos
8-
9-
10-
4.5.3 (2025-01-16)
11-
------------------
12-
* [FEATURE] #65 Improve error handling and messaging + opencast api integration
13-
* [FEATURE] #64 Use new opencast api exception handlers from API plugin
6+
* [CHANGE] #75 Migrate Settings from block_opencast to tool_opencast
7+
* [FEATURE] #81 Add video canvas plugin preventing the context menu on right-click
8+
* Moodle 5.0 compatible version
149

1510

1611
4.5.1 (2024-12-03)

downloadvideo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2323
*/
2424

25-
use block_opencast\local\apibridge;
25+
use tool_opencast\local\apibridge;
2626
require_once('../../config.php');
2727

2828
global $PAGE, $OUTPUT, $CFG, $DB;

lib.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ function mod_opencast_get_fontawesome_icon_map() {
144144
function opencast_dndupload_register() {
145145
// Getting default opencast instance.
146146
$defaultocinstanceid = \tool_opencast\local\settings_api::get_default_ocinstance()->id;
147-
// Getting file extensions from the block_opencast configuration using default ocinstanceid.
148-
$videotypescfg = get_config('block_opencast', 'uploadfileextensions_' . $defaultocinstanceid);
147+
// Getting file extensions from the tool_opencast configuration using default ocinstanceid.
148+
$videotypescfg = get_config('tool_opencast', 'uploadfileextensions_' . $defaultocinstanceid);
149149
$videoexts = empty($videotypescfg) || $videotypescfg == 'video' ?
150150
file_get_typegroup('extension', 'video') :
151151
array_map('trim', explode(',', $videotypescfg));

paella/paella-player.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

paella/paella-player.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { VideoCanvasPlugin } from 'paella-core';
2+
3+
export default class VideoCanvasWithoutContextMenuPlugin extends VideoCanvasPlugin {
4+
get name() {
5+
return 'org.opencast.paella.videoCanvasWithoutContextMenu';
6+
}
7+
8+
getCanvasInstance(videoContainer) {
9+
videoContainer.addEventListener('contextmenu', (e) => {
10+
e.preventDefault();
11+
});
12+
13+
return super.getCanvasInstance(videoContainer);
14+
}
15+
}

uploadvideo.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
require_once($CFG->libdir . '/gradelib.php');
2929
require_once(__DIR__ . '/uploadvideo_form.php');
3030

31-
use block_opencast\local\apibridge;
31+
use tool_opencast\local\apibridge;
3232
use tool_opencast\local\settings_api;
33-
use block_opencast\local\upload_helper;
33+
use tool_opencast\local\upload_helper;
3434

3535
global $PAGE, $OUTPUT, $USER, $DB;
3636

@@ -48,8 +48,8 @@
4848

4949
$context = context_module::instance($cm->id);
5050
$coursecontext = context_course::instance($course->id);
51-
// As we are doing the upload using the block_opencast, we have to use its capability as well.
52-
require_capability('block/opencast:addvideo', $coursecontext);
51+
// As we are doing the upload using the tool_opencast, we have to use its capability as well.
52+
require_capability('tool/opencast:addvideo', $coursecontext);
5353

5454
$PAGE->set_pagelayout('frametop');
5555
$PAGE->set_context($context);
@@ -62,7 +62,7 @@
6262
// Getting all the oc instances.
6363
$ocinstances = settings_api::get_ocinstances();
6464
// Getting user defaults.
65-
$userdefaultsrecord = $DB->get_record('block_opencast_user_default', ['userid' => $USER->id]);
65+
$userdefaultsrecord = $DB->get_record('tool_opencast_user_default', ['userid' => $USER->id]);
6666
$userdefaults = $userdefaultsrecord ? json_decode($userdefaultsrecord->defaults, true) : [];
6767
$usereventdefaults = (!empty($userdefaults['event'])) ? $userdefaults['event'] : [];
6868
// Getting medatadata catalogs based on the ocinstances.
@@ -128,9 +128,9 @@
128128
// Saving and getting the file.
129129
$newitemid = rand(1000000, 9999999);
130130
file_save_draft_area_files($moduleinstance->uploaddraftitemid, $coursecontext->id,
131-
'block_opencast', upload_helper::OC_FILEAREA, $newitemid);
131+
'tool_opencast', upload_helper::OC_FILEAREA, $newitemid);
132132
$fs = get_file_storage();
133-
$files = $fs->get_area_files($coursecontext->id, 'block_opencast', upload_helper::OC_FILEAREA, $newitemid, '', false);
133+
$files = $fs->get_area_files($coursecontext->id, 'tool_opencast', upload_helper::OC_FILEAREA, $newitemid, '', false);
134134
$savedvideofile = null;
135135
if ($files) {
136136
$savedvideofile = reset($files);
@@ -142,7 +142,7 @@
142142
redirect($redirecturl, get_string('uploadmissingfile', 'mod_opencast'), null, \core\output\notification::NOTIFY_ERROR);
143143
} else {
144144
$coursecontext = context_course::instance($course->id);
145-
\block_opencast\local\file_deletionmanager::track_draftitemid($coursecontext->id, $savedvideofile->get_itemid());
145+
\tool_opencast\local\file_deletionmanager::track_draftitemid($coursecontext->id, $savedvideofile->get_itemid());
146146
}
147147

148148
$flavorfieldname = 'flavor_' . $ocinstanceid;
@@ -234,10 +234,10 @@
234234
\core\notification::warning($e->getMessage());
235235
}
236236
}
237-
$blockopencastlink = new moodle_url('/blocks/opencast/index.php',
237+
$indexopencastlink = new moodle_url('/admin/tool/opencast/index.php',
238238
['courseid' => $course->id, 'ocinstanceid' => $ocinstanceid]);
239239
redirect($redirecturl,
240-
get_string('uploadsaved', 'mod_opencast', $blockopencastlink->out()), null, \core\output\notification::NOTIFY_SUCCESS);
240+
get_string('uploadsaved', 'mod_opencast', $indexopencastlink->out()), null, \core\output\notification::NOTIFY_SUCCESS);
241241
}
242242

243243
$PAGE->set_title(get_string('uploadformtitle', 'mod_opencast'));

0 commit comments

Comments
 (0)