Code Duplication    Length = 12-12 lines in 2 locations

locallib.php 2 locations

@@ 1219-1230 (lines=12) @@
1216
 *
1217
 * @return boolean
1218
 */
1219
function bigbluebuttonbn_publish_recording_imported($id, $publish = true) {
1220
    global $DB;
1221
    // Locate the record to be updated.
1222
    $record = $DB->get_record('bigbluebuttonbn_logs', array('id' => $id));
1223
    $meta = json_decode($record->meta, true);
1224
    // Prepare data for the update.
1225
    $meta['recording']['published'] = ($publish) ? 'true' : 'false';
1226
    $record->meta = json_encode($meta);
1227
    // Proceed with the update.
1228
    $DB->update_record('bigbluebuttonbn_logs', $record);
1229
    return true;
1230
}
1231
1232
/**
1233
 * Delete an imported recording.
@@ 1277-1288 (lines=12) @@
1274
 *
1275
 * @return boolean
1276
 */
1277
function bigbluebuttonbn_protect_recording_imported($id, $protect = true) {
1278
    global $DB;
1279
    // Locate the record to be updated.
1280
    $record = $DB->get_record('bigbluebuttonbn_logs', array('id' => $id));
1281
    $meta = json_decode($record->meta, true);
1282
    // Prepare data for the update.
1283
    $meta['recording']['protected'] = ($protect) ? 'true' : 'false';
1284
    $record->meta = json_encode($meta);
1285
    // Proceed with the update.
1286
    $DB->update_record('bigbluebuttonbn_logs', $record);
1287
    return true;
1288
}
1289
1290
/**
1291
 * Sets a custom config.xml file for being used on create.