Chamilo is a learning management system focused on ease of use and accessibility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
chamilo-lms/main/user/classes.php

53 lines
1.4 KiB

<?php
/* For licensing terms, see /license.txt */
/**
* @package chamilo.classes
* @author Julio Montoya <gugli100@gmail.com>
*/
$cidReset = true;
require_once __DIR__.'/../inc/global.inc.php';
api_block_anonymous_users();
$this_section = SECTION_COURSES;
$interbreadcrumb[] = array('url' =>'classes.php', 'name' => get_lang('Classes'));
if (isset($_GET['id'])) {
$interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('Groups'));
}
$content = '';
$usergroup = new UserGroup();
$usergroup_list = $usergroup->get_usergroup_by_user(api_get_user_id());
if (!empty($usergroup_list)) {
$content .= Display::tag('h1', get_lang('MyClasses'));
foreach ($usergroup_list as $group_id) {
if (isset($_GET['id']) && $_GET['id'] != $group_id) {
continue;
}
$data = $usergroup->get($group_id);
$content .= Display::tag('h2', $data['name']);
$content .= Display::div($data['description']);
}
} else {
if (api_is_platform_admin()) {
Display::addFlash(
Display::return_message(
Display::url(
get_lang('AddClasses'),
api_get_path(WEB_CODE_PATH).'admin/usergroups.php?action=add'
),
'normal',
false
)
);
}
}
Display :: display_header($tool_name, 'Classes');
echo $content;
Display :: display_footer();