banner.lib.php 3.6 KB

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