Code Duplication    Length = 12-12 lines in 2 locations

locallib.php 2 locations

@@ 1284-1295 (lines=12) @@
1281
 *
1282
 * @return boolean
1283
 */
1284
function bigbluebuttonbn_publish_recording_imported($id, $publish = true) {
1285
    global $DB;
1286
    // Locate the record to be updated.
1287
    $record = $DB->get_record('bigbluebuttonbn_logs', array('id' => $id));
1288
    $meta = json_decode($record->meta, true);
1289
    // Prepare data for the update.
1290
    $meta['recording']['published'] = ($publish) ? 'true' : 'false';
1291
    $record->meta = json_encode($meta);
1292
    // Proceed with the update.
1293
    $DB->update_record('bigbluebuttonbn_logs', $record);
1294
    return true;
1295
}
1296
1297
/**
1298
 * Delete an imported recording.
@@ 1342-1353 (lines=12) @@
1339
 *
1340
 * @return boolean
1341
 */
1342
function bigbluebuttonbn_protect_recording_imported($id, $protect = true) {
1343
    global $DB;
1344
    // Locate the record to be updated.
1345
    $record = $DB->get_record('bigbluebuttonbn_logs', array('id' => $id));
1346
    $meta = json_decode($record->meta, true);
1347
    // Prepare data for the update.
1348
    $meta['recording']['protected'] = ($protect) ? 'true' : 'false';
1349
    $record->meta = json_encode($meta);
1350
    // Proceed with the update.
1351
    $DB->update_record('bigbluebuttonbn_logs', $record);
1352
    return true;
1353
}
1354
1355
/**
1356
 * Sets a custom config.xml file for being used on create.