classes.php 1.3 KB

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