Code Duplication    Length = 7-7 lines in 2 locations

locallib.php 2 locations

@@ 2656-2662 (lines=7) @@
2653
 *
2654
 * @return array
2655
 */
2656
function bigbluebuttonbn_view_instance_id($id) {
2657
    global $DB;
2658
    $cm = get_coursemodule_from_id('bigbluebuttonbn', $id, 0, false, MUST_EXIST);
2659
    $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
2660
    $bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id' => $cm->instance), '*', MUST_EXIST);
2661
    return array('cm' => $cm, 'course' => $course, 'bigbluebuttonbn' => $bigbluebuttonbn);
2662
}
2663
2664
/**
2665
 * Helper function returns array with the instance settings used in views based on bigbluebuttonbnid.
@@ 2671-2677 (lines=7) @@
2668
 *
2669
 * @return array
2670
 */
2671
function bigbluebuttonbn_view_instance_bigbluebuttonbn($bigbluebuttonbnid) {
2672
    global $DB;
2673
    $bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id' => $bigbluebuttonbnid), '*', MUST_EXIST);
2674
    $course = $DB->get_record('course', array('id' => $bigbluebuttonbn->course), '*', MUST_EXIST);
2675
    $cm = get_coursemodule_from_instance('bigbluebuttonbn', $bigbluebuttonbn->id, $course->id, false, MUST_EXIST);
2676
    return array('cm' => $cm, 'course' => $course, 'bigbluebuttonbn' => $bigbluebuttonbn);
2677
}
2678
2679
/**
2680
 * Helper function renders general settings if the feature is enabled.