banner.inc.php 20 KB

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