From: Jan Schneider Date: Tue, 20 Jul 2010 20:33:05 +0000 (+0200) Subject: Move this method. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=37df1260d3aa4234221245bc43634ec1b528c099;p=horde.git Move this method. --- diff --git a/kronolith/lib/Kronolith.php b/kronolith/lib/Kronolith.php index 16172df1f..ec1da44a9 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -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)