public static function get_activities_overview($courseids) {
        global $USER;

        // Parameter validation.
        $params = self::validate_parameters(self::get_activities_overview_parameters(), array('courseids' => $courseids));
        $courseoverviews = array();

        list($courses, $warnings) = external_util::validate_courses($params['courseids']);

        if (!empty($courses)) {
            // Add lastaccess to each course (required by print_overview function).
            // We need the complete user data, the ws server does not load a complete one.
            $user = get_complete_user_data('id', $USER->id);
            foreach ($courses as $course) {
                if (isset($user->lastcourseaccess[$course->id])) {
                    $course->lastaccess = $user->lastcourseaccess[$course->id];
                } else {
                    $course->lastaccess = 0;
                }
            }

            $overviews = array();
            if ($modules = get_plugin_list_with_function('mod', 'print_overview')) {
                foreach ($modules as $fname) {
                    $fname($courses, $overviews);
                }
            }

            // Format output.
            foreach ($overviews as $courseid => $modules) {
                $courseoverviews[$courseid]['id'] = $courseid;
                $courseoverviews[$courseid]['overviews'] = array();

                foreach ($modules as $modname => $overviewtext) {
                    $courseoverviews[$courseid]['overviews'][] = array(
                        'module' => $modname,
                        'overviewtext' => $overviewtext // This text doesn't need formatting.
                    );
                }
            }
        }

        $result = array(
            'courses' => $courseoverviews,
            'warnings' => $warnings
        );
        return $result;
    }