Code Duplication    Length = 13-13 lines in 3 locations

locallib.php 3 locations

@@ 461-473 (lines=13) @@
458
 *
459
 * @return boolean
460
 */
461
function bigbluebuttonbn_delete_recordings($recordids) {
462
    $ids = explode(',', $recordids);
463
    foreach ($ids as $id) {
464
        $xml = bigbluebuttonbn_wrap_xml_load_file(
465
            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('deleteRecordings', ['recordID' => $id])
466
        );
467
        if ($xml && $xml->returncode != 'SUCCESS') {
468
            return false;
469
        }
470
    }
471
    return true;
472
}
473
474
/**
475
 * Perform publishRecordings on BBB.
476
 *
@@ 480-492 (lines=13) @@
477
 * @param string $recordids
478
 * @param string $publish
479
 */
480
function bigbluebuttonbn_publish_recordings($recordids, $publish = 'true') {
481
    $ids = explode(',', $recordids);
482
    foreach ($ids as $id) {
483
        $xml = bigbluebuttonbn_wrap_xml_load_file(
484
            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish])
485
        );
486
        if ($xml && $xml->returncode != 'SUCCESS') {
487
            return false;
488
        }
489
    }
490
    return true;
491
}
492
493
/**
494
 * Perform updateRecordings on BBB.
495
 *
@@ 499-511 (lines=13) @@
496
 * @param string $recordids
497
 * @param array $params ['key'=>param_key, 'value']
498
 */
499
function bigbluebuttonbn_update_recordings($recordids, $params) {
500
    $ids = explode(',', $recordids);
501
    foreach ($ids as $id) {
502
        $xml = bigbluebuttonbn_wrap_xml_load_file(
503
            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
504
        );
505
        if ($xml && $xml->returncode != 'SUCCESS') {
506
            return false;
507
        }
508
    }
509
    return true;
510
}
511
512
/**
513
 * Perform end on BBB.
514
 *