Code Duplication    Length = 12-12 lines in 2 locations

locallib.php 2 locations

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