Code Duplication    Length = 12-12 lines in 2 locations

locallib.php 2 locations

@@ 1178-1189 (lines=12) @@
1175
 *
1176
 * @return boolean
1177
 */
1178
function bigbluebuttonbn_publish_recording_imported($id, $publish = true) {
1179
    global $DB;
1180
    // Locate the record to be updated.
1181
    $record = $DB->get_record('bigbluebuttonbn_logs', array('id' => $id));
1182
    $meta = json_decode($record->meta, true);
1183
    // Prepare data for the update.
1184
    $meta['recording']['published'] = ($publish) ? 'true' : 'false';
1185
    $record->meta = json_encode($meta);
1186
    // Proceed with the update.
1187
    $DB->update_record('bigbluebuttonbn_logs', $record);
1188
    return true;
1189
}
1190
1191
/**
1192
 * Delete an imported recording.
@@ 1236-1247 (lines=12) @@
1233
 *
1234
 * @return boolean
1235
 */
1236
function bigbluebuttonbn_protect_recording_imported($id, $protect = true) {
1237
    global $DB;
1238
    // Locate the record to be updated.
1239
    $record = $DB->get_record('bigbluebuttonbn_logs', array('id' => $id));
1240
    $meta = json_decode($record->meta, true);
1241
    // Prepare data for the update.
1242
    $meta['recording']['protected'] = ($protect) ? 'true' : 'false';
1243
    $record->meta = json_encode($meta);
1244
    // Proceed with the update.
1245
    $DB->update_record('bigbluebuttonbn_logs', $record);
1246
    return true;
1247
}
1248
1249
/**
1250
 * Sets a custom config.xml file for being used on create.