Move *_TEMPLATE define to Horde_Registry_Application::
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 19 Jan 2010 23:18:32 +0000 (16:18 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 19 Jan 2010 23:18:32 +0000 (16:18 -0700)
framework/Core/lib/Horde/Registry/Application.php
gollem/lib/Application.php
horde/lib/Application.php
hylax/lib/Application.php
imp/lib/Application.php
kronolith/lib/Application.php
skeleton/lib/Application.php
turba/lib/Application.php

index f76574d..360caf6 100644 (file)
@@ -60,11 +60,20 @@ class Horde_Registry_Application
     /**
      * Initialization. Does any necessary init needed to setup the full
      * environment for the application.
+     *
+     * Global constants defined:
+     *   [APPNAME]_TEMPLATES - (string) Location of template files.
      */
     public function init()
     {
         if (!$this->_initDone) {
             $this->_initDone = true;
+
+            $appname = Horde_String::upper($GLOBALS['registry']->getApp());
+            if (!defined($appname . '_TEMPLATES')) {
+                define($appname . '_TEMPLATES', $GLOBALS['registry']->get('templates'));
+            }
+
             $this->_init();
         }
     }
index 8409b5c..f33b249 100644 (file)
@@ -50,16 +50,9 @@ class Gollem_Application extends Horde_Registry_Application
      *   $gollem_be - A link to the current backend parameters in the session
      *   $gollem_vfs - A link to the current VFS object for the active backend
      *   $notification - Notification object
-     *
-     * Global constants defined:
-     *   GOLLEM_TEMPLATES - (string) Location of template files.
      */
     protected function _init()
     {
-        if (!defined('GOLLEM_TEMPLATES')) {
-            define('GOLLEM_TEMPLATES', $GLOBALS['registry']->get('templates'));
-        }
-
         // Notification system.
         $GLOBALS['notification'] = Horde_Notification::singleton();
         $GLOBALS['notification']->attach('status');
index 7f5ab31..7bb5a7d 100644 (file)
@@ -29,16 +29,9 @@ class Horde_Application extends Horde_Registry_Application
      *
      * Global variables defined:
      *   $notification - Notification object
-     *
-     * Global constants defined:
-     *   HORDE_TEMPLATES - (string) Location of template files.
      */
     protected function _init()
     {
-        if (!defined('HORDE_TEMPLATES')) {
-            define('HORDE_TEMPLATES', $GLOBALS['registry']->get('templates'));
-        }
-
         $GLOBALS['notification'] = Horde_Notification::singleton();
         $GLOBALS['notification']->attach('status');
     }
index b7e5e90..8ac5ff9 100644 (file)
@@ -38,10 +38,6 @@ class Hylax_Application extends Horde_Registry_Application
 
     protected function _init()
     {
-        if (!defined('HYLAX_TEMPLATES')) {
-            define('HYLAX_TEMPLATES', $GLOBALS['registry']->get('templates'));
-        }
-
         /* Notification system. */
         $notification = Horde_Notification::singleton();
         $notification->attach('status');
index a8bd8e2..96b9e63 100644 (file)
@@ -89,9 +89,6 @@ class IMP_Application extends Horde_Registry_Application
      *   $imp_search   - An IMP_Search object
      *   $notification - Notification object
      *
-     * Global constants defined:
-     *   IMP_TEMPLATES - (string) Location of template files.
-     *
      * When calling Horde_Registry::appInit(), the following parameters are
      * also supported:
      * <pre>
@@ -104,11 +101,6 @@ class IMP_Application extends Horde_Registry_Application
             Horde_Nls::setTimeZone();
         }
 
-        if (!defined('IMP_TEMPLATES')) {
-            $registry = Horde_Registry::singleton();
-            define('IMP_TEMPLATES', $registry->get('templates'));
-        }
-
         // Initialize global $imp_imap object.
         if (!isset($GLOBALS['imp_imap'])) {
             $GLOBALS['imp_imap'] = new IMP_Imap();
index 595fe36..c5ce69b 100644 (file)
@@ -47,9 +47,6 @@ class Kronolith_Application extends Horde_Registry_Application
      *   $kronolith_shares - TODO
      *   $notification - Notification object
      *
-     * Global constants defined:
-     *   KRONOLITH_TEMPLATES - (string) Location of template files.
-     *
      * When calling Horde_Registry::appInit(), the following parameters are
      * also supported:
      * <pre>
@@ -62,10 +59,6 @@ class Kronolith_Application extends Horde_Registry_Application
             Horde_Auth::setAuth($this->initParams['user'], array());
         }
 
-        if (!defined('KRONOLITH_TEMPLATES')) {
-            define('KRONOLITH_TEMPLATES', $GLOBALS['registry']->get('templates'));
-        }
-
         /* For now, autoloading the Content_* classes depend on there being a
          * registry entry for the 'content' application that contains at least
          * the fileroot entry. */
index da356e1..81a33cc 100644 (file)
@@ -44,16 +44,9 @@ class Skeleton_Application extends Horde_Registry_Application
      *
      * Global variables defined:
      *   $notification - Notification object
-     *
-     * Global constants defined:
-     *   SKELETON_TEMPLATES - (string) Location of template files.
      */
     protected function _init()
     {
-        if (!defined('SKELETON_TEMPLATES')) {
-            define('SKELETON_TEMPLATES', $GLOBALS['registry']->get('templates'));
-        }
-
         // Notification system.
         $notification = Horde_Notification::singleton();
         $notification->attach('status');
index 16f5c27..22dba10 100644 (file)
@@ -53,9 +53,6 @@ class Turba_Application extends Horde_Registry_Application
      *   $notification - Notification object
      *   $turba_shares - TODO
      *
-     * Global constants defined:
-     *   TURBA_TEMPLATES - (string) Location of template files.
-     *
      * When calling Horde_Registry::appInit(), the following parameters are
      * also supported:
      * <pre>
@@ -68,10 +65,6 @@ class Turba_Application extends Horde_Registry_Application
             Horde_Auth::setAuth($this->initParams['user'], array());
         }
 
-        if (!defined('TURBA_TEMPLATES')) {
-            define('TURBA_TEMPLATES', $GLOBALS['registry']->get('templates'));
-        }
-
         $GLOBALS['notification'] = Horde_Notification::singleton();
         $GLOBALS['notification']->attach('status');