From 6b13a43c67be3fde40af956154f44ba42f153870 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Tue, 28 Jul 2009 20:56:16 -0400 Subject: [PATCH] Fix embedding imple and URL generation for use with new Horde_Ajax --- kronolith/lib/Ajax/Imple/Embed.php | 8 +++++++- kronolith/lib/Kronolith.php | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/kronolith/lib/Ajax/Imple/Embed.php b/kronolith/lib/Ajax/Imple/Embed.php index b8301679d..03b5d85dc 100644 --- a/kronolith/lib/Ajax/Imple/Embed.php +++ b/kronolith/lib/Ajax/Imple/Embed.php @@ -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 + * * * @param array $args Arguments for this view. */ diff --git a/kronolith/lib/Kronolith.php b/kronolith/lib/Kronolith.php index 768656ede..964cb408d 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -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 = '