Code Duplication    Length = 7-7 lines in 2 locations

locallib.php 2 locations

@@ 2664-2670 (lines=7) @@
2661
 *
2662
 * @return array
2663
 */
2664
function bigbluebuttonbn_view_instance_id($id) {
2665
    global $DB;
2666
    $cm = get_coursemodule_from_id('bigbluebuttonbn', $id, 0, false, MUST_EXIST);
2667
    $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
2668
    $bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id' => $cm->instance), '*', MUST_EXIST);
2669
    return array('cm' => $cm, 'course' => $course, 'bigbluebuttonbn' => $bigbluebuttonbn);
2670
}
2671
2672
/**
2673
 * Helper function returns array with the instance settings used in views based on bigbluebuttonbnid.
@@ 2679-2685 (lines=7) @@
2676
 *
2677
 * @return array
2678
 */
2679
function bigbluebuttonbn_view_instance_bigbluebuttonbn($bigbluebuttonbnid) {
2680
    global $DB;
2681
    $bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id' => $bigbluebuttonbnid), '*', MUST_EXIST);
2682
    $course = $DB->get_record('course', array('id' => $bigbluebuttonbn->course), '*', MUST_EXIST);
2683
    $cm = get_coursemodule_from_instance('bigbluebuttonbn', $bigbluebuttonbn->id, $course->id, false, MUST_EXIST);
2684
    return array('cm' => $cm, 'course' => $course, 'bigbluebuttonbn' => $bigbluebuttonbn);
2685
}
2686
2687
/**
2688
 * Helper function renders general settings if the feature is enabled.