Code Duplication    Length = 13-13 lines in 3 locations

locallib.php 3 locations

@@ 410-422 (lines=13) @@
407
 *
408
 * @return boolean
409
 */
410
function bigbluebuttonbn_delete_recordings($recordids) {
411
    $ids = explode(',', $recordids);
412
    foreach ($ids as $id) {
413
        $xml = bigbluebuttonbn_wrap_xml_load_file(
414
            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('deleteRecordings', ['recordID' => $id])
415
          );
416
        if ($xml && $xml->returncode != 'SUCCESS') {
417
            return false;
418
        }
419
    }
420
    return true;
421
}
422
423
/**
424
 * Perform publishRecordings on BBB.
425
 *
@@ 429-441 (lines=13) @@
426
 * @param string $recordids
427
 * @param string $publish
428
 */
429
function bigbluebuttonbn_publish_recordings($recordids, $publish = 'true') {
430
    $ids = explode(',', $recordids);
431
    foreach ($ids as $id) {
432
        $xml = bigbluebuttonbn_wrap_xml_load_file(
433
            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish])
434
          );
435
        if ($xml && $xml->returncode != 'SUCCESS') {
436
            return false;
437
        }
438
    }
439
    return true;
440
}
441
442
/**
443
 * Perform updateRecordings on BBB.
444
 *
@@ 448-460 (lines=13) @@
445
 * @param string $recordids
446
 * @param array $params ['key'=>param_key, 'value']
447
 */
448
function bigbluebuttonbn_update_recordings($recordids, $params) {
449
    $ids = explode(',', $recordids);
450
    foreach ($ids as $id) {
451
        $xml = bigbluebuttonbn_wrap_xml_load_file(
452
            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
453
          );
454
        if ($xml && $xml->returncode != 'SUCCESS') {
455
            return false;
456
        }
457
    }
458
    return true;
459
}
460
461
/**
462
 * Perform end on BBB.
463
 *