Code Duplication    Length = 12-12 lines in 2 locations

locallib.php 2 locations

@@ 1167-1178 (lines=12) @@
1164
 *
1165
 * @return boolean
1166
 */
1167
function bigbluebuttonbn_publish_recording_imported($id, $publish = true) {
1168
    global $DB;
1169
    // Locate the record to be updated.
1170
    $record = $DB->get_record('bigbluebuttonbn_logs', array('id' => $id));
1171
    $meta = json_decode($record->meta, true);
1172
    // Prepare data for the update.
1173
    $meta['recording']['published'] = ($publish) ? 'true' : 'false';
1174
    $record->meta = json_encode($meta);
1175
    // Proceed with the update.
1176
    $DB->update_record('bigbluebuttonbn_logs', $record);
1177
    return true;
1178
}
1179
1180
/**
1181
 * Delete an imported recording.
@@ 1225-1236 (lines=12) @@
1222
 *
1223
 * @return boolean
1224
 */
1225
function bigbluebuttonbn_protect_recording_imported($id, $protect = true) {
1226
    global $DB;
1227
    // Locate the record to be updated.
1228
    $record = $DB->get_record('bigbluebuttonbn_logs', array('id' => $id));
1229
    $meta = json_decode($record->meta, true);
1230
    // Prepare data for the update.
1231
    $meta['recording']['protected'] = ($protect) ? 'true' : 'false';
1232
    $record->meta = json_encode($meta);
1233
    // Proceed with the update.
1234
    $DB->update_record('bigbluebuttonbn_logs', $record);
1235
    return true;
1236
}
1237
1238
/**
1239
 * Sets a custom config.xml file for being used on create.