Include Imples before headers so the required js can be included in
authorMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 21 Jun 2010 15:44:37 +0000 (11:44 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 21 Jun 2010 15:45:45 +0000 (11:45 -0400)
the monolithic js file if using the js cache.

kronolith/index.php

index d7be368..3d3f0ce 100644 (file)
@@ -96,14 +96,6 @@ foreach ($injector->getInstance('Horde_Alarm')->handlers() as $method => $handle
     $taskAlarmParams = substr($taskAlarmParams, 0, - 6) . '</div>';
 }
 
-Kronolith::header();
-echo "<body class=\"kronolithAjax\">\n";
-require KRONOLITH_TEMPLATES . '/index/index.inc';
-Horde::includeScriptFiles();
-Horde::outputInlineScript();
-if ($conf['maps']['driver']) {
-    Kronolith::initEventMap($conf['maps']);
-}
 Horde_Ajax_Imple::factory(
     array('kronolith', 'TagAutoCompleter'),
     array('triggerId' => 'kronolithEventTags',
@@ -130,4 +122,17 @@ Horde_Ajax_Imple::factory(
           'var' => 'KronolithCore.attendeesAc'))
     ->attach();
 
+Kronolith::header();
+echo "<body class=\"kronolithAjax\">\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 "</body>\n</html>";