[ Index ]

PHP Cross Reference of Moodle 1.9.3 [Build 15-Oct-2008]

title

Body

[close]

/mod/data/ -> js.php (source)

   1  <?php
   2  ///////////////////////////////////////////////////////////////////////////
   3  //                                                                       //
   4  // NOTICE OF COPYRIGHT                                                   //
   5  //                                                                       //
   6  // Moodle - Modular Object-Oriented Dynamic Learning Environment         //
   7  //          http://moodle.org                                            //
   8  //                                                                       //
   9  // Copyright (C) 2005 Martin Dougiamas  http://dougiamas.com             //
  10  //                                                                       //
  11  // This program is free software; you can redistribute it and/or modify  //
  12  // it under the terms of the GNU General Public License as published by  //
  13  // the Free Software Foundation; either version 2 of the License, or     //
  14  // (at your option) any later version.                                   //
  15  //                                                                       //
  16  // This program is distributed in the hope that it will be useful,       //
  17  // but WITHOUT ANY WARRANTY; without even the implied warranty of        //
  18  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         //
  19  // GNU General Public License for more details:                          //
  20  //                                                                       //
  21  //          http://www.gnu.org/copyleft/gpl.html                         //
  22  //                                                                       //
  23  ///////////////////////////////////////////////////////////////////////////
  24  
  25      $lifetime  = 600;                                   // Seconds to cache this stylesheet
  26      $nomoodlecookie = true;                             // Cookies prevent caching, so don't use them
  27  
  28      require_once('../../config.php');
  29  
  30      $d = optional_param('d', 0, PARAM_INT);   // database id
  31  
  32      if ($data = get_record('data', 'id', $d)) {
  33          header('Last-Modified: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
  34          header('Expires: ' . gmdate("D, d M Y H:i:s", time() + $lifetime) . ' GMT');
  35          header('Cache-control: max_age = '. $lifetime);
  36          header('Pragma: ');
  37          header('Content-type: text/css');  // Correct MIME type
  38  
  39          echo $data->jstemplate;
  40      }


Generated: Wed Jan 14 11:33:29 2009 Cross-referenced by PHPXref 0.7