From 4720da3d975429655113a1a2e683ff2bae287d82 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Mon, 21 Jun 2010 17:24:32 -0400 Subject: [PATCH] Pass the jsuri to hordemap, init the map early so at least the bootstrap file can be cached in the static js file. --- kronolith/index.php | 13 ++++++------- kronolith/lib/Kronolith.php | 5 +++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/kronolith/index.php b/kronolith/index.php index 3d3f0ce13..ed5cfe1a8 100644 --- a/kronolith/index.php +++ b/kronolith/index.php @@ -122,17 +122,16 @@ Horde_Ajax_Imple::factory( 'var' => 'KronolithCore.attendeesAc')) ->attach(); +if ($conf['maps']['driver']) { + Kronolith::initEventMap($conf['maps']); +} + Kronolith::header(); + echo "\n"; + require KRONOLITH_TEMPLATES . '/index/index.inc'; Horde::includeScriptFiles(); Horde::outputInlineScript(); -/* Maps must be initialized after scripts are output, to avoid having them - * included in the monolithic javascript file, which breaks loading the hordemap - * dependencies. */ -if ($conf['maps']['driver']) { - Kronolith::initEventMap($conf['maps']); -} - echo "\n"; diff --git a/kronolith/lib/Kronolith.php b/kronolith/lib/Kronolith.php index d499c116e..c6f2aab80 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -123,7 +123,8 @@ class Kronolith 'markerImage' => (string)Horde_Themes::img('map/marker.png', 'horde'), 'markerBackground' => (string)Horde_Themes::img('map/marker-shadow.png', 'horde'), 'useMarkerLayer' => true, - 'language' => $language); + 'language' => $language, + ); foreach ($params['providers'] as $layer) { switch ($layer) { @@ -153,7 +154,7 @@ class Kronolith break; } } - + $params['jsuri'] = $GLOBALS['registry']->get('jsuri', 'horde') . '/hordemap/'; Horde::addScriptFile('hordemap/map.js', 'horde'); $js = 'HordeMap.initialize(' . Horde_Serialize::serialize($params, HORDE_SERIALIZE::JSON) . ');'; Horde::addinlineScript($js); -- 2.11.0