Code Duplication    Length = 7-7 lines in 2 locations

locallib.php 2 locations

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