Code Duplication    Length = 13-13 lines in 3 locations

locallib.php 3 locations

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