From: Michael J. Rubinsky Date: Mon, 21 Jun 2010 21:24:32 +0000 (-0400) Subject: Pass the jsuri to hordemap, init the map early so at least the bootstrap X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=4720da3d975429655113a1a2e683ff2bae287d82;p=horde.git Pass the jsuri to hordemap, init the map early so at least the bootstrap file can be cached in the static js file. --- 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);