Fix embedding imple and URL generation for use with new Horde_Ajax
authorMichael J. Rubinsky <mrubinsk@horde.org>
Wed, 29 Jul 2009 00:56:16 +0000 (20:56 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Wed, 29 Jul 2009 00:56:16 +0000 (20:56 -0400)
kronolith/lib/Ajax/Imple/Embed.php
kronolith/lib/Kronolith.php

index b830167..03b5d85 100644 (file)
@@ -17,6 +17,11 @@ class Kronolith_Ajax_Imple_Embed extends Horde_Ajax_Imple_Base
     {
     }
 
+    public function getUrl()
+    {
+        return $this->_getUrl('Embed', 'kronolith', $this->_params, true);
+    }
+
     /**
      * Handles the output of the embedded widget. This must always be valid
      * javascript.
@@ -27,8 +32,9 @@ class Kronolith_Ajax_Imple_Embed extends Horde_Ajax_Imple_Base
      *   calendar  => the share_name for the requested calendar
      *
      * The following are optional (and are not used for all views)
-     *   months     => the number of months to include
+     *   months        => the number of months to include
      *   maxevents     => the maximum number of events to show
+     * </pre>
      *
      * @param array $args  Arguments for this view.
      */
index 768656e..964cb40 100644 (file)
@@ -1398,7 +1398,13 @@ class Kronolith
     public static function embedCode($calendar)
     {
         /* Get the base url */
-        $url = Horde::applicationURL('imple.php', true, -1);
+        $imple = Horde_Ajax_Imple::factory(array('kronolith', 'Embed'),
+                                           array('container' => 'kronolithCal',
+                                                 'view' => 'month',
+                                                 'calendar' => $calendar));
+
+
+        $url = $imple->getUrl();
 
         $html = '<div id="kronolithCal"></div><script src="' . $url
             . '?imple=Embed/container=kronolithCal/view=month/calendar='