Code Duplication    Length = 12-12 lines in 2 locations

locallib.php 2 locations

@@ 1184-1195 (lines=12) @@
1181
 *
1182
 * @return boolean
1183
 */
1184
function bigbluebuttonbn_publish_recording_imported($id, $publish = true) {
1185
    global $DB;
1186
    // Locate the record to be updated.
1187
    $record = $DB->get_record('bigbluebuttonbn_logs', array('id' => $id));
1188
    $meta = json_decode($record->meta, true);
1189
    // Prepare data for the update.
1190
    $meta['recording']['published'] = ($publish) ? 'true' : 'false';
1191
    $record->meta = json_encode($meta);
1192
    // Proceed with the update.
1193
    $DB->update_record('bigbluebuttonbn_logs', $record);
1194
    return true;
1195
}
1196
1197
/**
1198
 * Delete an imported recording.
@@ 1242-1253 (lines=12) @@
1239
 *
1240
 * @return boolean
1241
 */
1242
function bigbluebuttonbn_protect_recording_imported($id, $protect = true) {
1243
    global $DB;
1244
    // Locate the record to be updated.
1245
    $record = $DB->get_record('bigbluebuttonbn_logs', array('id' => $id));
1246
    $meta = json_decode($record->meta, true);
1247
    // Prepare data for the update.
1248
    $meta['recording']['protected'] = ($protect) ? 'true' : 'false';
1249
    $record->meta = json_encode($meta);
1250
    // Proceed with the update.
1251
    $DB->update_record('bigbluebuttonbn_logs', $record);
1252
    return true;
1253
}
1254
1255
/**
1256
 * Sets a custom config.xml file for being used on create.