load(); if ($course && $course->getType() == 'course') { $status = $course->getLearnerDefaultStatus(); if ($course->canAddGroup()) { $good_url = empty($group_workspace) ? true : check_url_exists($group_workspace); if (!empty($group_title) && $good_url) { $group = new Coursegroup(); $group->course = $course_id; $group->title = $group_title; $group->description = $group_desc; $group->workspace = $group_workspace; if (isset($group_members) && !empty($group_members)) { if (!is_array($group_members)) $group_members = array($group_members); } else { $group_members = array(); } $group->members = $group_members; $group_id = $group->create(); if (!$group_id) { $Dippler->add_system_message(_("Group could not be created."), 'error'); forward("course/groups/{$course_id}/group/add"); } } else { if (!$good_url) $Dippler->add_system_message(_("Provided Workspace URL is not a working address."), 'error'); $Dippler->add_system_message(_("At least one of the parameters is empty."), 'error'); forward("course/groups/{$course_id}/group/add"); } } else { $Dippler->add_system_message(_("Group could not be created."), 'error'); } $Dippler->add_system_message(_("Group added.")); // Clear cache $Dippler->clearSessionInputValues(); forward($group->getURL()); } forward(); ?>