From 6a7d418055e80ddb2ce3dd2168d3c016b90a444d Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 11 Aug 2009 14:52:40 -0600 Subject: [PATCH] Move cacheOutput() into Horde_Registry_Application --- imp/lib/Api.php | 31 ------------------------------- imp/lib/Application.php | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/imp/lib/Api.php b/imp/lib/Api.php index ffa9bf605..d78651afb 100644 --- a/imp/lib/Api.php +++ b/imp/lib/Api.php @@ -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
on enter instead of

. */ - "FCKConfig.EnterMode = 'br';\n" . - 'FCKConfig.ShiftEnterMode = \'p\';', - 'type' => 'text/javascript' - ); - } - } - /* IMP-specific functions. */ /** diff --git a/imp/lib/Application.php b/imp/lib/Application.php index 58e017da4..d26f853be 100644 --- a/imp/lib/Application.php +++ b/imp/lib/Application.php @@ -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
on enter instead of

. */ + "FCKConfig.EnterMode = 'br';\n" . + 'FCKConfig.ShiftEnterMode = \'p\';', + 'type' => 'text/javascript' + ); + } + } + } -- 2.11.0