[ Index ]
 

Code source de Horde 3.1.3

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/services/ -> javascript.php (source)

   1  <?php
   2  /**
   3   * $Horde: horde/services/javascript.php,v 1.37.10.4 2006/01/01 21:29:10 jan Exp $
   4   *
   5   * Copyright 2000-2006 Charles J. Hagenbuch <chuck@horde.org>
   6   *
   7   * See the enclosed file COPYING for license information (LGPL). If you
   8   * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
   9   */
  10  
  11  @define('HORDE_BASE', dirname(__FILE__) . '/..');
  12  require_once  HORDE_BASE . '/lib/core.php';
  13  
  14  $registry = &Registry::singleton(HORDE_SESSION_READONLY);
  15  
  16  // Figure out if we've been inlined, or called directly.
  17  $send_headers = strstr($_SERVER['PHP_SELF'], 'javascript.php');
  18  
  19  $app = Util::getFormData('app', Util::nonInputVar('app'));
  20  $file = Util::getFormData('file', Util::nonInputVar('file'));
  21  if (!empty($app) && !empty($file) && strpos($file, '..') === false) {
  22      $script_file = $registry->get('templates', $app) . '/javascript/' . $file;
  23      if (@file_exists($script_file)) {
  24          $registry->pushApp($app, false);
  25          $script = Util::bufferOutput('require', $script_file);
  26  
  27          if ($send_headers) {
  28              /* Compress the JS. We need this explicit call since we
  29               * don't include base.php in this file. */
  30              Horde::compressOutput();
  31  
  32              header('Cache-Control: no-cache');
  33              header('Content-Type: text/javascript');
  34          }
  35  
  36          echo $script;
  37      }
  38  }


Généré le : Sun Feb 25 18:01:28 2007 par Balluche grâce à PHPXref 0.7