Code Duplication    Length = 12-12 lines in 2 locations

locallib.php 2 locations

@@ 919-930 (lines=12) @@
916
 * @param string $id
917
 * @param boolean $publish
918
 */
919
function bigbluebuttonbn_publish_recording_imported($id, $publish = true) {
920
    global $DB;
921
    // Locate the record to be updated.
922
    $record = $DB->get_record('bigbluebuttonbn_logs', array('id' => $id));
923
    $meta = json_decode($record->meta, true);
924
    // Prepare data for the update.
925
    $meta['recording']['published'] = ($publish) ? 'true' : 'false';
926
    $record->meta = json_encode($meta);
927
    // Proceed with the update.
928
    $DB->update_record('bigbluebuttonbn_logs', $record);
929
    return true;
930
}
931
932
/**
933
 * @param string $id
@@ 965-976 (lines=12) @@
962
 * @param string $id
963
 * @param boolean $protect
964
 */
965
function bigbluebuttonbn_protect_recording_imported($id, $protect = true) {
966
    global $DB;
967
    // Locate the record to be updated.
968
    $record = $DB->get_record('bigbluebuttonbn_logs', array('id' => $id));
969
    $meta = json_decode($record->meta, true);
970
    // Prepare data for the update.
971
    $meta['recording']['protected'] = ($protect) ? 'true' : 'false';
972
    $record->meta = json_encode($meta);
973
    // Proceed with the update.
974
    $DB->update_record('bigbluebuttonbn_logs', $record);
975
    return true;
976
}
977
978
/**
979
 * @param string $meetingid