Code Duplication    Length = 13-13 lines in 3 locations

locallib.php 3 locations

@@ 345-357 (lines=13) @@
342
/**
343
 * @param string $recordids
344
 */
345
function bigbluebuttonbn_delete_recordings($recordids) {
346
    $ids = explode(',', $recordids);
347
    foreach ($ids as $id) {
348
        $xml = bigbluebuttonbn_wrap_xml_load_file(
349
            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('deleteRecordings', ['recordID' => $id])
350
          );
351
        if ($xml && $xml->returncode != 'SUCCESS') {
352
            return false;
353
        }
354
    }
355
    return true;
356
}
357
358
/**
359
 * @param string $recordids
360
 * @param string $publish
@@ 362-374 (lines=13) @@
359
 * @param string $recordids
360
 * @param string $publish
361
 */
362
function bigbluebuttonbn_publish_recordings($recordids, $publish = 'true') {
363
    $ids = explode(',', $recordids);
364
    foreach ($ids as $id) {
365
        $xml = bigbluebuttonbn_wrap_xml_load_file(
366
            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish])
367
          );
368
        if ($xml && $xml->returncode != 'SUCCESS') {
369
            return false;
370
        }
371
    }
372
    return true;
373
}
374
375
/**
376
 * @param string $recordids
377
 * @param array $params ['key'=>param_key, 'value']
@@ 379-391 (lines=13) @@
376
 * @param string $recordids
377
 * @param array $params ['key'=>param_key, 'value']
378
 */
379
function bigbluebuttonbn_update_recordings($recordids, $params) {
380
    $ids = explode(',', $recordids);
381
    foreach ($ids as $id) {
382
        $xml = bigbluebuttonbn_wrap_xml_load_file(
383
            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
384
          );
385
        if ($xml && $xml->returncode != 'SUCCESS') {
386
            return false;
387
        }
388
    }
389
    return true;
390
}
391
392
/**
393
 * @param string $meetingid
394
 * @param string $modpw