1<?php
2// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project
3//
4// All Rights Reserved. See copyright.txt for details and a complete list of authors.
5// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
6// $Id$
7
8//this script may only be included - so its better to die if called directly.
9if (strpos($_SERVER["SCRIPT_NAME"], basename(__FILE__)) !== false) {
10	header("location: index.php");
11	exit;
12}
13
14function smarty_function_defaultmapcenter($params, $smarty)
15{
16	$smarty->loadPlugin('smarty_modifier_escape');
17	global $prefs;
18	$geolib = TikiLib::lib('geo');
19	$coords = $geolib->parse_coordinates($prefs['gmap_defaultx'] . ',' . $prefs['gmap_defaulty'] . ',' . $prefs['gmap_defaultz']);
20	$center = $geolib->build_location_string($coords);
21	return smarty_modifier_escape($center);
22}
23