From: friendica Date: Sun, 19 Feb 2012 22:26:41 +0000 (-0800) Subject: provide sane osm defaults if nothing has been configured X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=23def0b48db5d3058e62bba5dffb055aecaea1cc;p=friendica-addons.git provide sane osm defaults if nothing has been configured --- diff --git a/openstreetmap.tgz b/openstreetmap.tgz index 93dc874b..e54b0c78 100644 Binary files a/openstreetmap.tgz and b/openstreetmap.tgz differ diff --git a/openstreetmap/openstreetmap.php b/openstreetmap/openstreetmap.php index ebe60978..415e448d 100755 --- a/openstreetmap/openstreetmap.php +++ b/openstreetmap/openstreetmap.php @@ -29,7 +29,11 @@ function openstreetmap_location($a, &$item) { * Get the configuration variables from the .htconfig file. */ $tmsserver = get_config('openstreetmap','tmsserver'); + if(! $tmsserver) + $tmsserver = 'http://openstreetmap.org'; $zoom = get_config('openstreetmap','zoom'); + if(! $zoom) + $zoom = 17; $location = ''; $coord = ''; @@ -55,10 +59,17 @@ function openstreetmap_location($a, &$item) { function openstreetmap_plugin_admin (&$a, &$o) { $t = file_get_contents( dirname(__file__)."/admin.tpl"); + $tmsserver = get_config('openstreetmap','tmsserver'); + if(! $tmsserver) + $tmsserver = 'http://openstreetmap.org'; + $zoom = get_config('openstreetmap','zoom'); + if(! $zoom) + $zoom = 17; + $o = replace_macros( $t, array( '$submit' => t('Submit'), - '$tmsserver' => array('tmsserver', t('Tile Server URL'), get_config('openstreetmap','tmsserver' ), t('A list of public tile servers')), - '$zoom' => array('zoom', t('Default zoom'), get_config('openstreetmap','zoom' ), t('The default zoom level. (1:world, 18:highest)')), + '$tmsserver' => array('tmsserver', t('Tile Server URL'), $tmsserver, t('A list of public tile servers')), + '$zoom' => array('zoom', t('Default zoom'), $zoom, t('The default zoom level. (1:world, 18:highest)')), )); } function openstreetmap_plugin_admin_post (&$a) { diff --git a/qcomment.tgz b/qcomment.tgz index b0ae94bc..76dffda1 100644 Binary files a/qcomment.tgz and b/qcomment.tgz differ