classes.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. require_once api_get_path(LIBRARY_PATH).'usergroup.lib.php';
  14. api_block_anonymous_users();
  15. $this_section = SECTION_COURSES;
  16. $interbreadcrumb[]= array ('url' =>'classes.php','name' => get_lang('Classes'));
  17. if (isset($_GET['id'])) {
  18. $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('Groups'));
  19. }
  20. if (api_get_setting('show_groups_to_users') == 'false') {
  21. }
  22. Display :: display_header($tool_name, 'Classes');
  23. $usergroup = new Usergroup();
  24. $usergroup_list = $usergroup->get_usergroup_by_user(api_get_user_id());
  25. if (!empty($usergroup_list)) {
  26. echo Display::tag('h1',get_lang('MyClasses'));
  27. foreach($usergroup_list as $group_id) {
  28. if (isset($_GET['id']) && $_GET['id'] != $group_id) continue;
  29. $data = $usergroup->get($group_id);
  30. echo Display::tag('h2',$data['name']);
  31. echo Display::div($data['description']);
  32. }
  33. } else {
  34. if (api_is_platform_admin()) {
  35. Display::display_normal_message(Display::url(get_lang('AddClasses') ,api_get_path(WEB_CODE_PATH).'admin/usergroups.php?action=add'), false);
  36. }
  37. }
  38. Display :: display_footer();