footer.inc.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * This script displays the footer that is below (almost)
  5. * every Chamilo web page.
  6. *
  7. * @package chamilo.include
  8. */
  9. // Display of tool_navigation_menu according to admin setting.
  10. require_once api_get_path(LIBRARY_PATH).'course.lib.php';
  11. if (api_get_setting('show_navigation_menu') != 'false') {
  12. $course_id = api_get_course_id();
  13. if (!empty($course_id) && ($course_id != -1)) {
  14. if (api_get_setting('show_navigation_menu') != 'icons') {
  15. echo '</div> <!-- end #center -->';
  16. echo '</div> <!-- end #centerwrap -->';
  17. }
  18. require_once api_get_path(INCLUDE_PATH).'tool_navigation_menu.inc.php';
  19. show_navigation_menu();
  20. }
  21. }
  22. ?>
  23. <div class="clear">&nbsp;</div> <!-- 'clearing' div to make sure that footer stays below the main and right column sections -->
  24. </div> <!-- end of #main" started at the end of banner.inc.php -->
  25. </div> <!-- end of #main" started at the end of banner.inc.php -->
  26. <div class="push"></div>
  27. </div> <!-- end of #wrapper section -->
  28. <div id="footer"> <!-- start of #footer section -->
  29. <div id="bottom_corner"></div>
  30. <?php
  31. global $_configuration;
  32. echo '<div class="copyright">';
  33. if (api_get_setting('show_administrator_data') == 'true') {
  34. // Platform manager
  35. echo '<div align="right">', get_lang('Manager'), ' : ', Display::encrypted_mailto_link(api_get_setting('emailAdministrator'), api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'))).'</div>';
  36. }
  37. echo get_lang('Platform'), ' <a href="', $_configuration['software_url'], '" target="_blank">', $_configuration['software_name'], ' ', $_configuration['system_version'], '</a> &copy; ', date('Y');
  38. echo '</div>'; //copyright div
  39. echo '<div class="footer_emails">';
  40. /* Plugins for footer section */
  41. echo '<div id="plugin-footer">';
  42. api_plugin('footer');
  43. echo '</div>';
  44. if (api_get_setting('show_tutor_data') == 'true') {
  45. // Course manager
  46. $id_course = api_get_course_id();
  47. $id_session = api_get_session_id();
  48. if (isset($id_course) && $id_course != -1) {
  49. echo '<div id="platformmanager">';
  50. if ($id_session != 0){
  51. $coachs_email = CourseManager::get_email_of_tutor_to_session($id_session, $id_course);
  52. $email_link = array();
  53. foreach ($coachs_email as $coach_email) {
  54. foreach ($coach_email as $email => $username) {
  55. $email_link[] = Display::encrypted_mailto_link($email, $username);
  56. }
  57. }
  58. if (count($coachs_email) > 1) {
  59. $bar = '<br />';
  60. echo get_lang('Coachs').' : <ul>';
  61. echo '<li>'.implode("<li>", $email_link);
  62. echo '</ul>';
  63. } elseif (count($coachs_email) == 1) {
  64. echo get_lang('Coach').' : ';
  65. echo implode("&nbps;", $email_link);
  66. } elseif (count($coachs_email) == 0) {
  67. echo '';
  68. }
  69. }
  70. echo '</div>';
  71. }
  72. echo '<br>';
  73. }
  74. echo '<div style="clear:both"></div>';
  75. $class = '';
  76. if (api_get_setting('show_teacher_data') == 'true') {
  77. if (api_get_setting('show_tutor_data') == 'false') {
  78. $class = 'platformmanager';
  79. } else {
  80. $class = 'coursemanager';
  81. }
  82. // course manager
  83. $id_course = api_get_course_id();
  84. if (isset($id_course) && $id_course != -1) {
  85. echo '<div id="'.$class.'">';
  86. $mail = CourseManager::get_emails_of_tutors_to_course($id_course);
  87. if (!empty($mail)) {
  88. if (count($mail) > 1) {
  89. echo get_lang('Teachers').' : <ul>';
  90. foreach ($mail as $value => $key) {
  91. foreach ($key as $email => $name) {
  92. echo '<li>'.Display::encrypted_mailto_link($email, $name).'</li>';
  93. }
  94. }
  95. echo '</ul>';
  96. } else {
  97. echo get_lang('Teacher').' : ';
  98. foreach ($mail as $value => $key) {
  99. foreach ($key as $email => $name) {
  100. echo Display::encrypted_mailto_link($email, $name).'<br />';
  101. }
  102. }
  103. }
  104. }
  105. echo '</div>';
  106. }
  107. }
  108. echo '</div>';
  109. echo '</div> <!-- end of #footer -->';
  110. // Test server mode indicator and information for testing purposes.
  111. if (api_is_platform_admin()) {
  112. if (api_get_setting('server_type') == 'test') {
  113. echo '<br /><a href="'.api_get_path(WEB_CODE_PATH).'admin/settings.php?category=Platform#server_type">';
  114. echo '<span style="background-color: white; color: red; border: 1px solid red;">&nbsp;'.get_lang('TestServerMode').'&nbsp;</span></a>';
  115. // @todo page execution time
  116. $mtime = microtime();
  117. $mtime = explode(" ",$mtime);
  118. $mtime = $mtime[1] + $mtime[0];
  119. $endtime = $mtime;
  120. $starttime = $_SESSION['page_start_time_execution'];
  121. $totaltime = ($endtime - $starttime);
  122. $starttime = null;
  123. unset($_SESSION['page_start_time_execution']);
  124. $totaltime = number_format(($totaltime), 4, '.', '');
  125. echo '<h2>'.get_lang('PageExecutionTimeWas').' '.$totaltime.' '.get_lang('Seconds').'</h2>';
  126. unset($_SESSION['page_start_time_execution']);
  127. // Memory usage
  128. echo get_lang('MemoryUsage').': '.number_format((memory_get_usage()/1048576), 3, '.', '') .' Mb' ;
  129. echo '<br />';
  130. echo get_lang('MemoryUsagePeak').': '.number_format((memory_get_peak_usage()/1048576), 3, '.', '').' Mb';
  131. /*
  132. global $_user, $_course;
  133. if (!empty($_user)) {
  134. echo "<h2>Current user info</h2>";
  135. var_dump($_user);
  136. }
  137. if (!empty($_course)) {
  138. echo "<h2>Current course info</h2>";
  139. var_dump($_course);
  140. }*/
  141. }
  142. }
  143. ?>
  144. </body>
  145. </html>