Code Duplication    Length = 12-12 lines in 2 locations

locallib.php 2 locations

@@ 896-907 (lines=12) @@
893
 * @param string $id
894
 * @param boolean $publish
895
 */
896
function bigbluebuttonbn_publish_recording_imported($id, $publish = true) {
897
    global $DB;
898
    // Locate the record to be updated.
899
    $record = $DB->get_record('bigbluebuttonbn_logs', array('id' => $id));
900
    $meta = json_decode($record->meta, true);
901
    // Prepare data for the update.
902
    $meta['recording']['published'] = ($publish) ? 'true' : 'false';
903
    $record->meta = json_encode($meta);
904
    // Proceed with the update.
905
    $DB->update_record('bigbluebuttonbn_logs', $record);
906
    return true;
907
}
908
909
/**
910
 * @param string $id
@@ 942-953 (lines=12) @@
939
 * @param string $id
940
 * @param boolean $protect
941
 */
942
function bigbluebuttonbn_protect_recording_imported($id, $protect = true) {
943
    global $DB;
944
    // Locate the record to be updated.
945
    $record = $DB->get_record('bigbluebuttonbn_logs', array('id' => $id));
946
    $meta = json_decode($record->meta, true);
947
    // Prepare data for the update.
948
    $meta['recording']['protected'] = ($protect) ? 'true' : 'false';
949
    $record->meta = json_encode($meta);
950
    // Proceed with the update.
951
    $DB->update_record('bigbluebuttonbn_logs', $record);
952
    return true;
953
}
954
955
/**
956
 * @param string $meetingid