From: Jan Schneider Date: Thu, 11 Mar 2010 10:11:11 +0000 (+0100) Subject: Move chunkContent() to Horde_Ajax_Application_Base. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=572c4e4172094984bac797af145dc9cc3377b72e;p=horde.git Move chunkContent() to Horde_Ajax_Application_Base. --- diff --git a/framework/Ajax/lib/Horde/Ajax/Application/Base.php b/framework/Ajax/lib/Horde/Ajax/Application/Base.php index d81aea72e..342111665 100644 --- a/framework/Ajax/lib/Horde/Ajax/Application/Base.php +++ b/framework/Ajax/lib/Horde/Ajax/Application/Base.php @@ -142,4 +142,21 @@ abstract class Horde_Ajax_Application_Base return $result; } + /** + * Loads a chunk of PHP code (usually an HTML template) from the + * application's templates directory. + * + * @return string A chunk of PHP output. + */ + public function chunkContent() + { + $chunk = basename(Horde_Util::getPost('chunk')); + $result = new stdClass; + if (!empty($chunk)) { + $result->chunk = Horde_Util::bufferOutput('include', $GLOBALS['registry']->get('templates', $this->_app) . '/chunks/' . $chunk . '.php'); + } + + return $result; + } + } diff --git a/kronolith/lib/Ajax/Application.php b/kronolith/lib/Ajax/Application.php index 457727ab6..58ecaedbe 100644 --- a/kronolith/lib/Ajax/Application.php +++ b/kronolith/lib/Ajax/Application.php @@ -709,18 +709,6 @@ class Kronolith_Ajax_Application extends Horde_Ajax_Application_Base return false; } - public function chunkContent() - { - $chunk = basename(Horde_Util::getPost('chunk')); - $result = new stdClass; - if (!empty($chunk)) { - $result->chunk = Horde_Util::bufferOutput('include', KRONOLITH_TEMPLATES . '/chunks/' . $chunk . '.php'); - } - - return $result; - } - - /** * Returns the driver object for a calendar. *