load.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <?php
  2. /*
  3. ----------------------------------------------------------------------
  4. Dokeos - elearning and course management software
  5. Copyright (c) 2004 Dokeos S.A.
  6. Copyright (c) Denes Nagy (darkden@freemail.hu)
  7. For a full list of contributors, see "credits.txt".
  8. The full license can be read in "license.txt".
  9. This program is free software; you can redistribute it and/or
  10. modify it under the terms of the GNU General Public License
  11. as published by the Free Software Foundation; either version 2
  12. of the License, or (at your option) any later version.
  13. See the GNU General Public License for more details.
  14. Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
  15. ----------------------------------------------------------------------
  16. */
  17. /**
  18. ==============================================================================
  19. * This file is the buttons menu that allows going forward-backward in the
  20. * SCORM sequence. It is independent from the current element viewed.
  21. * @package dokeos.scorm
  22. ==============================================================================
  23. //this file loads in when the whole content is loaded, and does not refresh while in operaion !
  24. */
  25. //error_log($_SERVER['REQUEST_URI'],0);
  26. $time=time();
  27. $langFile = "scorm";
  28. include('../inc/global.inc.php');
  29. $this_section=SECTION_COURSES;
  30. header('Content-Type: text/html; charset='. $charset);
  31. $indexRoute = $_REQUEST['indexRoute'];
  32. $file = $_REQUEST['file'];
  33. // Check if the requested file is in the right location (scorm folder in course directory and no .. in the path)
  34. $file_path = api_get_path(SYS_COURSE_PATH).$_course['path'].'/scorm';
  35. if(substr($file,0,strlen($file_path)) != $file_path || strpos($file,'..') > 0)
  36. {
  37. api_not_allowed();
  38. }
  39. $edoceo = $_REQUEST['edoceo'];
  40. $openDir = $_REQUEST['openDir'];
  41. $backurl = $_REQUEST['backurl'];
  42. $fs = $_REQUEST['fs'];
  43. $who=$_user ['firstName']." ".$_user ['lastName'];
  44. $RequestUri = GetbackURL($_SERVER["REQUEST_URI"]);
  45. ?>
  46. <html>
  47. <head>
  48. <link rel="stylesheet" type="text/css" href="../css/scorm.css">
  49. </head>
  50. <body>
  51. <form action="contents.php<?php echo "?file=$file&openDir=".urlencode($openDir)."&edoceo=$edoceo&time=$time"; ?>" method="post" target="contents" name='theform'>
  52. <table cellpadding='0' cellspacing='0' align='left'><tr><td><font color='white'><div align='left' style='margin-left: 0.5em'>
  53. <a href="contents.php?menu=my_status&file=<?php echo "$file&openDir=$openDir&edoceo=$edoceo&time=$time&fs=$fs"; ?>#statustable" target="sco"><img border="0" src="../img/scormstatus.gif" title="<?php echo get_lang('ScormMystatus'); ?>"></a> &nbsp;&nbsp;
  54. <a href="javascript:document.theform.menu.value='prev';document.theform.submit();"><img border="0" src="../img/previous.gif" title="<?php echo get_lang('ScormPrevious'); ?>"></a>
  55. &nbsp;&nbsp;
  56. <a href="javascript:document.theform.menu.value='next';document.theform.submit();"><img border="0" src="../img/next.gif" title="<?php echo get_lang('ScormNext'); ?>"></a>
  57. &nbsp;&nbsp;
  58. <a href="javascript:document.theform.menu.value='restart';document.theform.submit();"><img border="0" src="../img/scormrestart.jpg" title="<?php echo get_lang('ScormRestart'); ?>"></a>
  59. &nbsp;&nbsp;
  60. <?php
  61. if (isset($_GET["fs"]))
  62. {
  63. if(strcmp($_GET["fs"],"true")==0)
  64. {
  65. ?>
  66. <a href="<?php echo $RequestUri."&fs=false"; ?>" target='_top'><img border="0" src="../img/scormexitfullscreen.jpg" title="<?php echo get_lang('ScormExitFullScreen'); ?>"></a>
  67. &nbsp;&nbsp;
  68. <?php
  69. }
  70. else
  71. {
  72. ?>
  73. <a href="<?php echo $RequestUri."&fs=true"; ?>" target='_top'><img border="0" src="../img/scormfullscreen.jpg" title="<?php echo get_lang('ScormFullScreen'); ?>"></a>
  74. &nbsp;&nbsp;
  75. <?php
  76. }
  77. }
  78. else
  79. {
  80. ?>
  81. <a href="<?php echo $RequestUri."&fs=true"; ?>" target='_top'><img border="0" src="../img/scormfullscreen.jpg" title="<?php echo get_lang('ScormFullScreen'); ?>"></a>
  82. &nbsp;&nbsp;
  83. <?php
  84. }
  85. // functions
  86. // get backurl from $_SERVER["REQUEST_URI"]
  87. function GetbackURL($path)
  88. {
  89. $url = explode('backurl=',$path);
  90. $url = explode('showinframes.php?',$url[1]);
  91. return ClearbackURL("showinframes.php?".$url[1]);
  92. }
  93. // cut "&fs=true"
  94. function ClearbackURL($path)
  95. {
  96. $url = explode('&fs=',$path);
  97. return $url[0];
  98. }
  99. ?>
  100. </font></div></td></tr></table>
  101. <input type='hidden' name='menu' value='init' />
  102. </form>
  103. <?php
  104. api_session_unregister('s_href');
  105. //api_session_unregister('s_identifier');
  106. ?>
  107. </body>
  108. </html>