Move this method.
authorJan Schneider <jan@horde.org>
Tue, 20 Jul 2010 20:33:05 +0000 (22:33 +0200)
committerJan Schneider <jan@horde.org>
Mon, 26 Jul 2010 21:34:07 +0000 (23:34 +0200)
kronolith/lib/Kronolith.php

index 16172df..ec1da44 100644 (file)
@@ -101,67 +101,6 @@ class Kronolith
     }
 
     /**
-     * Initialize the event map.
-     *
-     * @param array $params Parameters to pass the the map
-     *
-     * @return void
-     */
-    public static function initEventMap($params)
-    {
-        // Add the apikeys
-        if (!empty($params['providers'])) {
-            /* It is safe to put configuration specific to horde driver inside
-            this block since horde driver *must* contain a provider array */
-
-            // Language specific file needed?
-            //$language = str_replace('_', '-', $GLOBALS['language']);
-            $language = $GLOBALS['language'];
-            if (!file_exists($GLOBALS['registry']->get('jsfs', 'horde') . '/hordemap/' . $language . '.js')) {
-                $language = 'en-US';
-            }
-            $params['conf'] = array(
-                'markerImage' => (string)Horde_Themes::img('map/marker.png', 'horde'),
-                'markerBackground' => (string)Horde_Themes::img('map/marker-shadow.png', 'horde'),
-                'useMarkerLayer' => true,
-                'language' => $language,
-            );
-
-            foreach ($params['providers'] as $layer) {
-                switch ($layer) {
-                case 'Google':
-                    $params['conf']['apikeys']['google'] = $GLOBALS['conf']['api']['googlemaps'];
-                    break;
-                case 'Yahoo':
-                    $params['conf']['apikeys']['yahoo'] = $GLOBALS['conf']['api']['yahoomaps'];
-                    break;
-                case 'Cloudmade':
-                    $params['conf']['apikeys']['cloudmade'] = $GLOBALS['conf']['api']['cloudmade'];
-                    break;
-                }
-            }
-        }
-
-        if (!empty($params['geocoder'])) {
-            switch ($params['geocoder']) {
-            case 'Google':
-                $params['conf']['apikeys']['google'] = $GLOBALS['conf']['api']['googlemaps'];
-                break;
-            case 'Yahoo':
-                $params['conf']['apikeys']['yahoo'] = $GLOBALS['conf']['api']['yahoomaps'];
-                break;
-            case 'Cloudmade':
-                $params['conf']['apikeys']['cloudmade'] = $GLOBALS['conf']['api']['cloudmade'];
-                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);
-    }
-
-    /**
      * Outputs the javascript code which defines all javascript variables
      * that are dependent on the local user's account.
      *
@@ -1238,6 +1177,67 @@ class Kronolith
     }
 
     /**
+     * Initialize the event map.
+     *
+     * @param array $params Parameters to pass the the map
+     *
+     * @return void
+     */
+    public static function initEventMap($params)
+    {
+        // Add the apikeys
+        if (!empty($params['providers'])) {
+            /* It is safe to put configuration specific to horde driver inside
+            this block since horde driver *must* contain a provider array */
+
+            // Language specific file needed?
+            //$language = str_replace('_', '-', $GLOBALS['language']);
+            $language = $GLOBALS['language'];
+            if (!file_exists($GLOBALS['registry']->get('jsfs', 'horde') . '/hordemap/' . $language . '.js')) {
+                $language = 'en-US';
+            }
+            $params['conf'] = array(
+                'markerImage' => (string)Horde_Themes::img('map/marker.png', 'horde'),
+                'markerBackground' => (string)Horde_Themes::img('map/marker-shadow.png', 'horde'),
+                'useMarkerLayer' => true,
+                'language' => $language,
+            );
+
+            foreach ($params['providers'] as $layer) {
+                switch ($layer) {
+                case 'Google':
+                    $params['conf']['apikeys']['google'] = $GLOBALS['conf']['api']['googlemaps'];
+                    break;
+                case 'Yahoo':
+                    $params['conf']['apikeys']['yahoo'] = $GLOBALS['conf']['api']['yahoomaps'];
+                    break;
+                case 'Cloudmade':
+                    $params['conf']['apikeys']['cloudmade'] = $GLOBALS['conf']['api']['cloudmade'];
+                    break;
+                }
+            }
+        }
+
+        if (!empty($params['geocoder'])) {
+            switch ($params['geocoder']) {
+            case 'Google':
+                $params['conf']['apikeys']['google'] = $GLOBALS['conf']['api']['googlemaps'];
+                break;
+            case 'Yahoo':
+                $params['conf']['apikeys']['yahoo'] = $GLOBALS['conf']['api']['yahoomaps'];
+                break;
+            case 'Cloudmade':
+                $params['conf']['apikeys']['cloudmade'] = $GLOBALS['conf']['api']['cloudmade'];
+                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);
+    }
+
+    /**
      * Returns the real name, if available, of a user.
      */
     public static function getUserName($uid)