showinframes.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?php // $Id: showinframes.php 9246 2006-09-25 13:24:53Z bmol $
  2. /*
  3. ==============================================================================
  4. Dokeos - elearning and course management software
  5. Copyright (c) 2004 Dokeos S.A.
  6. Copyright (c) 2003 Ghent University (UGent)
  7. Copyright (c) 2001 Universite catholique de Louvain (UCL)
  8. Copyright (c) Hugues Peeters
  9. Copyright (c) Roan Embrechts
  10. For a full list of contributors, see "credits.txt".
  11. The full license can be read in "license.txt".
  12. This program is free software; you can redistribute it and/or
  13. modify it under the terms of the GNU General Public License
  14. as published by the Free Software Foundation; either version 2
  15. of the License, or (at your option) any later version.
  16. See the GNU General Public License for more details.
  17. Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
  18. Mail: info@dokeos.com
  19. ==============================================================================
  20. */
  21. /**
  22. ==============================================================================
  23. * This file will show documents in a separate frame.
  24. * We don't like frames, but it was the best of two bad things.
  25. *
  26. * display html files within Dokeos - html files have the Dokeos header.
  27. *
  28. * --- advantages ---
  29. * users "feel" like they are in Dokeos,
  30. * and they can use the navigation context provided by the header.
  31. *
  32. * --- design ---
  33. * a file gets a parameter (an html file)
  34. * and shows
  35. * - dokeos header
  36. * - html file from parameter
  37. * - (removed) dokeos footer
  38. *
  39. * @version 0.6
  40. * @author Roan Embrechts (roan.embrechts@vub.ac.be)
  41. * @package dokeos.document
  42. ==============================================================================
  43. */
  44. /*
  45. ==============================================================================
  46. DOKEOS INIT
  47. ==============================================================================
  48. */
  49. include('../inc/global.inc.php');
  50. $interbreadcrumb[]= array ("url"=>"./document.php", "name"=> get_lang("Documents"));
  51. $nameTools = get_lang("Documents");
  52. $file = $_GET['file'];
  53. /*
  54. ==============================================================================
  55. Main section
  56. ==============================================================================
  57. */
  58. header('Expires: Wed, 01 Jan 1990 00:00:00 GMT');
  59. //header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
  60. header('Last-Modified: Wed, 01 Jan 2100 00:00:00 GMT');
  61. header('Cache-Control: no-cache, must-revalidate');
  62. header('Pragma: no-cache');
  63. $browser_display_title = "Dokeos Documents - " . $_GET['cidReq'] . " - " . $_GET['file'];
  64. //only admins get to see the "no frames" link in pageheader.php, so students get a header that's not so high
  65. $frameheight = 120;
  66. if($is_courseAdmin)
  67. {
  68. $frameheight = 150;
  69. }
  70. ?>
  71. <html>
  72. <head>
  73. <title><?php echo $browser_display_title;?></title>
  74. </head>
  75. <frameset rows="<?php echo $frameheight; ?>,*" border="0" frameborder="no" >
  76. <frame name="top" scrolling="no" noresize target="contents" src="headerpage.php?file=<?php echo urlencode($_GET['file']); ?>">
  77. <frame name="main" src="<?php echo api_get_path('WEB_COURSE_PATH').$_course['path'].'/document'.str_replace('%2F', '/',urlencode($_GET['file'])).'?'.api_get_cidreq().'&rand='.mt_rand(1,10000); ?>">
  78. <noframes>
  79. <body>
  80. <p>This page uses frames, but your browser doesn't support them.<br/>
  81. We suggest you try Mozilla, Firefox, Safari, Opera, or other browsers updated this millenium.</p>
  82. </body>
  83. </noframes>
  84. </frameset>
  85. </html>