"user.php", "name" => get_lang("ToolUser"));
$type = isset($_GET['type']) ? Security::remove_XSS($_GET['type']) : 'registered';
Display :: display_header($tool_name, "User");
$usergroup = new UserGroup();
if (api_is_allowed_to_edit()) {
echo '
';
}
echo Display::page_header($tool_name);
if (api_is_allowed_to_edit()) {
$action = isset($_GET['action']) ? $_GET['action'] : null;
switch ($action) {
case 'add_class_to_course':
$id = $_GET['id'];
if (!empty($id)) {
$usergroup->subscribe_courses_to_usergroup($id, array(api_get_course_int_id()), false);
}
break;
case 'remove_class_from_course':
$id = $_GET['id'];
if (!empty($id)) {
$usergroup->unsubscribe_courses_from_usergroup($id, array(api_get_course_int_id()));
}
break;
}
}
//jqgrid will use this URL to do the selects
$url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_usergroups_teacher&type='.$type;
//The order is important you need to check the the $column variable in the model.ajax.php file
$columns = array(get_lang('Name'), get_lang('Users'), get_lang('Actions'));
//Column config
$column_model = array(
array('name'=>'name', 'index'=>'name', 'width'=>'35', 'align'=>'left'),
array('name'=>'users', 'index'=>'users', 'width'=>'15', 'align'=>'left'),
array('name'=>'actions', 'index'=>'actions', 'width'=>'20', 'align'=>'left','sortable'=>'false'),
);
//Autowidth
$extra_params['autowidth'] = 'true';
//height auto
$extra_params['height'] = 'auto';
//$extra_params['rowList'] = array(50, 100, 500, 1000, 2000, 5000);
//With this function we can add actions to the jgrid
$action_links = 'function action_formatter (cellvalue, options, rowObject) {
return \''
.' '
.' \';
}';
?>
display_teacher_view();
Display :: display_footer();