home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / groupoffice-com-2.01 / modules / cms / template_file.php < prev    next >
PHP Script  |  2004-03-08  |  922b  |  30 lines

  1. <?php
  2. /*
  3. Copyright Intermesh 2003
  4. Author: Merijn Schering <mschering@intermesh.nl>
  5. Version: 1.0 Release date: 08 July 2003
  6.  
  7. This program is free software; you can redistribute it and/or modify it
  8. under the terms of the GNU General Public License as published by the
  9. Free Software Foundation; either version 2 of the License, or (at your
  10. option) any later version.
  11. */
  12. require("../../Group-Office.php");
  13.  
  14. require($GO_CONFIG->class_path.'filetypes.class.inc');
  15. require($GO_CONFIG->class_path.'cms.class.inc');
  16. $cms = new cms();
  17. $filetypes = new filetypes();
  18.  
  19. if ($file = $cms->get_template_file($_REQUEST['template_file_id']))
  20. {
  21.     $browser = detect_browser();
  22.  
  23.     header("Cache-Control: max-age=2592000\n");
  24.     header("Content-Disposition: filename=".$file['name']."\n");
  25.     header('Content-Type: '.$file['content_type']);
  26.     header('Content-Transfer-Encoding: binary');
  27.     echo $file['content'];
  28.     exit();
  29. }
  30. ?>