26
26
defined ('MOODLE_INTERNAL ' ) || die ();
27
27
require_once ($ CFG ->dirroot . '/repository/lib.php ' );
28
28
29
- use \ tool_opencast \local \api ;
29
+ use tool_opencast \local \api ;
30
30
31
31
/**
32
32
* repository_opencast class is used to browse opencast files
@@ -50,7 +50,7 @@ public static function instance_config_form($mform) {
50
50
return false ;
51
51
}
52
52
53
- $ options = array () ;
53
+ $ options = [] ;
54
54
foreach (\tool_opencast \local \settings_api::get_ocinstances () as $ ocinstance ) {
55
55
$ options [$ ocinstance ->id ] = $ ocinstance ->name ;
56
56
}
@@ -89,7 +89,7 @@ public static function instance_config_form($mform) {
89
89
* @param array $options settings
90
90
* @return bool
91
91
*/
92
- public function set_option ($ options = array () ) {
92
+ public function set_option ($ options = [] ) {
93
93
$ options ['opencast_instance ' ] = clean_param ($ options ['opencast_instance ' ], PARAM_INT );
94
94
$ options ['opencast_author ' ] = clean_param ($ options ['opencast_author ' ], PARAM_TEXT );
95
95
$ options ['opencast_channelid ' ] = clean_param ($ options ['opencast_channelid ' ], PARAM_TEXT );
@@ -107,7 +107,7 @@ public function set_option($options = array()) {
107
107
* @return array
108
108
*/
109
109
public static function get_instance_option_names () {
110
- $ instanceoptions = array () ;
110
+ $ instanceoptions = [] ;
111
111
$ instanceoptions [] = 'opencast_instance ' ;
112
112
$ instanceoptions [] = 'opencast_author ' ;
113
113
$ instanceoptions [] = 'opencast_channelid ' ;
@@ -289,10 +289,10 @@ private function get_course_videos($courseid) {
289
289
290
290
// Get all videos from all series.
291
291
$ ocinstanceid = $ this ->get_ocinstance ();
292
- $ videos = array () ;
292
+ $ videos = [] ;
293
293
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 ) {
296
296
if (!$ mapping || !($ seriesid = $ mapping ->get ('series ' ))) {
297
297
continue ;
298
298
}
@@ -334,14 +334,14 @@ public function get_listing($encodedpath = '', $page = '') {
334
334
335
335
$ videos = $ this ->get_course_videos ($ course ->id );
336
336
337
- $ ret = array () ;
337
+ $ ret = [] ;
338
338
$ ret ['dynload ' ] = false ;
339
339
$ ret ['nosearch ' ] = true ;
340
340
$ ret ['nologin ' ] = true ;
341
- $ ret ['list ' ] = array () ;
341
+ $ ret ['list ' ] = [] ;
342
342
343
343
foreach ($ videos as $ video ) {
344
- $ listitem = array () ;
344
+ $ listitem = [] ;
345
345
$ listitem ['title ' ] = $ video ->title ;
346
346
if (!file_extension_in_typegroup ($ video ->title , $ this ->supported_filetypes ())) {
347
347
$ listitem ['title ' ] = $ video ->title . '.mp4 ' ;
@@ -370,7 +370,7 @@ public function supported_returntypes() {
370
370
* @return string[]
371
371
*/
372
372
public function supported_filetypes () {
373
- return array ( 'video ' ) ;
373
+ return [ 'video ' ] ;
374
374
}
375
375
376
376
/**
0 commit comments