Move chunkContent() to Horde_Ajax_Application_Base.
authorJan Schneider <jan@horde.org>
Thu, 11 Mar 2010 10:11:11 +0000 (11:11 +0100)
committerJan Schneider <jan@horde.org>
Thu, 11 Mar 2010 14:26:42 +0000 (15:26 +0100)
framework/Ajax/lib/Horde/Ajax/Application/Base.php
kronolith/lib/Ajax/Application.php

index d81aea7..3421116 100644 (file)
@@ -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;
+    }
+
 }
index 457727a..58ecaed 100644 (file)
@@ -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.
      *