Code Duplication    Length = 11-18 lines in 2 locations

main/inc/lib/AnnouncementManager.php 1 location

@@ 1037-1054 (lines=18) @@
1034
     * this function gets all the groups of the course,
1035
     * not including linked courses
1036
     */
1037
    public static function get_course_groups()
1038
    {
1039
        $session_id = api_get_session_id();
1040
        if ($session_id != 0) {
1041
            $new_group_list = CourseManager::get_group_list_of_course(
1042
                api_get_course_id(),
1043
                $session_id,
1044
                1
1045
            );
1046
        } else {
1047
            $new_group_list = CourseManager::get_group_list_of_course(
1048
                api_get_course_id(),
1049
                0,
1050
                1
1051
            );
1052
        }
1053
        return $new_group_list;
1054
    }
1055
1056
    /**
1057
     * This tools loads all the users and all the groups who have received

main/inc/lib/course.lib.php 1 location

@@ 5328-5338 (lines=11) @@
5325
     * this function gets all the groups of the course,
5326
     * not including linked courses
5327
     */
5328
    public static function getCourseGroups()
5329
    {
5330
        $session_id = api_get_session_id();
5331
        if ($session_id != 0) {
5332
            $new_group_list = self::get_group_list_of_course(api_get_course_id(), $session_id, 1);
5333
        } else {
5334
            $new_group_list = self::get_group_list_of_course(api_get_course_id(), 0, 1);
5335
        }
5336
5337
        return $new_group_list;
5338
    }
5339
5340
    /**
5341
     * @param FormValidator $form