Code Duplication    Length = 7-7 lines in 2 locations

locallib.php 2 locations

@@ 2628-2634 (lines=7) @@
2625
 *
2626
 * @return array
2627
 */
2628
function bigbluebuttonbn_view_instance_id($id) {
2629
    global $DB;
2630
    $cm = get_coursemodule_from_id('bigbluebuttonbn', $id, 0, false, MUST_EXIST);
2631
    $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
2632
    $bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id' => $cm->instance), '*', MUST_EXIST);
2633
    return array('cm' => $cm, 'course' => $course, 'bigbluebuttonbn' => $bigbluebuttonbn);
2634
}
2635
2636
/**
2637
 * Helper function returns array with the instance settings used in views based on bigbluebuttonbnid.
@@ 2643-2649 (lines=7) @@
2640
 *
2641
 * @return array
2642
 */
2643
function bigbluebuttonbn_view_instance_bigbluebuttonbn($bigbluebuttonbnid) {
2644
    global $DB;
2645
    $bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id' => $bigbluebuttonbnid), '*', MUST_EXIST);
2646
    $course = $DB->get_record('course', array('id' => $bigbluebuttonbn->course), '*', MUST_EXIST);
2647
    $cm = get_coursemodule_from_instance('bigbluebuttonbn', $bigbluebuttonbn->id, $course->id, false, MUST_EXIST);
2648
    return array('cm' => $cm, 'course' => $course, 'bigbluebuttonbn' => $bigbluebuttonbn);
2649
}
2650
2651
/**
2652
 * Helper function renders general settings if the feature is enabled.