Skip to content

Commit 3a17d4a

Browse files
authored
Merge pull request #24 from Opencast-Moodle/update/4.3
running cbf and increasing version number
2 parents 19b31e8 + 33bfeec commit 3a17d4a

File tree

5 files changed

+33
-28
lines changed

5 files changed

+33
-28
lines changed

db/access.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@
2525

2626
defined('MOODLE_INTERNAL') || die();
2727

28-
$capabilities = array(
29-
'repository/opencast:view' => array(
28+
$capabilities = [
29+
'repository/opencast:view' => [
3030
'captype' => 'read',
3131
'contextlevel' => CONTEXT_MODULE,
32-
'archetypes' => array(
32+
'archetypes' => [
3333
'coursecreator' => CAP_ALLOW,
3434
'teacher' => CAP_ALLOW,
3535
'editingteacher' => CAP_ALLOW,
36-
'manager' => CAP_ALLOW
37-
)
38-
)
39-
);
36+
'manager' => CAP_ALLOW,
37+
],
38+
],
39+
];

db/install.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function xmldb_repository_opencast_install() {
3333
$result = true;
3434
require_once($CFG->dirroot . '/repository/lib.php');
3535

36-
$opencastplugin = new repository_type('opencast', array(), true);
36+
$opencastplugin = new repository_type('opencast', [], true);
3737

3838
if (!$id = $opencastplugin->create(true)) {
3939
$result = false;

lib.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
defined('MOODLE_INTERNAL') || die();
2727
require_once($CFG->dirroot . '/repository/lib.php');
2828

29-
use \tool_opencast\local\api;
29+
use tool_opencast\local\api;
3030

3131
/**
3232
* repository_opencast class is used to browse opencast files
@@ -50,7 +50,7 @@ public static function instance_config_form($mform) {
5050
return false;
5151
}
5252

53-
$options = array();
53+
$options = [];
5454
foreach (\tool_opencast\local\settings_api::get_ocinstances() as $ocinstance) {
5555
$options[$ocinstance->id] = $ocinstance->name;
5656
}
@@ -89,7 +89,7 @@ public static function instance_config_form($mform) {
8989
* @param array $options settings
9090
* @return bool
9191
*/
92-
public function set_option($options = array()) {
92+
public function set_option($options = []) {
9393
$options['opencast_instance'] = clean_param($options['opencast_instance'], PARAM_INT);
9494
$options['opencast_author'] = clean_param($options['opencast_author'], PARAM_TEXT);
9595
$options['opencast_channelid'] = clean_param($options['opencast_channelid'], PARAM_TEXT);
@@ -107,7 +107,7 @@ public function set_option($options = array()) {
107107
* @return array
108108
*/
109109
public static function get_instance_option_names() {
110-
$instanceoptions = array();
110+
$instanceoptions = [];
111111
$instanceoptions[] = 'opencast_instance';
112112
$instanceoptions[] = 'opencast_author';
113113
$instanceoptions[] = 'opencast_channelid';
@@ -289,10 +289,10 @@ private function get_course_videos($courseid) {
289289

290290
// Get all videos from all series.
291291
$ocinstanceid = $this->get_ocinstance();
292-
$videos = array();
292+
$videos = [];
293293

294-
foreach (\tool_opencast\seriesmapping::get_records(array('courseid' => $courseid,
295-
'ocinstanceid' => $ocinstanceid)) as $mapping) {
294+
foreach (\tool_opencast\seriesmapping::get_records(['courseid' => $courseid,
295+
'ocinstanceid' => $ocinstanceid, ]) as $mapping) {
296296
if (!$mapping || !($seriesid = $mapping->get('series'))) {
297297
continue;
298298
}
@@ -334,14 +334,14 @@ public function get_listing($encodedpath = '', $page = '') {
334334

335335
$videos = $this->get_course_videos($course->id);
336336

337-
$ret = array();
337+
$ret = [];
338338
$ret['dynload'] = false;
339339
$ret['nosearch'] = true;
340340
$ret['nologin'] = true;
341-
$ret['list'] = array();
341+
$ret['list'] = [];
342342

343343
foreach ($videos as $video) {
344-
$listitem = array();
344+
$listitem = [];
345345
$listitem['title'] = $video->title;
346346
if (!file_extension_in_typegroup($video->title, $this->supported_filetypes())) {
347347
$listitem['title'] = $video->title . '.mp4';
@@ -370,7 +370,7 @@ public function supported_returntypes() {
370370
* @return string[]
371371
*/
372372
public function supported_filetypes() {
373-
return array('video');
373+
return ['video'];
374374
}
375375

376376
/**

tests/repository_opencast_test.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@
3131
*/
3232
class repository_opencast_test extends advanced_testcase {
3333

34+
/**
35+
* Test creation of instance...
36+
*
37+
* @covers \repository_opencast\lib.php
38+
*/
3439
public function test_add_video_published_data() {
3540
global $CFG;
3641

@@ -49,7 +54,7 @@ public function test_add_video_published_data() {
4954
'opencast_thumbnailflavor' => 'presenter/search+preview',
5055
'opencast_thumbnailflavorfallback' => 'presentation/search+preview',
5156
'opencast_videoflavor' => 'delivery/h264-720p',
52-
'opencast_playerurl' => ''
57+
'opencast_playerurl' => '',
5358
]);
5459
$repository = new repository_opencast($instance->id);
5560

@@ -71,7 +76,7 @@ public function test_add_video_published_data() {
7176
'opencast_thumbnailflavor' => 'notvalid',
7277
'opencast_thumbnailflavorfallback' => 'presentation/search+preview',
7378
'opencast_videoflavor' => 'delivery/h264-720p',
74-
'opencast_playerurl' => ''
79+
'opencast_playerurl' => '',
7580
]);
7681
$repository = new repository_opencast($instance->id);
7782

version.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
defined('MOODLE_INTERNAL') || die();
2727

2828
$plugin->component = 'repository_opencast';
29-
$plugin->release = 'development-version';
30-
$plugin->version = 2023030100;
31-
$plugin->requires = 2020061500; // Requires Moodle 3.9+.
32-
$plugin->maturity = MATURITY_ALPHA;
33-
$plugin->dependencies = array(
34-
'tool_opencast' => 2023030100
35-
);
29+
$plugin->release = 'v4.3-r1';
30+
$plugin->version = 2023112200;
31+
$plugin->requires = 2020061524; // Requires Moodle 3.9+.
32+
$plugin->maturity = MATURITY_STABLE;
33+
$plugin->dependencies = [
34+
'tool_opencast' => 2023112200,
35+
];

0 commit comments

Comments
 (0)