Esempio n. 1
0
         if (!empty($_POST['same_places'])) {
             $group['places'] = $_POST['group_0_places'];
         }
         if (api_get_setting('allow_group_categories') == 'false') {
             $group['category'] = GroupManager::DEFAULT_GROUP_CATEGORY;
         } elseif (isset($_POST['same_category']) && $_POST['same_category']) {
             $group['category'] = $_POST['group_0_category'];
         }
         GroupManager::create_group($group['name'], $group['category'], $group['tutor'], $group['places']);
     }
     $msg = urlencode(count($groups) . ' ' . get_lang('GroupsAdded'));
     header('Location: group.php?action=show_msg&msg=' . $msg);
     exit;
     break;
 case 'create_virtual_groups':
     $ids = GroupManager::create_groups_from_virtual_courses();
     $msg = urlencode(count($ids) . ' ' . get_lang('GroupsAdded'));
     header('Location: group.php?action=show_msg&msg=' . $msg);
     exit;
     break;
 case 'create_subgroups':
     GroupManager::create_subgroups($_POST['base_group'], $_POST['number_of_groups']);
     $msg = urlencode($_POST['number_of_groups'] . ' ' . get_lang('GroupsAdded'));
     header('Location: group.php?action=show_msg&msg=' . $msg);
     exit;
     break;
 case 'create_class_groups':
     $ids = GroupManager::create_class_groups($_POST['group_category']);
     $msg = urlencode(count($ids) . ' ' . get_lang('GroupsAdded'));
     header('Location: group.php?action=show_msg&msg=' . $msg);
     exit;