Code Duplication    Length = 12-12 lines in 2 locations

locallib.php 2 locations

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