banner.inc.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. $session_id = api_get_session_id();
  12. $session_name = api_get_session_name($my_session_id);
  13. echo '<div id="wrapper">';
  14. echo '<ul id="navigation">';
  15. if (!empty($help)) {
  16. $help = Security::remove_XSS($help);
  17. ?>
  18. <li class="help">
  19. <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'); ?>">
  20. <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');?>" />
  21. </a>
  22. </li>
  23. <?php
  24. // Reports
  25. if (api_get_setting('show_tabs', 'reports') == 'true') {
  26. if ((api_is_platform_admin() || api_is_drh() || api_is_session_admin()) && Rights::hasRight('show_tabs:reports')) {
  27. $navigation['reports'] = $possible_tabs['reports'];
  28. }
  29. } else{
  30. $menu_navigation['reports'] = $possible_tabs['reports'];
  31. }
  32. // Custom tabs
  33. for ($i=1;$i<=3;$i++)
  34. if (api_get_setting('show_tabs', 'custom_tab_'.$i) == 'true') {
  35. $navigation['custom_tab_'.$i] = $possible_tabs['custom_tab_'.$i];
  36. } else{
  37. $menu_navigation['custom_tab_'.$i] = $possible_tabs['custom_tab_'.$i];
  38. }
  39. }
  40. if (api_get_setting('show_link_bug_notification') == 'true') {
  41. ?>
  42. <li class="report">
  43. <a href="http://support.chamilo.org/projects/chamilo-18/wiki/How_to_report_bugs" target="_blank">
  44. <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>
  45. </li>
  46. <?php
  47. }
  48. echo'</ul>';
  49. echo '<div id="header">';
  50. show_header_1($language_file, $nameTools);
  51. show_header_2();
  52. $menu_navigation = show_header_3();
  53. show_header_4($interbreadcrumb, $language_file, $nameTools);
  54. if (isset($database_connection)) {
  55. // connect to the main database.
  56. // if single database, don't pefix table names with the main database name in SQL queries
  57. // (ex. SELECT * FROM table)
  58. // if multiple database, prefix table names with the course database name in SQL queries (or no prefix if the table is in
  59. // the main database)
  60. // (ex. SELECT * FROM table_from_main_db - SELECT * FROM courseDB.table_from_course_db)
  61. Database::select_db($_configuration['main_database'], $database_connection);
  62. }
  63. echo '</div>'; // <!-- end of the whole #header section -->
  64. if (api_get_setting('show_toolshortcuts') == 'true') {
  65. require_once api_get_path(INCLUDE_PATH).'tool_navigation_menu.inc.php';
  66. show_navigation_tool_shortcuts();
  67. }
  68. echo '<div id="main">';
  69. echo '<div id="submain">';
  70. /* "call for chat" module section */
  71. $chat = strpos(api_get_self(), 'chat_banner.php');
  72. if (!$chat) {
  73. include_once api_get_path(LIBRARY_PATH).'online.inc.php';
  74. //echo $accept;
  75. $chatcall = chatcall();
  76. if ($chatcall) {
  77. Display :: display_normal_message($chatcall);
  78. }
  79. }
  80. /* Navigation menu section */
  81. if (api_get_setting('show_navigation_menu') != 'false' && api_get_setting('show_navigation_menu') != 'icons') {
  82. Display::show_course_navigation_menu($_GET['isHidden']);
  83. $course_id = api_get_course_id();
  84. if (!empty($course_id) && ($course_id != -1)) {
  85. echo '<div id="menuButton">';
  86. echo $output_string_menu;
  87. echo '</div>';
  88. if (isset($_SESSION['hideMenu'])) {
  89. if ($_SESSION['hideMenu'] == 'shown') {
  90. if (isset($_cid)) {
  91. echo '<div id="centerwrap">'; // <!-- start of #centerwrap -->
  92. echo '<div id="center">'; // <!-- start of #center -->
  93. }
  94. }
  95. } else {
  96. if (isset($_cid)) {
  97. echo '<div id="centerwrap">'; // <!-- start of #centerwrap -->
  98. echo '<div id="center">'; //<!-- start of #center -->
  99. }
  100. }
  101. }
  102. }