From 6f6692faa771ed420aa876bd99cc1f538fae5d11 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 19 Jan 2010 16:18:32 -0700 Subject: [PATCH] Move *_TEMPLATE define to Horde_Registry_Application:: --- framework/Core/lib/Horde/Registry/Application.php | 9 +++++++++ gollem/lib/Application.php | 7 ------- horde/lib/Application.php | 7 ------- hylax/lib/Application.php | 4 ---- imp/lib/Application.php | 8 -------- kronolith/lib/Application.php | 7 ------- skeleton/lib/Application.php | 7 ------- turba/lib/Application.php | 7 ------- 8 files changed, 9 insertions(+), 47 deletions(-) diff --git a/framework/Core/lib/Horde/Registry/Application.php b/framework/Core/lib/Horde/Registry/Application.php index f76574d12..360caf6c5 100644 --- a/framework/Core/lib/Horde/Registry/Application.php +++ b/framework/Core/lib/Horde/Registry/Application.php @@ -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(); } } diff --git a/gollem/lib/Application.php b/gollem/lib/Application.php index 8409b5c76..f33b24994 100644 --- a/gollem/lib/Application.php +++ b/gollem/lib/Application.php @@ -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'); diff --git a/horde/lib/Application.php b/horde/lib/Application.php index 7f5ab31b3..7bb5a7d6f 100644 --- a/horde/lib/Application.php +++ b/horde/lib/Application.php @@ -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'); } diff --git a/hylax/lib/Application.php b/hylax/lib/Application.php index b7e5e90a0..8ac5ff986 100644 --- a/hylax/lib/Application.php +++ b/hylax/lib/Application.php @@ -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'); diff --git a/imp/lib/Application.php b/imp/lib/Application.php index a8bd8e2f7..96b9e638b 100644 --- a/imp/lib/Application.php +++ b/imp/lib/Application.php @@ -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: *
@@ -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();
diff --git a/kronolith/lib/Application.php b/kronolith/lib/Application.php
index 595fe3660..c5ce69b57 100644
--- a/kronolith/lib/Application.php
+++ b/kronolith/lib/Application.php
@@ -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:
      * 
@@ -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. */
diff --git a/skeleton/lib/Application.php b/skeleton/lib/Application.php
index da356e187..81a33ccb7 100644
--- a/skeleton/lib/Application.php
+++ b/skeleton/lib/Application.php
@@ -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');
diff --git a/turba/lib/Application.php b/turba/lib/Application.php
index 16f5c27f6..22dba104d 100644
--- a/turba/lib/Application.php
+++ b/turba/lib/Application.php
@@ -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:
      * 
@@ -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');
 
-- 
2.11.0