Skip to content

Commit

Permalink
Merge pull request #24 from Opencast-Moodle/update/4.3
Browse files Browse the repository at this point in the history
running cbf and increasing version number
  • Loading branch information
NinaHerrmann authored Nov 23, 2023
2 parents 19b31e8 + 33bfeec commit 3a17d4a
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 28 deletions.
14 changes: 7 additions & 7 deletions db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@

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

$capabilities = array(
'repository/opencast:view' => array(
$capabilities = [
'repository/opencast:view' => [
'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
'archetypes' => [
'coursecreator' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
)
);
'manager' => CAP_ALLOW,
],
],
];
2 changes: 1 addition & 1 deletion db/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function xmldb_repository_opencast_install() {
$result = true;
require_once($CFG->dirroot . '/repository/lib.php');

$opencastplugin = new repository_type('opencast', array(), true);
$opencastplugin = new repository_type('opencast', [], true);

if (!$id = $opencastplugin->create(true)) {
$result = false;
Expand Down
22 changes: 11 additions & 11 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot . '/repository/lib.php');

use \tool_opencast\local\api;
use tool_opencast\local\api;

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

$options = array();
$options = [];
foreach (\tool_opencast\local\settings_api::get_ocinstances() as $ocinstance) {
$options[$ocinstance->id] = $ocinstance->name;
}
Expand Down Expand Up @@ -89,7 +89,7 @@ public static function instance_config_form($mform) {
* @param array $options settings
* @return bool
*/
public function set_option($options = array()) {
public function set_option($options = []) {
$options['opencast_instance'] = clean_param($options['opencast_instance'], PARAM_INT);
$options['opencast_author'] = clean_param($options['opencast_author'], PARAM_TEXT);
$options['opencast_channelid'] = clean_param($options['opencast_channelid'], PARAM_TEXT);
Expand All @@ -107,7 +107,7 @@ public function set_option($options = array()) {
* @return array
*/
public static function get_instance_option_names() {
$instanceoptions = array();
$instanceoptions = [];
$instanceoptions[] = 'opencast_instance';
$instanceoptions[] = 'opencast_author';
$instanceoptions[] = 'opencast_channelid';
Expand Down Expand Up @@ -289,10 +289,10 @@ private function get_course_videos($courseid) {

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

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

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

$ret = array();
$ret = [];
$ret['dynload'] = false;
$ret['nosearch'] = true;
$ret['nologin'] = true;
$ret['list'] = array();
$ret['list'] = [];

foreach ($videos as $video) {
$listitem = array();
$listitem = [];
$listitem['title'] = $video->title;
if (!file_extension_in_typegroup($video->title, $this->supported_filetypes())) {
$listitem['title'] = $video->title . '.mp4';
Expand Down Expand Up @@ -370,7 +370,7 @@ public function supported_returntypes() {
* @return string[]
*/
public function supported_filetypes() {
return array('video');
return ['video'];
}

/**
Expand Down
9 changes: 7 additions & 2 deletions tests/repository_opencast_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
*/
class repository_opencast_test extends advanced_testcase {

/**
* Test creation of instance...
*
* @covers \repository_opencast\lib.php
*/
public function test_add_video_published_data() {
global $CFG;

Expand All @@ -49,7 +54,7 @@ public function test_add_video_published_data() {
'opencast_thumbnailflavor' => 'presenter/search+preview',
'opencast_thumbnailflavorfallback' => 'presentation/search+preview',
'opencast_videoflavor' => 'delivery/h264-720p',
'opencast_playerurl' => ''
'opencast_playerurl' => '',
]);
$repository = new repository_opencast($instance->id);

Expand All @@ -71,7 +76,7 @@ public function test_add_video_published_data() {
'opencast_thumbnailflavor' => 'notvalid',
'opencast_thumbnailflavorfallback' => 'presentation/search+preview',
'opencast_videoflavor' => 'delivery/h264-720p',
'opencast_playerurl' => ''
'opencast_playerurl' => '',
]);
$repository = new repository_opencast($instance->id);

Expand Down
14 changes: 7 additions & 7 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
defined('MOODLE_INTERNAL') || die();

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

0 comments on commit 3a17d4a

Please sign in to comment.