Code Duplication    Length = 11-18 lines in 2 locations

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

@@ 5720-5730 (lines=11) @@
5717
     * this function gets all the groups of the course,
5718
     * not including linked courses
5719
     */
5720
    public static function getCourseGroups()
5721
    {
5722
        $session_id = api_get_session_id();
5723
        if ($session_id != 0) {
5724
            $new_group_list = self::get_group_list_of_course(api_get_course_id(), $session_id, 1);
5725
        } else {
5726
            $new_group_list = self::get_group_list_of_course(api_get_course_id(), 0, 1);
5727
        }
5728
5729
        return $new_group_list;
5730
    }
5731
5732
    /**
5733
     * @param FormValidator $form

main/inc/lib/AnnouncementManager.php 1 location

@@ 966-983 (lines=18) @@
963
     * this function gets all the groups of the course,
964
     * not including linked courses
965
     */
966
    public static function get_course_groups()
967
    {
968
        $session_id = api_get_session_id();
969
        if ($session_id != 0) {
970
            $new_group_list = CourseManager::get_group_list_of_course(
971
                api_get_course_id(),
972
                $session_id,
973
                1
974
            );
975
        } else {
976
            $new_group_list = CourseManager::get_group_list_of_course(
977
                api_get_course_id(),
978
                0,
979
                1
980
            );
981
        }
982
        return $new_group_list;
983
    }
984
985
    /**
986
     * This tools loads all the users and all the groups who have received