Code Duplication    Length = 13-13 lines in 3 locations

locallib.php 3 locations

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