footer.inc.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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 class="push"></div>
  26. </div> <!-- end of #wrapper section -->
  27. <div id="footer"> <!-- start of #footer section -->
  28. <div id="bottom_corner"></div>
  29. <?php
  30. global $_configuration;
  31. echo '<div class="copyright">';
  32. if (api_get_setting('show_administrator_data') == 'true') {
  33. // Platform manager
  34. 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>';
  35. }
  36. echo get_lang('Platform'), ' <a href="', $_configuration['software_url'], '" target="_blank">', $_configuration['software_name'], ' ', $_configuration['system_version'], '</a> &copy; ', date('Y');
  37. echo '</div>'; //copyright div
  38. echo '<div class="footer_emails">';
  39. /* Plugins for footer section */
  40. echo '<div id="plugin-footer">';
  41. api_plugin('footer');
  42. echo '</div>';
  43. if (api_get_setting('show_tutor_data') == 'true') {
  44. // Course manager
  45. $id_course = api_get_course_id();
  46. $id_session = api_get_session_id();
  47. if (isset($id_course) && $id_course != -1) {
  48. echo '<div id="platformmanager">';
  49. if ($id_session != 0){
  50. $coachs_email = CourseManager::get_email_of_tutor_to_session($id_session, $id_course);
  51. $email_link = array();
  52. foreach ($coachs_email as $coach_email) {
  53. foreach ($coach_email as $email => $username) {
  54. $email_link[] = Display::encrypted_mailto_link($email, $username);
  55. }
  56. }
  57. if (count($coachs_email) > 1) {
  58. $bar = '<br />';
  59. echo get_lang('Coachs').' : <ul>';
  60. echo '<li>'.implode("<li>", $email_link);
  61. echo '</ul>';
  62. } elseif (count($coachs_email) == 1) {
  63. echo get_lang('Coach').' : ';
  64. echo implode("&nbps;", $email_link);
  65. } elseif (count($coachs_email) == 0) {
  66. echo '';
  67. }
  68. }
  69. echo '</div>';
  70. }
  71. echo '<br>';
  72. }
  73. echo '<div style="clear:both"></div>';
  74. $class = '';
  75. if (api_get_setting('show_teacher_data') == 'true') {
  76. if (api_get_setting('show_tutor_data') == 'false') {
  77. $class = 'platformmanager';
  78. } else {
  79. $class = 'coursemanager';
  80. }
  81. // course manager
  82. $id_course = api_get_course_id();
  83. if (isset($id_course) && $id_course != -1) {
  84. echo '<div id="'.$class.'">';
  85. $mail = CourseManager::get_emails_of_tutors_to_course($id_course);
  86. if (!empty($mail)) {
  87. if (count($mail) > 1) {
  88. echo get_lang('Teachers').' : <ul>';
  89. foreach ($mail as $value => $key) {
  90. foreach ($key as $email => $name) {
  91. echo '<li>'.Display::encrypted_mailto_link($email, $name).'</li>';
  92. }
  93. }
  94. echo '</ul>';
  95. } else {
  96. echo get_lang('Teacher').' : ';
  97. foreach ($mail as $value => $key) {
  98. foreach ($key as $email => $name) {
  99. echo Display::encrypted_mailto_link($email, $name).'<br />';
  100. }
  101. }
  102. }
  103. }
  104. echo '</div>';
  105. }
  106. }
  107. echo '</div>';
  108. echo '</div> <!-- end of #footer -->';
  109. // Test server mode indicator and information for testing purposes.
  110. if (api_is_platform_admin()) {
  111. if (api_get_setting('server_type') == 'test') {
  112. echo '<br /><a href="'.api_get_path(WEB_CODE_PATH).'admin/settings.php?category=Platform#server_type">';
  113. echo '<span style="background-color: white; color: red; border: 1px solid red;">&nbsp;'.get_lang('TestServerMode').'&nbsp;</span></a>';
  114. // @todo page execution time
  115. $mtime = microtime();
  116. $mtime = explode(" ",$mtime);
  117. $mtime = $mtime[1] + $mtime[0];
  118. $endtime = $mtime;
  119. $starttime = $_SESSION['page_start_time_execution'];
  120. $totaltime = ($endtime - $starttime);
  121. $starttime = null;
  122. unset($_SESSION['page_start_time_execution']);
  123. $totaltime = number_format(($totaltime), 4, '.', '');
  124. echo '<h2>'.get_lang('PageExecutionTimeWas').' '.$totaltime.' '.get_lang('Seconds').'</h2>';
  125. unset($_SESSION['page_start_time_execution']);
  126. // Memory usage
  127. echo get_lang('MemoryUsage').': '.number_format((memory_get_usage()/1048576), 3, '.', '') .' Mb' ;
  128. echo '<br />';
  129. echo get_lang('MemoryUsagePeak').': '.number_format((memory_get_peak_usage()/1048576), 3, '.', '').' Mb';
  130. /*
  131. global $_user, $_course;
  132. if (!empty($_user)) {
  133. echo "<h2>Current user info</h2>";
  134. var_dump($_user);
  135. }
  136. if (!empty($_course)) {
  137. echo "<h2>Current course info</h2>";
  138. var_dump($_course);
  139. }*/
  140. }
  141. }
  142. ?>
  143. </body>
  144. </html>