Allows addJsLink to be used for non-static Javascript.
[platal.git] / classes / plglobals.php
index f614458..67cd8b8 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -47,7 +47,7 @@ define('DEBUG_SMARTY', 4);
  */
 class PlGlobals
 {
-    public $coreVersion = '0.9.17';
+    public $coreVersion = PLATAL_CORE_VERSION;
 
     /** Debug level.
      * This is a combination of the DEBUG_ flags. As soon as at least
@@ -64,6 +64,20 @@ class PlGlobals
                                // 'r'  => read/only
                                // ''   => site down
 
+    /** Catch-all mode for emails.
+     * If set to a valid email address, all emails from plat/al are sent to
+     * that email address, instead of their normal destination (From:, To:,
+     * and CC: headers are not actually modified).
+     * Note: only valid if restricted_platal is set to true.
+     */
+    public $email_catchall = false;
+
+    /** Tell smarty to check the timestamps of the templates to decide
+     * whether recompile the template or not. If this option is false and
+     * debug mode is not activate, templates won't be recompile if they changed.
+     */
+    public $smarty_autocompile = false;
+
     /** BaseURL of the site.
      * This is read from the HTTP headers if available but you MUST give a
      * default value for this field in you configuration file (because, this
@@ -87,12 +101,24 @@ class PlGlobals
     public $locale;
     public $timezone;
 
+    /** Cookie configuration.
+     */
+    public $cookie_ns = 'ORG';
+    public $cookie_path = '/';
+
+    /** Cache duration for static and dynamic cacheable content generated by
+     * plat/al. Defaults to a week for static content, and an hour for dynamic
+     * content.
+     */
+    public $static_cache_duration = 604800;
+    public $dynamic_cache_duration = 3600;
+
     /** You must give a list of file to load.
      * The filenames given are relatives to the config path of your plat/al installation.
      */
     public function __construct(array $files)
     {
-        $this->spoolroot = dirname(dirname(__FILE__));
+        $this->spoolroot = dirname(dirname(dirname(__FILE__)));
 
         $this->readConfig($files);
         if (isset($_SERVER) && isset($_SERVER['SERVER_NAME'])) {
@@ -104,6 +130,13 @@ class PlGlobals
         $this->setLocale();
     }
 
+    /** Initialiase dynamic data in the object.
+     * This is te place to read data from the database if needed.
+     */
+    public function init()
+    {
+    }
+
     private function readIniFile($filename)
     {
         $array = parse_ini_file($filename, true);