banner.inc.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  1. <?php //$id: $
  2. /* For licensing terms, see /dokeos_license.txt */
  3. /**
  4. ==============================================================================
  5. * This script contains the actual html code to display the "header"
  6. * or "banner" on top of every Dokeos page.
  7. *
  8. * @package dokeos.include
  9. ==============================================================================
  10. */
  11. ?>
  12. <div id="wrapper">
  13. <div id="header">
  14. <div id="header1">
  15. <div id="top_corner"></div>
  16. <div id="institution">
  17. <a href="<?php echo api_get_path(WEB_PATH);?>index.php" target="_top"><?php echo api_get_setting('siteName') ?></a>
  18. <?php
  19. $iurl = api_get_setting('InstitutionUrl');
  20. $iname = api_get_setting('Institution');
  21. if (!empty($iname))
  22. {
  23. echo '-&nbsp;<a href="'.$iurl.'" target="_top">'.$iname.'</a>';
  24. }
  25. ?>
  26. </div>
  27. <?php
  28. /*
  29. -----------------------------------------------------------------------------
  30. Course title section
  31. -----------------------------------------------------------------------------
  32. */
  33. if (!empty($_cid) and $_cid != -1 and isset($_course)) {
  34. //Put the name of the course in the header
  35. ?>
  36. <div id="my_courses"><a href="<?php echo api_get_path(WEB_COURSE_PATH).$_course['path']; ?>/index.php" target="_top">
  37. <?php
  38. echo $_course['name']." ";
  39. /*echo '
  40. <div id="my_courses">
  41. <a href="'.api_get_path(WEB_COURSE_PATH).$_course['path'].'/index.php" target="_top">'.$_course['name'].' ';*/
  42. if (api_get_setting("display_coursecode_in_courselist") == "true") {
  43. echo $_course['official_code'];
  44. }
  45. if(api_get_setting("use_session_mode") == "true" && isset($_SESSION['session_name'])) {
  46. echo ' ('.$_SESSION['session_name'].')';
  47. }
  48. if (api_get_setting("display_coursecode_in_courselist") == "true" AND api_get_setting("display_teacher_in_courselist") == "true") {
  49. echo " - ";
  50. }
  51. if (api_get_setting("display_teacher_in_courselist") == "true") {
  52. echo stripslashes($_course['titular']);
  53. }
  54. echo "</a></div>";
  55. } elseif (isset ($nameTools) && $language_file != 'course_home') {
  56. //Put the name of the user-tools in the header
  57. if (!isset ($_user['user_id'])) {
  58. echo " ";
  59. } elseif(!$noPHP_SELF) {
  60. echo "<div id=\"my_courses\"><a href=\"".api_get_self()."?".api_get_cidreq(), "\" target=\"_top\">", $nameTools, "</a></div>", "\n";
  61. } else {
  62. echo "<div id=\"my_courses\">$nameTools</div>\n";
  63. }
  64. }
  65. //not to let the header disappear if there's nothing on the left
  66. echo ' <div class="clear">&nbsp;</div>';
  67. /*
  68. -----------------------------------------------------------------------------
  69. Plugins for banner section
  70. -----------------------------------------------------------------------------
  71. */
  72. api_plugin('header');
  73. $web_course_path = api_get_path(WEB_COURSE_PATH);
  74. /*
  75. -----------------------------------------------------------------------------
  76. External link section
  77. -----------------------------------------------------------------------------
  78. */
  79. if (isset($_course['extLink']) && $_course['extLink']['name'] != "") {
  80. echo "<span class=\"extLinkSeparator\"> / </span>";
  81. if ($_course['extLink']['url'] != "") {
  82. echo "<a class=\"extLink\" href=\"".$_course['extLink']['url']."\" target=\"_top\">";
  83. echo $_course['extLink']['name'];
  84. echo "</a>";
  85. } else {
  86. echo $_course['extLink']['name'];
  87. }
  88. }
  89. ?>
  90. </div>
  91. <div id="header2">
  92. <div id="Header2Right">
  93. <ul>
  94. <?php
  95. if ((api_get_setting('showonline','world') == "true" AND !$_user['user_id']) OR (api_get_setting('showonline','users') == "true" AND $_user['user_id']) OR (api_get_setting('showonline','course') == "true" AND $_user['user_id'] AND $_cid)) {
  96. if (api_get_setting("use_session_mode") == "true" && isset($_user['user_id']) && api_is_coach()) {
  97. echo ' <li><a href="'.api_get_path(WEB_PATH).'whoisonlinesession.php?id_coach='.$_user['user_id'].'&amp;referer='.urlencode($_SERVER['REQUEST_URI']).'" target="_top">'.get_lang('UsersConnectedToMySessions').'</a></li>';
  98. }
  99. $statistics_database = Database :: get_statistic_database();
  100. $number = count(WhoIsOnline(api_get_user_id(), $statistics_database, api_get_setting('time_limit_whosonline')));
  101. if(!empty($_course['id'])) {
  102. $online_in_course = who_is_online_in_this_course(api_get_user_id(), api_get_setting('time_limit_whosonline'), $_course['id']);
  103. $number_online_in_course= count( $online_in_course );
  104. } else {
  105. $number_online_in_course = 0;
  106. }
  107. echo "<li>";
  108. // Display the who's online of the platform
  109. if ((api_get_setting('showonline','world') == "true" AND !$_user['user_id']) OR (api_get_setting('showonline','users') == "true" AND $_user['user_id'])) {
  110. //echo '<a href="'.api_get_path(WEB_PATH).'whoisonline.php" target="_top">'.$number.'</a>';
  111. echo '<a href="'.api_get_path(WEB_PATH).'whoisonline.php" target="_top">'.get_lang('UsersOnline').': '.$number.'</a>';
  112. }
  113. // Display the who's online for the course
  114. if (is_array($_course) AND api_get_setting('showonline','course') == "true" AND isset($_course['sysCode'])) {
  115. echo "(<a href='".api_get_path(WEB_PATH)."whoisonline.php?cidReq=".$_course['sysCode']."' target='_top'>$number_online_in_course ".get_lang('InThisCourse')."</a>)";
  116. }
  117. echo '</li>';
  118. }
  119. if ($_user['user_id'] && isset($_cid)) {
  120. if ((api_is_course_admin() || api_is_platform_admin()) && api_get_setting('student_view_enabled') == 'true') {
  121. echo '<li>| ';
  122. api_display_tool_view_option();
  123. echo '</li>';
  124. }
  125. }
  126. if ( api_is_allowed_to_edit() ) {
  127. if(!empty($help)) {
  128. // Show help
  129. ?>
  130. <li>|
  131. <a href="#" onclick="MyWindow=window.open('<?php echo api_get_path(WEB_CODE_PATH)."help/help.php"; ?>?open=<?php echo $help; ?>','MyWindow','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=620,height=600,left=200,top=20'); return false;">
  132. <img src="<?php echo api_get_path(WEB_CODE_PATH); ?>img/khelpcenter.gif" style="vertical-align: middle;" alt="<?php echo get_lang("Help") ?>"/>&nbsp;<?php echo get_lang("Help") ?></li></a>
  133. <?php
  134. }
  135. }
  136. ?>
  137. </ul>
  138. </div>
  139. <div class="clear">&nbsp;</div>
  140. </div>
  141. <div id="header3">
  142. <?php
  143. /*
  144. -----------------------------------------------------------------------------
  145. User section
  146. -----------------------------------------------------------------------------
  147. */
  148. if ($_user['user_id']) {
  149. $login = '';
  150. if(api_is_anonymous()) {
  151. $login = '('.get_lang('Anonymous').')';
  152. } else {
  153. $uinfo = api_get_user_info(api_get_user_id());
  154. $login = '('.$uinfo['username'].')';
  155. }
  156. ?>
  157. <!-- start user section line with name, my course, my profile, scorm info, etc -->
  158. <ul id="logout">
  159. <li><a href="<?php echo api_get_path(WEB_PATH); ?>index.php?logout=logout&uid=<?php echo $_user['user_id']; ?>" target="_top"><span><?php echo get_lang('Logout').' '.$login; ?></span></a></li>
  160. </ul>
  161. <?php
  162. }
  163. ?>
  164. <ul>
  165. <?php
  166. $navigation = array();
  167. $possible_tabs = get_tabs();
  168. // Campus Homepage
  169. if (api_get_setting('show_tabs', 'campus_homepage') == 'true') {
  170. $navigation[SECTION_CAMPUS] = $possible_tabs[SECTION_CAMPUS];
  171. } else {
  172. $menu_navigation[SECTION_CAMPUS] = $possible_tabs[SECTION_CAMPUS];
  173. }
  174. if ($_user['user_id'] && !api_is_anonymous()) {
  175. // My Courses
  176. if (api_get_setting('show_tabs', 'my_courses') == 'true') {
  177. $navigation['mycourses'] = $possible_tabs['mycourses'];
  178. } else{
  179. $menu_navigation['mycourses'] = $possible_tabs['mycourses'];
  180. }
  181. // My Profile
  182. if (api_get_setting('show_tabs', 'my_profile') == 'true') {
  183. $navigation['myprofile'] = $possible_tabs['myprofile'];
  184. } else {
  185. $menu_navigation['myprofile'] = $possible_tabs['myprofile'];
  186. }
  187. // My Agenda
  188. if (api_get_setting('show_tabs', 'my_agenda') == 'true') {
  189. $navigation['myagenda'] = $possible_tabs['myagenda'];
  190. } else {
  191. $menu_navigation['myagenda'] = $possible_tabs['myagenda'];
  192. }
  193. // Gradebook
  194. if (api_get_setting('gradebook_enable') == 'true') {
  195. if (api_get_setting('show_tabs', 'my_gradebook') == 'true') {
  196. $navigation['mygradebook'] = $possible_tabs['mygradebook'];
  197. } else{
  198. $menu_navigation['mygradebook'] = $possible_tabs['mygradebook'];
  199. }
  200. }
  201. // Reporting
  202. if (api_get_setting('show_tabs', 'reporting') == 'true') {
  203. if(api_is_allowed_to_create_course() || $_user['status'] == DRH) {
  204. $navigation['session_my_space'] = $possible_tabs['session_my_space'];
  205. } else {
  206. $navigation['session_my_space'] = $possible_tabs['session_my_progress'];
  207. }
  208. } else {
  209. if(api_is_allowed_to_create_course() || $_user['status'] == DRH) {
  210. $menu_navigation['session_my_space'] = $possible_tabs['session_my_space'];
  211. } else {
  212. $menu_navigation['session_my_space'] = $possible_tabs['session_my_progress'];
  213. }
  214. }
  215. if(api_is_platform_admin(true)) {
  216. if (api_get_setting('show_tabs', 'platform_administration') == 'true') {
  217. $navigation['platform_admin'] = $possible_tabs['platform_admin'];
  218. } else {
  219. $menu_navigation['platform_admin'] = $possible_tabs['platform_admin'];
  220. }
  221. }
  222. }
  223. // Displaying the tabs
  224. foreach($navigation as $section => $navigation_info) {
  225. if(isset($GLOBALS['this_section'])) {
  226. $current = ($section == $GLOBALS['this_section'] ? ' id="current"' : '');
  227. } else {
  228. $current = '';
  229. }
  230. echo '<li'.$current.'><a href="'.$navigation_info['url'].'" target="_top"><span>'.$navigation_info['title'].'</span></a></li>'."\n";
  231. }
  232. /*********************/
  233. $lang = ''; //el for "Edit Language"
  234. if(!empty($_SESSION['user_language_choice'])) {
  235. $lang=$_SESSION['user_language_choice'];
  236. } elseif(!empty($_SESSION['_user']['language'])) {
  237. $lang=$_SESSION['_user']['language'];
  238. } else {
  239. $lang=get_setting('platformLanguage');
  240. }
  241. if ($_configuration['multiple_access_urls']==true) {
  242. $access_url_id = api_get_current_access_url_id();
  243. if ($access_url_id != -1){
  244. $url_info = api_get_access_url($access_url_id);
  245. $url = substr($url_info['url'],7,strlen($url_info['url'])-8);
  246. $clean_url = replace_dangerous_char($url);
  247. $clean_url = str_replace('/','-',$clean_url);
  248. $clean_url = $clean_url.'/';
  249. $homep = '../../home/'; //homep for Home Path
  250. $homep_new = '../../home/'.$clean_url; //homep for Home Path added the url
  251. $new_url_dir = api_get_path(SYS_PATH).'home/'.$clean_url;
  252. //we create the new dir for the new sites
  253. if (!is_dir($new_url_dir)){
  254. umask(0);
  255. $perm = api_get_setting('permissions_for_new_directories');
  256. $perm = octdec(!empty($perm)?$perm:'0755');
  257. mkdir($new_url_dir, $perm);
  258. }
  259. }
  260. } else {
  261. $homep_new ='';
  262. $vv = explode('/', api_get_self());
  263. if(count($vv) > 2) $homep = '../../home/';
  264. else $homep = 'home/';
  265. }
  266. $ext = '.html';
  267. $menutabs = 'home_tabs';
  268. if(is_file($homep.$menutabs.'_'.$lang.$ext) && is_readable($homep.$menutabs.'_'.$lang.$ext)) {
  269. $home_top=file_get_contents($homep.$menutabs.'_'.$lang.$ext);
  270. } elseif(is_file($homep.$menutabs.$lang.$ext) && is_readable($homep.$menutabs.$lang.$ext)) {
  271. $home_top=file_get_contents($homep.$menutabs.$lang.$ext);
  272. } else {
  273. $errorMsg=get_lang('HomePageFilesNotReadable');
  274. }
  275. if(api_get_self() != '/main/admin/configure_homepage.php') {
  276. if(file_exists($homep.$menutabs.'_'.$lang.$ext)) {
  277. $home_top_temp=file_get_contents($homep.$menutabs.'_'.$lang.$ext);
  278. } else {
  279. $home_top_temp=file_get_contents($homep.$menutabs.$ext);
  280. }
  281. $open=str_replace('{rel_path}',api_get_path(REL_PATH),$home_top_temp);
  282. echo $open;
  283. } else {
  284. $home_menu = '';
  285. if(file_exists($homep.$menutabs.'_'.$lang.$ext)) {
  286. $home_menu = file($homep.$menutabs.'_'.$lang.$ext);
  287. } else {
  288. $home_menu = file ($homep.$menutabs.$ext);
  289. }
  290. foreach($home_menu as $key=>$enreg) {
  291. $enreg=trim($enreg);
  292. if(!empty($enreg)) {
  293. $edit_link='<a href="'.api_get_self().'?action=edit_tabs&amp;link_index='.$key.'" style="padding-right:0px; padding-left:0px;">'.Display::return_icon('edit.gif', get_lang('Edit')).'</a>';
  294. $delete_link='<a href="'.api_get_self().'?action=delete_tabs&amp;link_index='.$key.'" style="padding-right:0px;" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\')) return false;">'.Display::return_icon('delete.gif', get_lang('Delete')).'</a>';
  295. echo str_replace(array('href="'.api_get_path(WEB_PATH).'index.php?include=','</li>'),array('href="'.api_get_path(WEB_CODE_PATH).'admin/'.basename(api_get_self()).'?action=open_link&link=',' '.$edit_link.' '.$delete_link.'</li>'),$enreg);
  296. }
  297. }
  298. echo '<li id="insert-link"> <a href="'.api_get_self().'?action=insert_tabs" style="padding-right:0px;">'. Display::return_icon('insert_row.png', get_lang('InsertLink')).'</a> <a href="'.api_get_self().'?action=insert_tabs">'.get_lang('InsertLink').'</a></li>';
  299. }
  300. /*********************/
  301. //Header about the tabs
  302. if ($_self == 'admin_intro_edition_page')
  303. ?>
  304. </ul>
  305. <div style="clear: both;" class="clear"> </div>
  306. </div>
  307. <?php
  308. /*
  309. * if the user is a coach he can see the users who are logged in its session
  310. */
  311. $navigation = array();
  312. // part 1: Course Homepage. If we are in a course then the first breadcrumb is a link to the course homepage
  313. //hide_course_breadcrumb the parameter has been added to hide the name of the course, that appeared in the default $interbreadcrumb
  314. $session_id = api_get_session_id();
  315. $session_name = api_get_session_name($my_session_id);
  316. $my_session_name= ($session_name==null) ? '' : '&nbsp;('.$session_name.')';
  317. if (isset ($_cid) and $_cid!=-1 and isset($_course) and !isset($_GET['hide_course_breadcrumb'])) {
  318. $navigation_item['url'] = $web_course_path . $_course['path'].'/index.php';
  319. switch(api_get_setting('breadcrumbs_course_homepage')) {
  320. case 'get_lang':
  321. $navigation_item['title'] = get_lang('CourseHomepageLink');
  322. break;
  323. case 'course_code':
  324. $navigation_item['title'] = $_course['official_code'];
  325. break;
  326. case 'session_name_and_course_title':
  327. $navigation_item['title'] = $_course['name'].$my_session_name;
  328. break;
  329. default:
  330. $navigation_item['title'] = $_course['name'];
  331. break;
  332. }
  333. $navigation[] = $navigation_item;
  334. }
  335. // part 2: Interbreadcrumbs. If there is an array $interbreadcrumb defined then these have to appear before the last breadcrumb (which is the tool itself)
  336. if (isset($interbreadcrumb) && is_array($interbreadcrumb)) {
  337. foreach($interbreadcrumb as $breadcrumb_step) {
  338. $sep = (strrchr($breadcrumb_step['url'], '?') ? '&amp;' : '?');
  339. $navigation_item['url'] = $breadcrumb_step['url'].$sep.api_get_cidreq();
  340. $navigation_item['title'] = $breadcrumb_step['name'];
  341. $navigation[] = $navigation_item;
  342. }
  343. }
  344. // part 3: The tool itself. If we are on the course homepage we do not want to display the title of the course because this
  345. // is the same as the first part of the breadcrumbs (see part 1)
  346. if (isset ($nameTools) AND $language_file<>"course_home") {
  347. $navigation_item['url'] = '#';
  348. $navigation_item['title'] = $nameTools;
  349. $navigation[] = $navigation_item;
  350. }
  351. $final_navigation = array();
  352. foreach($navigation as $index => $navigation_info) {
  353. if(!empty($navigation_info['title'])) {
  354. $final_navigation[$index] = '<a href="'.$navigation_info['url'].'" class="breadcrumb breadcrumb'.$index.'" target="_top">'.$navigation_info['title'].'</a>';
  355. }
  356. }
  357. if (!empty($final_navigation)) {
  358. echo '<div id="header4">';
  359. echo implode(' &gt; ',$final_navigation);
  360. echo '</div>';
  361. }
  362. if(api_get_setting('show_toolshortcuts')=='true') {
  363. echo '<div id="toolshortcuts">';
  364. require_once('tool_navigation_menu.inc.php');
  365. show_navigation_tool_shortcuts();
  366. echo '</div>';
  367. }
  368. if (isset ($dokeos_database_connection)) {
  369. // connect to the main database.
  370. // if single database, don't pefix table names with the main database name in SQL queries
  371. // (ex. SELECT * FROM `table`)
  372. // if multiple database, prefix table names with the course database name in SQL queries (or no prefix if the table is in
  373. // the main database)
  374. // (ex. SELECT * FROM `table_from_main_db` - SELECT * FROM `courseDB`.`table_from_course_db`)
  375. mysql_select_db($_configuration['main_database'], $dokeos_database_connection);
  376. }
  377. ?>
  378. </div> <!-- end of the whole #header section -->
  379. <div class="clear">&nbsp;</div>
  380. <?php
  381. //to mask the main div, set $header_hide_main_div to true in any script just before calling Display::display_header();
  382. global $header_hide_main_div;
  383. if (!empty($header_hide_main_div) && $header_hide_main_div===true) {
  384. //do nothing
  385. } else {
  386. ?>
  387. <div id="main"> <!-- start of #main wrapper for #content and #menu divs -->
  388. <?php
  389. }
  390. /*
  391. -----------------------------------------------------------------------------
  392. "call for chat" module section
  393. -----------------------------------------------------------------------------
  394. */
  395. $chat = strpos(api_get_self(), 'chat_banner.php');
  396. if (!$chat) {
  397. include_once (api_get_path(LIBRARY_PATH)."online.inc.php");
  398. //echo $accept;
  399. $chatcall = chatcall();
  400. if ($chatcall) {
  401. Display :: display_normal_message($chatcall);
  402. }
  403. }
  404. /*
  405. -----------------------------------------------------------------------------
  406. Navigation menu section
  407. -----------------------------------------------------------------------------
  408. */
  409. if(api_get_setting('show_navigation_menu') != 'false' && api_get_setting('show_navigation_menu') != 'icons') {
  410. Display::show_course_navigation_menu($_GET['isHidden']);
  411. $course_id = api_get_course_id();
  412. if (!empty($course_id) && ($course_id != -1)) {
  413. echo '<div id="menuButton">';
  414. echo $output_string_menu;
  415. echo '</div>';
  416. if(isset($_SESSION['hideMenu'])) {
  417. if($_SESSION['hideMenu'] =="shown") {
  418. if (isset($_cid) ) {
  419. echo '<div id="centerwrap"> <!-- start of #centerwrap -->';
  420. echo '<div id="center"> <!-- start of #center -->';
  421. }
  422. }
  423. } else {
  424. if (isset($_cid) ) {
  425. echo '<div id="centerwrap"> <!-- start of #centerwrap -->';
  426. echo '<div id="center"> <!-- start of #center -->';
  427. }
  428. }
  429. }
  430. }
  431. /**
  432. * Determines the possible tabs (=sections) that are available.
  433. * This function is used when creating the tabs in the third header line and all the sections
  434. * that do not appear there (as determined by the platform admin on the Dokeos configuration settings page)
  435. * will appear in the right hand menu that appears on several other pages
  436. *
  437. * @return array containing all the possible tabs
  438. *
  439. * @version Dokeos 1.8.4
  440. * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
  441. */
  442. function get_tabs() {
  443. global $_course, $rootAdminWeb, $_user;
  444. // Campus Homepage
  445. $navigation[SECTION_CAMPUS]['url'] = api_get_path(WEB_PATH).'index.php';
  446. $navigation[SECTION_CAMPUS]['title'] = get_lang('CampusHomepage');
  447. // My Courses
  448. if(api_get_setting('use_session_mode')=='true') {
  449. if(api_is_allowed_to_create_course()) {
  450. // Link to my courses for teachers
  451. $navigation['mycourses']['url'] = api_get_path(WEB_PATH).'user_portal.php?nosession=true';
  452. $navigation['mycourses']['title'] = get_lang('MyCourses');
  453. } else {
  454. // Link to my courses for students
  455. $navigation['mycourses']['url'] = api_get_path(WEB_PATH).'user_portal.php';
  456. $navigation['mycourses']['title'] = get_lang('MyCourses');
  457. }
  458. } else {
  459. // Link to my courses
  460. $navigation['mycourses']['url'] = api_get_path(WEB_PATH).'user_portal.php';
  461. $navigation['mycourses']['title'] = get_lang('MyCourses');
  462. }
  463. // My Profile
  464. $navigation['myprofile']['url'] = api_get_path(WEB_CODE_PATH).'auth/profile.php'.(!empty($_course['path']) ? '?coursePath='.$_course['path'].'&amp;courseCode='.$_course['official_code'] : '' );
  465. $navigation['myprofile']['title'] = get_lang('ModifyProfile');
  466. // Link to my agenda
  467. $navigation['myagenda']['url'] = api_get_path(WEB_CODE_PATH).'calendar/myagenda.php'.(!empty($_course['path']) ? '?coursePath='.$_course['path'].'&amp;courseCode='.$_course['official_code'] : '' );
  468. $navigation['myagenda']['title'] = get_lang('MyAgenda');
  469. // Gradebook
  470. if (api_get_setting('gradebook_enable') == 'true') {
  471. $navigation['mygradebook']['url'] = api_get_path(WEB_CODE_PATH).'gradebook/gradebook.php'.(!empty($_course['path']) ? '?coursePath='.$_course['path'].'&amp;courseCode='.$_course['official_code'] : '' );
  472. $navigation['mygradebook']['title'] = get_lang('MyGradebook');
  473. }
  474. // Reporting
  475. if(api_is_allowed_to_create_course() || $_user['status']==DRH) {
  476. // Link to my space
  477. $navigation['session_my_space']['url'] = api_get_path(WEB_CODE_PATH).'mySpace/';
  478. $navigation['session_my_space']['title'] = get_lang('MySpace');
  479. } else {
  480. // Link to my progress
  481. $navigation['session_my_progress']['url'] = api_get_path(WEB_CODE_PATH).'auth/my_progress.php';
  482. $navigation['session_my_progress']['title'] = get_lang('MyProgress');
  483. }
  484. // Platform administration
  485. if (api_is_platform_admin(true)) {
  486. //$navigation['platform_admin']['url'] = $rootAdminWeb;
  487. $navigation['platform_admin']['url'] = api_get_path(WEB_CODE_PATH).'admin/';
  488. $navigation['platform_admin']['title'] = get_lang('PlatformAdmin');
  489. }
  490. return $navigation;
  491. }
  492. ?>
  493. <!-- Begin Of script Output -->