|
@@ -27,7 +27,7 @@ discard block |
|
|
block discarded – undo |
|
27
|
27
|
|
|
28
|
28
|
global $CFG; |
|
29
|
29
|
|
|
30
|
|
-require_once(dirname(__FILE__).'/lib.php'); |
|
|
30
|
+require_once(dirname(__FILE__) . '/lib.php'); |
|
31
|
31
|
|
|
32
|
32
|
const BIGBLUEBUTTONBN_FORCED = true; |
|
33
|
33
|
|
|
@@ -76,7 +76,7 @@ discard block |
|
|
block discarded – undo |
|
76
|
76
|
if (isset($meta)) { |
|
77
|
77
|
$log->meta = $meta; |
|
78
|
78
|
} else if ($event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) { |
|
79
|
|
- $log->meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}'; |
|
|
79
|
+ $log->meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}'; |
|
80
|
80
|
} |
|
81
|
81
|
|
|
82
|
82
|
$DB->insert_record('bigbluebuttonbn_logs', $log); |
|
@@ -114,18 +114,18 @@ discard block |
|
|
block discarded – undo |
|
114
|
114
|
* @param array $metadata |
|
115
|
115
|
*/ |
|
116
|
116
|
function bigbluebuttonbn_bigbluebutton_action_url($action = '', $data = array(), $metadata = array()) { |
|
117
|
|
- $baseurl = bigbluebuttonbn_get_cfg_server_url().'api/'.$action.'?'; |
|
|
117
|
+ $baseurl = bigbluebuttonbn_get_cfg_server_url() . 'api/' . $action . '?'; |
|
118
|
118
|
$params = ''; |
|
119
|
119
|
|
|
120
|
120
|
foreach ($data as $key => $value) { |
|
121
|
|
- $params .= '&'.$key.'='.urlencode($value); |
|
|
121
|
+ $params .= '&' . $key . '=' . urlencode($value); |
|
122
|
122
|
} |
|
123
|
123
|
|
|
124
|
124
|
foreach ($metadata as $key => $value) { |
|
125
|
|
- $params .= '&'.'meta_'.$key.'='.urlencode($value); |
|
|
125
|
+ $params .= '&' . 'meta_' . $key . '=' . urlencode($value); |
|
126
|
126
|
} |
|
127
|
127
|
|
|
128
|
|
- return $baseurl.$params.'&checksum='.sha1($action.$params.bigbluebuttonbn_get_cfg_shared_secret()); |
|
|
128
|
+ return $baseurl . $params . '&checksum=' . sha1($action . $params . bigbluebuttonbn_get_cfg_shared_secret()); |
|
129
|
129
|
} |
|
130
|
130
|
|
|
131
|
131
|
function bigbluebuttonbn_get_create_meeting_array($data, $metadata = array(), $pname = null, $purl = null) { |
|
@@ -135,8 +135,8 @@ discard block |
|
|
block discarded – undo |
|
135
|
135
|
|
|
136
|
136
|
if (!is_null($pname) && !is_null($purl)) { |
|
137
|
137
|
$method = BIGBLUEBUTTONBN_METHOD_POST; |
|
138
|
|
- $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='". |
|
139
|
|
- $purl."' /></module></modules>"; |
|
|
138
|
+ $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" . |
|
|
139
|
+ $purl . "' /></module></modules>"; |
|
140
|
140
|
} |
|
141
|
141
|
|
|
142
|
142
|
$xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data); |
|
@@ -181,7 +181,7 @@ discard block |
|
|
block discarded – undo |
|
181
|
181
|
'moderatorPW' => $meeting->moderatorPW, |
|
182
|
182
|
'attendeePW' => $meeting->attendeePW, |
|
183
|
183
|
'hasBeenForciblyEnded' => $meeting->hasBeenForciblyEnded, |
|
184
|
|
- 'running' => $meeting->running, ); |
|
|
184
|
+ 'running' => $meeting->running,); |
|
185
|
185
|
} |
|
186
|
186
|
|
|
187
|
187
|
return $meetings; |
|
@@ -324,12 +324,12 @@ discard block |
|
|
block discarded – undo |
|
324
|
324
|
function bigbluebuttonbn_get_recordings_imported_array($courseid, $bigbluebuttonbnid = null, $subset = true) { |
|
325
|
325
|
global $DB; |
|
326
|
326
|
|
|
327
|
|
- $select = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '". |
|
328
|
|
- BIGBLUEBUTTONBN_LOG_EVENT_IMPORT."'"; |
|
|
327
|
+ $select = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '" . |
|
|
328
|
+ BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'"; |
|
329
|
329
|
if ($bigbluebuttonbnid === null) { |
|
330
|
|
- $select = "courseid = '{$courseid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_IMPORT."'"; |
|
|
330
|
+ $select = "courseid = '{$courseid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'"; |
|
331
|
331
|
} else if ($subset) { |
|
332
|
|
- $select = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_IMPORT."'"; |
|
|
332
|
+ $select = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'"; |
|
333
|
333
|
} |
|
334
|
334
|
$recordsimported = $DB->get_records_select('bigbluebuttonbn_logs', $select); |
|
335
|
335
|
|
|
@@ -354,35 +354,35 @@ discard block |
|
|
block discarded – undo |
|
354
|
354
|
function bigbluebuttonbn_get_default_config_xml_array() { |
|
355
|
355
|
$defaultconfigxml = bigbluebuttonbn_getDefaultConfigXML(); |
|
356
|
356
|
|
|
357
|
|
- return (array) $defaultconfigxml; |
|
|
357
|
+ return (array)$defaultconfigxml; |
|
358
|
358
|
} |
|
359
|
359
|
|
|
360
|
360
|
function bigbluebuttonbn_get_recording_array_value($recording) { |
|
361
|
361
|
// Add formats. |
|
362
|
362
|
$playbackarray = array(); |
|
363
|
363
|
foreach ($recording->playback->format as $format) { |
|
364
|
|
- $playbackarray[(string) $format->type] = array('type' => (string) $format->type, |
|
365
|
|
- 'url' => (string) $format->url, 'length' => (string) $format->length); |
|
|
364
|
+ $playbackarray[(string)$format->type] = array('type' => (string)$format->type, |
|
|
365
|
+ 'url' => (string)$format->url, 'length' => (string)$format->length); |
|
366
|
366
|
// Add preview per format when existing. |
|
367
|
367
|
if ($format->preview) { |
|
368
|
368
|
$imagesarray = array(); |
|
369
|
369
|
foreach ($format->preview->images->image as $image) { |
|
370
|
|
- $imagearray = array('url' => (string) $image); |
|
|
370
|
+ $imagearray = array('url' => (string)$image); |
|
371
|
371
|
foreach ($image->attributes() as $attkey => $attvalue) { |
|
372
|
|
- $imagearray[$attkey] = (string) $attvalue; |
|
|
372
|
+ $imagearray[$attkey] = (string)$attvalue; |
|
373
|
373
|
} |
|
374
|
374
|
array_push($imagesarray, $imagearray); |
|
375
|
375
|
} |
|
376
|
|
- $playbackarray[(string) $format->type]['preview'] = $imagesarray; |
|
|
376
|
+ $playbackarray[(string)$format->type]['preview'] = $imagesarray; |
|
377
|
377
|
} |
|
378
|
378
|
} |
|
379
|
379
|
|
|
380
|
380
|
// Add the metadata to the recordings array. |
|
381
|
381
|
$metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata)); |
|
382
|
|
- return array('recordID' => (string) $recording->recordID, |
|
383
|
|
- 'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name, |
|
384
|
|
- 'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime, |
|
385
|
|
- 'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray) + $metadataarray; |
|
|
382
|
+ return array('recordID' => (string)$recording->recordID, |
|
|
383
|
+ 'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name, |
|
|
384
|
+ 'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime, |
|
|
385
|
+ 'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray) + $metadataarray; |
|
386
|
386
|
} |
|
387
|
387
|
|
|
388
|
388
|
function bigbluebuttonbn_get_recording_array_meta($metadata) { |
|
@@ -391,7 +391,7 @@ discard block |
|
|
block discarded – undo |
|
391
|
391
|
if (is_object($value)) { |
|
392
|
392
|
$value = ''; |
|
393
|
393
|
} |
|
394
|
|
- $metadataarray['meta_'.$key] = $value; |
|
|
394
|
+ $metadataarray['meta_' . $key] = $value; |
|
395
|
395
|
} |
|
396
|
396
|
return $metadataarray; |
|
397
|
397
|
} |
|
@@ -449,7 +449,7 @@ discard block |
|
|
block discarded – undo |
|
449
|
449
|
$ids = explode(',', $recordids); |
|
450
|
450
|
foreach ($ids as $id) { |
|
451
|
451
|
$xml = bigbluebuttonbn_wrap_xml_load_file( |
|
452
|
|
- bigbluebuttonbn_bigbluebutton_action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
|
|
452
|
+ bigbluebuttonbn_bigbluebutton_action_url('updateRecordings', ['recordID' => $id] + (array)$params) |
|
453
|
453
|
); |
|
454
|
454
|
if ($xml && $xml->returncode != 'SUCCESS') { |
|
455
|
455
|
return false; |
|
@@ -604,8 +604,8 @@ discard block |
|
|
block discarded – undo |
|
604
|
604
|
|
|
605
|
605
|
$options = array(); |
|
606
|
606
|
$options['CURLOPT_HTTPHEADER'] = array( |
|
607
|
|
- 'Content-Type: '.$contenttype, |
|
608
|
|
- 'Content-Length: '.strlen($data), |
|
|
607
|
+ 'Content-Type: ' . $contenttype, |
|
|
608
|
+ 'Content-Length: ' . strlen($data), |
|
609
|
609
|
'Content-Language: en-US', |
|
610
|
610
|
); |
|
611
|
611
|
|
|
@@ -622,9 +622,9 @@ discard block |
|
|
block discarded – undo |
|
622
|
622
|
if ($userroles) { |
|
623
|
623
|
$where = ''; |
|
624
|
624
|
foreach ($userroles as $value) { |
|
625
|
|
- $where .= (empty($where) ? ' WHERE' : ' AND').' id='.$value->roleid; |
|
|
625
|
+ $where .= (empty($where) ? ' WHERE' : ' AND') . ' id=' . $value->roleid; |
|
626
|
626
|
} |
|
627
|
|
- $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where); |
|
|
627
|
+ $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where); |
|
628
|
628
|
} |
|
629
|
629
|
|
|
630
|
630
|
return $userroles; |
|
@@ -637,7 +637,7 @@ discard block |
|
|
block discarded – undo |
|
637
|
637
|
} |
|
638
|
638
|
|
|
639
|
639
|
function bigbluebuttonbn_get_users(context $context = null) { |
|
640
|
|
- $users = (array) get_enrolled_users($context); |
|
|
640
|
+ $users = (array)get_enrolled_users($context); |
|
641
|
641
|
foreach ($users as $key => $value) { |
|
642
|
642
|
$users[$key] = fullname($value); |
|
643
|
643
|
} |
|
@@ -645,7 +645,7 @@ discard block |
|
|
block discarded – undo |
|
645
|
645
|
} |
|
646
|
646
|
|
|
647
|
647
|
function bigbluebuttonbn_get_users_select(context $context = null) { |
|
648
|
|
- $users = (array) get_enrolled_users($context); |
|
|
648
|
+ $users = (array)get_enrolled_users($context); |
|
649
|
649
|
foreach ($users as $key => $value) { |
|
650
|
650
|
$users[$key] = array('id' => $value->id, 'name' => fullname($value)); |
|
651
|
651
|
} |
|
@@ -653,7 +653,7 @@ discard block |
|
|
block discarded – undo |
|
653
|
653
|
} |
|
654
|
654
|
|
|
655
|
655
|
function bigbluebuttonbn_get_roles(context $context = null) { |
|
656
|
|
- $roles = (array) role_get_names($context); |
|
|
656
|
+ $roles = (array)role_get_names($context); |
|
657
|
657
|
foreach ($roles as $key => $value) { |
|
658
|
658
|
$roles[$key] = $value->localname; |
|
659
|
659
|
} |
|
@@ -661,7 +661,7 @@ discard block |
|
|
block discarded – undo |
|
661
|
661
|
} |
|
662
|
662
|
|
|
663
|
663
|
function bigbluebuttonbn_get_roles_select(context $context = null) { |
|
664
|
|
- $roles = (array) role_get_names($context); |
|
|
664
|
+ $roles = (array)role_get_names($context); |
|
665
|
665
|
foreach ($roles as $key => $value) { |
|
666
|
666
|
$roles[$key] = array('id' => $value->id, 'name' => $value->localname); |
|
667
|
667
|
} |
|
@@ -669,7 +669,7 @@ discard block |
|
|
block discarded – undo |
|
669
|
669
|
} |
|
670
|
670
|
|
|
671
|
671
|
function bigbluebuttonbn_get_role($id) { |
|
672
|
|
- $roles = (array) role_get_names(); |
|
|
672
|
+ $roles = (array)role_get_names(); |
|
673
|
673
|
if (is_numeric($id)) { |
|
674
|
674
|
return $roles[$id]; |
|
675
|
675
|
} |
|
@@ -833,9 +833,9 @@ discard block |
|
|
block discarded – undo |
|
833
|
833
|
$isunique = true; |
|
834
|
834
|
if ($voicebridge != 0) { |
|
835
|
835
|
$table = 'bigbluebuttonbn'; |
|
836
|
|
- $select = 'voicebridge = '.$voicebridge; |
|
|
836
|
+ $select = 'voicebridge = ' . $voicebridge; |
|
837
|
837
|
if ($id) { |
|
838
|
|
- $select .= ' AND id <> '.$id; |
|
|
838
|
+ $select .= ' AND id <> ' . $id; |
|
839
|
839
|
} |
|
840
|
840
|
if ($DB->get_records_select($table, $select)) { |
|
841
|
841
|
$isunique = false; |
|
@@ -903,7 +903,7 @@ discard block |
|
|
block discarded – undo |
|
903
|
903
|
$mt = microtime(); |
|
904
|
904
|
$rand = mt_rand(); |
|
905
|
905
|
|
|
906
|
|
- return md5($mt.$rand); |
|
|
906
|
+ return md5($mt . $rand); |
|
907
|
907
|
} |
|
908
|
908
|
|
|
909
|
909
|
function bigbluebuttonbn_random_password($length = 8) { |
|
@@ -923,41 +923,41 @@ discard block |
|
|
block discarded – undo |
|
923
|
923
|
|
|
924
|
924
|
function bigbluebuttonbn_events() { |
|
925
|
925
|
return array( |
|
926
|
|
- (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
927
|
|
- (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
928
|
|
- (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
929
|
|
- (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
930
|
|
- (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
931
|
|
- (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
932
|
|
- (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
933
|
|
- (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
934
|
|
- (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
935
|
|
- (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
936
|
|
- (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
937
|
|
- (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
938
|
|
- (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
939
|
|
- (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
940
|
|
- (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
|
926
|
+ (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
|
927
|
+ (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
|
928
|
+ (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
|
929
|
+ (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
|
930
|
+ (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
|
931
|
+ (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
|
932
|
+ (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
|
933
|
+ (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
|
934
|
+ (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
|
935
|
+ (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
|
936
|
+ (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
|
937
|
+ (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
|
938
|
+ (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
|
939
|
+ (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
|
940
|
+ (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
941
|
941
|
); |
|
942
|
942
|
} |
|
943
|
943
|
|
|
944
|
944
|
function bigbluebuttonbn_events_action() { |
|
945
|
945
|
return array( |
|
946
|
|
- 'view' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
947
|
|
- 'view_management' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
948
|
|
- 'live_action' => (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
949
|
|
- 'meeting_create' => (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
950
|
|
- 'meeting_end' => (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
951
|
|
- 'meeting_join' => (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
952
|
|
- 'meeting_left' => (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
953
|
|
- 'recording_delete' => (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
954
|
|
- 'recording_import' => (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
955
|
|
- 'recording_protect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
956
|
|
- 'recording_publish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
957
|
|
- 'recording_unprotect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
958
|
|
- 'recording_unpublish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
959
|
|
- 'recording_edit' => (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
960
|
|
- 'recording_play' => (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
|
946
|
+ 'view' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
|
947
|
+ 'view_management' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
|
948
|
+ 'live_action' => (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
|
949
|
+ 'meeting_create' => (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
|
950
|
+ 'meeting_end' => (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
|
951
|
+ 'meeting_join' => (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
|
952
|
+ 'meeting_left' => (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
|
953
|
+ 'recording_delete' => (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
|
954
|
+ 'recording_import' => (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
|
955
|
+ 'recording_protect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
|
956
|
+ 'recording_publish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
|
957
|
+ 'recording_unprotect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
|
958
|
+ 'recording_unpublish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
|
959
|
+ 'recording_edit' => (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
|
960
|
+ 'recording_play' => (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
961
|
961
|
); |
|
962
|
962
|
} |
|
963
|
963
|
|
|
@@ -981,7 +981,7 @@ discard block |
|
|
block discarded – undo |
|
981
|
981
|
$eventproperties['other'] = $options['other']; |
|
982
|
982
|
} |
|
983
|
983
|
|
|
984
|
|
- $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create', |
|
|
984
|
+ $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_' . $eventtype . '::create', |
|
985
|
985
|
array($eventproperties)); |
|
986
|
986
|
$event->trigger(); |
|
987
|
987
|
} |
|
@@ -1024,11 +1024,11 @@ discard block |
|
|
block discarded – undo |
|
1024
|
1024
|
$now = time(); |
|
1025
|
1025
|
if (!$forced && isset($result) && $now < ($result['creation_time'] + $cachettl)) { |
|
1026
|
1026
|
// Use the value in the cache. |
|
1027
|
|
- return (array) json_decode($result['meeting_info']); |
|
|
1027
|
+ return (array)json_decode($result['meeting_info']); |
|
1028
|
1028
|
} |
|
1029
|
1029
|
|
|
1030
|
1030
|
// Ping again and refresh the cache. |
|
1031
|
|
- $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
|
|
1031
|
+ $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file( |
|
1032
|
1032
|
bigbluebuttonbn_bigbluebutton_action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
|
1033
|
1033
|
); |
|
1034
|
1034
|
$cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
|
@@ -1082,8 +1082,8 @@ discard block |
|
|
block discarded – undo |
|
1082
|
1082
|
* @param string $configxml |
|
1083
|
1083
|
*/ |
|
1084
|
1084
|
function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) { |
|
1085
|
|
- $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid); |
|
1086
|
|
- $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.bigbluebuttonbn_get_cfg_shared_secret()); |
|
|
1085
|
+ $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid); |
|
|
1086
|
+ $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . bigbluebuttonbn_get_cfg_shared_secret()); |
|
1087
|
1087
|
|
|
1088
|
1088
|
return $configxmlparams; |
|
1089
|
1089
|
} |
|
@@ -1093,7 +1093,7 @@ discard block |
|
|
block discarded – undo |
|
1093
|
1093
|
* @param string $configxml |
|
1094
|
1094
|
*/ |
|
1095
|
1095
|
function bigbluebuttonbn_set_config_xml($meetingid, $configxml) { |
|
1096
|
|
- $urldefaultconfig = bigbluebuttonbn_get_cfg_server_url().'api/setConfigXML?'; |
|
|
1096
|
+ $urldefaultconfig = bigbluebuttonbn_get_cfg_server_url() . 'api/setConfigXML?'; |
|
1097
|
1097
|
$configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml); |
|
1098
|
1098
|
$xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, BIGBLUEBUTTONBN_METHOD_POST, |
|
1099
|
1099
|
$configxmlparams, 'application/x-www-form-urlencoded'); |
|
@@ -1107,7 +1107,7 @@ discard block |
|
|
block discarded – undo |
|
1107
|
1107
|
*/ |
|
1108
|
1108
|
function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) { |
|
1109
|
1109
|
$configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml); |
|
1110
|
|
- $configxmlarray = (array) $configxml; |
|
|
1110
|
+ $configxmlarray = (array)$configxml; |
|
1111
|
1111
|
if ($configxmlarray['returncode'] != 'SUCCESS') { |
|
1112
|
1112
|
//debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER); |
|
1113
|
1113
|
return ''; |
|
@@ -1144,7 +1144,7 @@ discard block |
|
|
block discarded – undo |
|
1144
|
1144
|
$starttime = $starttime - ($starttime % 1000); |
|
1145
|
1145
|
|
|
1146
|
1146
|
// Set formatted date. |
|
1147
|
|
- $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z'; |
|
|
1147
|
+ $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z'; |
|
1148
|
1148
|
$row->date_formatted = userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone)); |
|
1149
|
1149
|
|
|
1150
|
1150
|
// Set formatted duration. |
|
@@ -1219,7 +1219,7 @@ discard block |
|
|
block discarded – undo |
|
1219
|
1219
|
} |
|
1220
|
1220
|
|
|
1221
|
1221
|
$recordingpreview = html_writer::start_tag('div', |
|
1222
|
|
- array('id' => 'preview-'.$recording['recordID'], $visibility => $visibility)); |
|
|
1222
|
+ array('id' => 'preview-' . $recording['recordID'], $visibility => $visibility)); |
|
1223
|
1223
|
foreach ($recording['playbacks'] as $playback) { |
|
1224
|
1224
|
if (isset($playback['preview'])) { |
|
1225
|
1225
|
foreach ($playback['preview'] as $image) { |
|
@@ -1252,19 +1252,19 @@ discard block |
|
|
block discarded – undo |
|
1252
|
1252
|
$visibility = 'hidden '; |
|
1253
|
1253
|
} |
|
1254
|
1254
|
|
|
1255
|
|
- $id = 'playbacks-'.$recording['recordID']; |
|
|
1255
|
+ $id = 'playbacks-' . $recording['recordID']; |
|
1256
|
1256
|
$recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, |
|
1257
|
1257
|
'data-recordingid' => $recording['recordID'], 'data-meetingid' => $recording['meetingID'], |
|
1258
|
1258
|
'title' => $title, $visibility => $visibility)); |
|
1259
|
1259
|
foreach ($recording['playbacks'] as $playback) { |
|
1260
|
1260
|
$onclick = 'M.mod_bigbluebuttonbn.recordings.recording_play(this);'; |
|
1261
|
|
- $href = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=playback&bn='.$bigbluebuttonbnid. |
|
1262
|
|
- '&href='.urlencode($playback['url']).'&rid='.$recording['recordID']; |
|
1263
|
|
- $linkattributes = array('title' => get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'), |
|
|
1261
|
+ $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=playback&bn=' . $bigbluebuttonbnid . |
|
|
1262
|
+ '&href=' . urlencode($playback['url']) . '&rid=' . $recording['recordID']; |
|
|
1263
|
+ $linkattributes = array('title' => get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'), |
|
1264
|
1264
|
'class' => 'btn btn-sm btn-default', 'onclick' => $onclick, |
|
1265
|
1265
|
'data-action' => 'play', 'data-href' => $href); |
|
1266
|
|
- $recordingtypes .= $OUTPUT->action_link('#', get_string('view_recording_format_'.$playback['type'], |
|
1267
|
|
- 'bigbluebuttonbn'), null, $linkattributes).' '; |
|
|
1266
|
+ $recordingtypes .= $OUTPUT->action_link('#', get_string('view_recording_format_' . $playback['type'], |
|
|
1267
|
+ 'bigbluebuttonbn'), null, $linkattributes) . ' '; |
|
1268
|
1268
|
} |
|
1269
|
1269
|
$recordingtypes .= html_writer::end_tag('div'); |
|
1270
|
1270
|
|
|
@@ -1345,11 +1345,11 @@ discard block |
|
|
block discarded – undo |
|
1345
|
1345
|
$target .= '-' . $data['target']; |
|
1346
|
1346
|
} |
|
1347
|
1347
|
$id = 'recording-' . $target . '-' . $recording['recordID']; |
|
1348
|
|
- $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_'.$data['action'].'(this);'; |
|
|
1348
|
+ $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_' . $data['action'] . '(this);'; |
|
1349
|
1349
|
if (bigbluebuttonbn_get_cfg_recording_icons_enabled()) { |
|
1350
|
1350
|
// With icon for $manageaction. |
|
1351
|
1351
|
$iconattributes = array('id' => $id, 'class' => 'iconsmall'); |
|
1352
|
|
- $icon = new pix_icon('i/'.$data['tag'], |
|
|
1352
|
+ $icon = new pix_icon('i/' . $data['tag'], |
|
1353
|
1353
|
get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'), |
|
1354
|
1354
|
'moodle', $iconattributes); |
|
1355
|
1355
|
$linkattributes = array( |
|
@@ -1440,7 +1440,7 @@ discard block |
|
|
block discarded – undo |
|
1440
|
1440
|
// There are recordings for this meeting. |
|
1441
|
1441
|
foreach ($recordings as $recording) { |
|
1442
|
1442
|
$row = new html_table_row(); |
|
1443
|
|
- $row->id = 'recording-td-'.$recording['recordID']; |
|
|
1443
|
+ $row->id = 'recording-td-' . $recording['recordID']; |
|
1444
|
1444
|
$row->attributes['data-imported'] = 'false'; |
|
1445
|
1445
|
$texthead = ''; |
|
1446
|
1446
|
$texttail = ''; |
|
@@ -1454,9 +1454,9 @@ discard block |
|
|
block discarded – undo |
|
1454
|
1454
|
$rowdata = bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools); |
|
1455
|
1455
|
if ($rowdata != null) { |
|
1456
|
1456
|
$rowdata->date_formatted = str_replace(' ', ' ', $rowdata->date_formatted); |
|
1457
|
|
- $row->cells = array($texthead.$rowdata->recording.$texttail, |
|
1458
|
|
- $texthead.$rowdata->activity.$texttail, $texthead.$rowdata->description.$texttail, |
|
1459
|
|
- $rowdata->preview, $texthead.$rowdata->date_formatted.$texttail, |
|
|
1457
|
+ $row->cells = array($texthead . $rowdata->recording . $texttail, |
|
|
1458
|
+ $texthead . $rowdata->activity . $texttail, $texthead . $rowdata->description . $texttail, |
|
|
1459
|
+ $rowdata->preview, $texthead . $rowdata->date_formatted . $texttail, |
|
1460
|
1460
|
$rowdata->duration_formatted); |
|
1461
|
1461
|
if ($bbbsession['managerecordings']) { |
|
1462
|
1462
|
$row->cells[] = $rowdata->actionbar; |
|
@@ -1478,9 +1478,9 @@ discard block |
|
|
block discarded – undo |
|
1478
|
1478
|
// Build the message_body. |
|
1479
|
1479
|
$msg->activity_type = ''; |
|
1480
|
1480
|
$msg->activity_title = $bigbluebuttonbn->name; |
|
1481
|
|
- $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').' '. |
|
1482
|
|
- $msg->activity_type.' "'.$msg->activity_title.'" '. |
|
1483
|
|
- get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>'; |
|
|
1481
|
+ $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . ' ' . |
|
|
1482
|
+ $msg->activity_type . ' "' . $msg->activity_title . '" ' . |
|
|
1483
|
+ get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>'; |
|
1484
|
1484
|
|
|
1485
|
1485
|
bigbluebuttonbn_send_notification($sender, $bigbluebuttonbn, $messagetext); |
|
1486
|
1486
|
} |
|
@@ -1506,15 +1506,15 @@ discard block |
|
|
block discarded – undo |
|
1506
|
1506
|
global $CFG; |
|
1507
|
1507
|
|
|
1508
|
1508
|
if (isset($CFG->bigbluebuttonbn['server_url'])) { |
|
1509
|
|
- return trim(trim($CFG->bigbluebuttonbn['server_url']), '/').'/'; |
|
|
1509
|
+ return trim(trim($CFG->bigbluebuttonbn['server_url']), '/') . '/'; |
|
1510
|
1510
|
} |
|
1511
|
1511
|
|
|
1512
|
1512
|
if (isset($CFG->bigbluebuttonbn_server_url)) { |
|
1513
|
|
- return trim(trim($CFG->bigbluebuttonbn_server_url), '/').'/'; |
|
|
1513
|
+ return trim(trim($CFG->bigbluebuttonbn_server_url), '/') . '/'; |
|
1514
|
1514
|
} |
|
1515
|
1515
|
|
|
1516
|
1516
|
if (isset($CFG->BigBlueButtonBNServerURL)) { |
|
1517
|
|
- return trim(trim($CFG->BigBlueButtonBNServerURL), '/').'/'; |
|
|
1517
|
+ return trim(trim($CFG->BigBlueButtonBNServerURL), '/') . '/'; |
|
1518
|
1518
|
} |
|
1519
|
1519
|
|
|
1520
|
1520
|
return BIGBLUEBUTTONBN_DEFAULT_SERVER_URL; |
|
@@ -2052,15 +2052,15 @@ discard block |
|
|
block discarded – undo |
|
2052
|
2052
|
|
|
2053
|
2053
|
// Gather the bigbluebuttonbnids whose meetingids should be included in the getRecordings request'. |
|
2054
|
2054
|
$select = "id <> '{$bigbluebuttonbnid}' AND course = '{$courseid}'"; |
|
2055
|
|
- $selectdeleted = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '". |
|
2056
|
|
- BIGBLUEBUTTONBN_LOG_EVENT_DELETE."' AND meta like '%has_recordings%' AND meta like '%true%'"; |
|
|
2055
|
+ $selectdeleted = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '" . |
|
|
2056
|
+ BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'"; |
|
2057
|
2057
|
if ($bigbluebuttonbnid === null) { |
|
2058
|
2058
|
$select = "course = '{$courseid}'"; |
|
2059
|
|
- $selectdeleted = "courseid = '{$courseid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE. |
|
|
2059
|
+ $selectdeleted = "courseid = '{$courseid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE . |
|
2060
|
2060
|
"' AND meta like '%has_recordings%' AND meta like '%true%'"; |
|
2061
|
2061
|
} else if ($subset) { |
|
2062
|
2062
|
$select = "id = '{$bigbluebuttonbnid}'"; |
|
2063
|
|
- $selectdeleted = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE. |
|
|
2063
|
+ $selectdeleted = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE . |
|
2064
|
2064
|
"' AND meta like '%has_recordings%' AND meta like '%true%'"; |
|
2065
|
2065
|
} |
|
2066
|
2066
|
$bigbluebuttonbns = $DB->get_records_select_menu('bigbluebuttonbn', $select, null, 'id', 'id, meetingid'); |
|
@@ -2082,7 +2082,7 @@ discard block |
|
|
block discarded – undo |
|
2082
|
2082
|
if (!empty($bigbluebuttonbns)) { |
|
2083
|
2083
|
// Prepare select for loading records based on existent bigbluebuttonbns. |
|
2084
|
2084
|
$sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE '; |
|
2085
|
|
- $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')'; |
|
|
2085
|
+ $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')'; |
|
2086
|
2086
|
// Include only Create events and exclude those with record not true. |
|
2087
|
2087
|
$sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?'; |
|
2088
|
2088
|
// Execute select for loading records based on existent bigbluebuttonbns. |
|
@@ -2174,8 +2174,8 @@ discard block |
|
|
block discarded – undo |
|
2174
|
2174
|
function bigbluebuttonbn_format_activity_time($time) { |
|
2175
|
2175
|
$activitytime = ''; |
|
2176
|
2176
|
if ($time) { |
|
2177
|
|
- $activitytime = calendar_day_representation($time).' '. |
|
2178
|
|
- get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
|
2177
|
+ $activitytime = calendar_day_representation($time) . ' ' . |
|
|
2178
|
+ get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' . |
|
2179
|
2179
|
calendar_time_representation($time); |
|
2180
|
2180
|
} |
|
2181
|
2181
|
|