[ Index ]

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

title

Body

[close]

/lib/ -> javascript-mod.php (source)

   1  <?php  /// $Id: javascript-mod.php,v 1.1 2005/04/16 12:10:44 moodler Exp $
   2  
   3         /// Searches modules, filters and blocks for any Javascript files
   4         /// that should be called on every page
   5  
   6      $nomoodlecookie = true;
   7  
   8      include ('../config.php');
   9  
  10      $output = "// Javascript from Moodle modules\n";
  11  
  12      if ($mods = get_list_of_plugins('mod')) {
  13          foreach ($mods as $mod) {
  14              if (is_readable($CFG->dirroot.'/mod/'.$mod.'/javascript.php')) {
  15                  $output .= file_get_contents($CFG->dirroot.'/mod/'.$mod.'/javascript.php');
  16              }
  17          }
  18      }
  19  
  20      if ($filters = get_list_of_plugins('filter')) {
  21          foreach ($filters as $filter) {
  22              if (is_readable($CFG->dirroot.'/filter/'.$filter.'/javascript.php')) {
  23                  $output .= file_get_contents($CFG->dirroot.'/filter/'.$filter.'/javascript.php');
  24              }
  25          }
  26      }
  27  
  28      if ($blocks = get_list_of_plugins('blocks')) {
  29          foreach ($blocks as $block) {
  30              if (is_readable($CFG->dirroot.'/blocks/'.$block.'/javascript.php')) {
  31                  $output .= file_get_contents($CFG->dirroot.'/blocks/'.$block.'/javascript.php');
  32              }
  33          }
  34      }
  35  
  36  
  37      $lifetime = '86400';
  38  
  39      @header('Content-type: text/javascript'); 
  40      @header('Content-length: '.strlen($output)); 
  41      @header('Last-Modified: '. gmdate('D, d M Y H:i:s', time()) .' GMT');
  42      @header('Cache-control: max-age='.$lifetime);
  43      @header('Expires: '. gmdate('D, d M Y H:i:s', time() + $lifetime) .'GMT');
  44      @header('Pragma: ');
  45  
  46      echo $output;
  47  
  48  ?>


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