banner.lib.php 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. require_once(api_get_path(SYS_CODE_PATH).'inc/banner.inc.php');
  3. /**
  4. * Determines the possible tabs (=sections) that are available.
  5. * This function is used when creating the tabs in the third header line and all the sections
  6. * that do not appear there (as determined by the platform admin on the Dokeos configuration settings page)
  7. * will appear in the right hand menu that appears on several other pages
  8. *
  9. * @return array containing all the possible tabs
  10. *
  11. * @version Dokeos 1.8.4
  12. * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
  13. */
  14. function get_tabs() {
  15. global $_course, $rootAdminWeb, $_user;
  16. // Campus Homepage
  17. $navigation[SECTION_CAMPUS]['url'] = api_get_path(WEB_PATH).'index.php';
  18. $navigation[SECTION_CAMPUS]['title'] = get_lang('CampusHomepage');
  19. // My Courses
  20. if(api_get_setting('use_session_mode')=='true') {
  21. if(api_is_allowed_to_create_course()) {
  22. // Link to my courses for teachers
  23. $navigation['mycourses']['url'] = api_get_path(WEB_PATH).'user_portal.php?nosession=true';
  24. $navigation['mycourses']['title'] = get_lang('MyCourses');
  25. } else {
  26. // Link to my courses for students
  27. $navigation['mycourses']['url'] = api_get_path(WEB_PATH).'user_portal.php';
  28. $navigation['mycourses']['title'] = get_lang('MyCourses');
  29. }
  30. } else {
  31. // Link to my courses
  32. $navigation['mycourses']['url'] = api_get_path(WEB_PATH).'user_portal.php';
  33. $navigation['mycourses']['title'] = get_lang('MyCourses');
  34. }
  35. // My Profile
  36. $navigation['myprofile']['url'] = api_get_path(WEB_CODE_PATH).'auth/profile.php'.(!empty($_course['path']) ? '?coursePath='.$_course['path'].'&amp;courseCode='.$_course['official_code'] : '' );
  37. $navigation['myprofile']['title'] = get_lang('ModifyProfile');
  38. // Link to my agenda
  39. $navigation['myagenda']['url'] = api_get_path(WEB_CODE_PATH).'calendar/myagenda.php'.(!empty($_course['path']) ? '?coursePath='.$_course['path'].'&amp;courseCode='.$_course['official_code'] : '' );
  40. $navigation['myagenda']['title'] = get_lang('MyAgenda');
  41. // Gradebook
  42. if (api_get_setting('gradebook_enable') == 'true') {
  43. $navigation['mygradebook']['url'] = api_get_path(WEB_CODE_PATH).'gradebook/gradebook.php'.(!empty($_course['path']) ? '?coursePath='.$_course['path'].'&amp;courseCode='.$_course['official_code'] : '' );
  44. $navigation['mygradebook']['title'] = get_lang('MyGradebook');
  45. }
  46. // Reporting
  47. if(api_is_allowed_to_create_course() || $_user['status']==DRH) {
  48. // Link to my space
  49. $navigation['session_my_space']['url'] = api_get_path(WEB_CODE_PATH).'mySpace/';
  50. $navigation['session_my_space']['title'] = get_lang('MySpace');
  51. } else {
  52. // Link to my progress
  53. $navigation['session_my_progress']['url'] = api_get_path(WEB_CODE_PATH).'auth/my_progress.php';
  54. $navigation['session_my_progress']['title'] = get_lang('MyProgress');
  55. }
  56. // Social
  57. if (api_get_setting('allow_social_tool')=='true') {
  58. $navigation['social']['url'] = api_get_path(WEB_CODE_PATH).'social/profile.php';
  59. $navigation['social']['title'] = get_lang('SocialNetwork');
  60. }
  61. // Platform administration
  62. if (api_is_platform_admin(true)) {
  63. //$navigation['platform_admin']['url'] = $rootAdminWeb;
  64. $navigation['platform_admin']['url'] = api_get_path(WEB_CODE_PATH).'admin/';
  65. $navigation['platform_admin']['title'] = get_lang('PlatformAdmin');
  66. }
  67. return $navigation;
  68. }
  69. ?>