Move cacheOutput() into Horde_Registry_Application
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 11 Aug 2009 20:52:40 +0000 (14:52 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 11 Aug 2009 20:53:07 +0000 (14:53 -0600)
imp/lib/Api.php
imp/lib/Application.php

index ffa9bf6..d78651a 100644 (file)
@@ -103,37 +103,6 @@ class IMP_Api extends Horde_Registry_Api
         return $credentials;
     }
 
-    /**
-     * Application-specific cache output driver.
-     *
-     * @param array $params  A list of params needed (USED: 'id').
-     *
-     * @return array  See Horde::getCacheUrl().
-     * @throws Horde_Exception
-     */
-    public function cacheOutput($params)
-    {
-        require_once dirname(__FILE__) . '/Application.php';
-        try {
-            new IMP_Application(array('init' => array('authentication' => 'throw')));
-        } catch (Horde_Exception $e) {
-            throw new Horde_Exception('No cache data available');
-        }
-
-        switch ($params['id']) {
-        case 'fckeditor':
-            return array(
-                'data' =>
-                    'FCKConfig.ToolbarSets["ImpToolbar"] = ' . $GLOBALS['prefs']->getValue('fckeditor_buttons') . ";\n" .
-                    /* To more closely match "normal" textarea behavior, send
-                     * send <BR> on enter instead of <P>. */
-                    "FCKConfig.EnterMode = 'br';\n" .
-                    'FCKConfig.ShiftEnterMode = \'p\';',
-                'type' => 'text/javascript'
-            );
-        }
-    }
-
     /* IMP-specific functions. */
 
     /**
index 58e017d..d26f853 100644 (file)
@@ -693,4 +693,36 @@ class IMP_Application extends Horde_Registry_Application
         }
     }
 
+    /* horde/services/cache.php methods. */
+
+    /**
+     * Application-specific cache output driver.
+     *
+     * @param array $params  A list of params needed (USED: 'id').
+     *
+     * @return array  See Horde::getCacheUrl().
+     * @throws Horde_Exception
+     */
+    public function cacheOutput($params)
+    {
+        try {
+            $this->init(array('authentication' => 'throw'));
+        } catch (Horde_Exception $e) {
+            throw new Horde_Exception('No cache data available');
+        }
+
+        switch ($params['id']) {
+        case 'fckeditor':
+            return array(
+                'data' =>
+                    'FCKConfig.ToolbarSets["ImpToolbar"] = ' . $GLOBALS['prefs']->getValue('fckeditor_buttons') . ";\n" .
+                    /* To more closely match "normal" textarea behavior, send
+                     * send <BR> on enter instead of <P>. */
+                    "FCKConfig.EnterMode = 'br';\n" .
+                    'FCKConfig.ShiftEnterMode = \'p\';',
+                'type' => 'text/javascript'
+            );
+        }
+    }
+
 }