banner.inc.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. * @todo this should be remove we should only use header.inc.php
  7. *
  8. * @package chamilo.include
  9. */
  10. require_once api_get_path(LIBRARY_PATH).'banner.lib.php';
  11. global $my_session_id;
  12. $session_id = api_get_session_id();
  13. $session_name = api_get_session_name($my_session_id);
  14. echo '<div id="wrapper">';
  15. echo '<ul id="navigation">';
  16. if (api_get_setting('enable_help_link') == 'true') {
  17. if (!empty($help)) {
  18. $help = Security::remove_XSS($help);
  19. ?>
  20. <li class="help">
  21. <a href="<?php echo api_get_path(WEB_CODE_PATH); ?>help/help.php?open=<?php echo $help; ?>&height=400&width=600" class="thickbox" title="<?php echo get_lang('Help'); ?>">
  22. <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');?>" />
  23. </a>
  24. </li>
  25. <?php }
  26. }
  27. if (api_get_setting('show_link_bug_notification') == 'true') {
  28. ?>
  29. <li class="report">
  30. <a href="http://support.chamilo.org/projects/chamilo-18/wiki/How_to_report_bugs" target="_blank">
  31. <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>
  32. </li>
  33. <?php
  34. }
  35. echo'</ul>';
  36. echo '<div id="header">';
  37. show_header_1($language_file, $nameTools);
  38. show_header_2();
  39. $menu_navigation = show_header_3();
  40. if (isset($database_connection)) {
  41. // connect to the main database.
  42. // if single database, don't pefix table names with the main database name in SQL queries
  43. // (ex. SELECT * FROM table)
  44. // if multiple database, prefix table names with the course database name in SQL queries (or no prefix if the table is in
  45. // the main database)
  46. // (ex. SELECT * FROM table_from_main_db - SELECT * FROM courseDB.table_from_course_db)
  47. Database::select_db($_configuration['main_database'], $database_connection);
  48. }
  49. echo '</div>'; // <!-- end of the whole #header section -->
  50. if (api_get_setting('show_toolshortcuts') == 'true') {
  51. require_once api_get_path(INCLUDE_PATH).'tool_navigation_menu.inc.php';
  52. show_navigation_tool_shortcuts();
  53. }
  54. echo '<div id="main">';
  55. echo show_header_4($interbreadcrumb, $language_file, $nameTools);
  56. echo '<div id="submain">';
  57. /* "call for chat" module section */
  58. $chat = strpos(api_get_self(), 'chat_banner.php');
  59. if (!$chat) {
  60. include_once api_get_path(LIBRARY_PATH).'online.inc.php';
  61. //echo $accept;
  62. $chatcall = chatcall();
  63. if ($chatcall) {
  64. Display :: display_normal_message($chatcall);
  65. }
  66. }
  67. /* Navigation menu section */
  68. if (api_get_setting('show_navigation_menu') != 'false' && api_get_setting('show_navigation_menu') != 'icons') {
  69. Display::show_course_navigation_menu($_GET['isHidden']);
  70. $course_id = api_get_course_id();
  71. if (!empty($course_id) && ($course_id != -1)) {
  72. echo '<div id="menuButton">';
  73. echo $output_string_menu;
  74. echo '</div>';
  75. if (isset($_SESSION['hideMenu'])) {
  76. if ($_SESSION['hideMenu'] == 'shown') {
  77. if (isset($_cid)) {
  78. echo '<div id="centerwrap">'; // <!-- start of #centerwrap -->
  79. echo '<div id="center">'; // <!-- start of #center -->
  80. }
  81. }
  82. } else {
  83. if (isset($_cid)) {
  84. echo '<div id="centerwrap">'; // <!-- start of #centerwrap -->
  85. echo '<div id="center">'; //<!-- start of #center -->
  86. }
  87. }
  88. }
  89. }