Code Duplication    Length = 12-12 lines in 2 locations

locallib.php 2 locations

@@ 1159-1170 (lines=12) @@
1156
 *
1157
 * @return boolean
1158
 */
1159
function bigbluebuttonbn_publish_recording_imported($id, $publish = true) {
1160
    global $DB;
1161
    // Locate the record to be updated.
1162
    $record = $DB->get_record('bigbluebuttonbn_logs', array('id' => $id));
1163
    $meta = json_decode($record->meta, true);
1164
    // Prepare data for the update.
1165
    $meta['recording']['published'] = ($publish) ? 'true' : 'false';
1166
    $record->meta = json_encode($meta);
1167
    // Proceed with the update.
1168
    $DB->update_record('bigbluebuttonbn_logs', $record);
1169
    return true;
1170
}
1171
1172
/**
1173
 * Delete an imported recording.
@@ 1217-1228 (lines=12) @@
1214
 *
1215
 * @return boolean
1216
 */
1217
function bigbluebuttonbn_protect_recording_imported($id, $protect = true) {
1218
    global $DB;
1219
    // Locate the record to be updated.
1220
    $record = $DB->get_record('bigbluebuttonbn_logs', array('id' => $id));
1221
    $meta = json_decode($record->meta, true);
1222
    // Prepare data for the update.
1223
    $meta['recording']['protected'] = ($protect) ? 'true' : 'false';
1224
    $record->meta = json_encode($meta);
1225
    // Proceed with the update.
1226
    $DB->update_record('bigbluebuttonbn_logs', $record);
1227
    return true;
1228
}
1229
1230
/**
1231
 * Sets a custom config.xml file for being used on create.