classes.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * @package chamilo.classes
  5. * @author Julio Montoya <gugli100@gmail.com>
  6. */
  7. $cidReset = true;
  8. //require_once '../inc/global.inc.php';
  9. api_block_anonymous_users();
  10. $this_section = SECTION_COURSES;
  11. $interbreadcrumb[]= array ('url' =>'classes.php','name' => get_lang('Classes'));
  12. if (isset($_GET['id'])) {
  13. $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('Groups'));
  14. }
  15. Display :: display_header($tool_name, 'Classes');
  16. $usergroup = new UserGroup();
  17. $usergroup_list = $usergroup->get_usergroup_by_user(api_get_user_id());
  18. if (!empty($usergroup_list)) {
  19. echo Display::tag('h1', get_lang('MyClasses'));
  20. foreach ($usergroup_list as $group_id) {
  21. if (isset($_GET['id']) && $_GET['id'] != $group_id) {
  22. continue;
  23. }
  24. $data = $usergroup->get($group_id);
  25. echo Display::tag('h2', $data['name']);
  26. echo Display::div($data['description']);
  27. }
  28. } else {
  29. if (api_is_platform_admin()) {
  30. Display::display_normal_message(
  31. Display::url(
  32. get_lang('AddClasses'),
  33. api_get_path(WEB_CODE_PATH).'admin/usergroups.php?action=add'
  34. ),
  35. false
  36. );
  37. }
  38. }
  39. Display :: display_footer();