]> git.mxchange.org Git - friendica-addons.git/blobdiff - openstreetmap/openstreetmap.php
Merge branch '3.6-rc'
[friendica-addons.git] / openstreetmap / openstreetmap.php
index 974be0a0a0c651488cb486526d324157f3d2f9a3..bfe960fad5e347fcec2b0c3595a977919f78019e 100644 (file)
@@ -42,8 +42,7 @@ function openstreetmap_uninstall()
        logger("removed openstreetmap");
 }
 
        logger("removed openstreetmap");
 }
 
-function openstreetmap_alterheader($a, &$navHtml)
-{
+function openstreetmap_alterheader($a, &$navHtml) {
        $addScriptTag = '<script type="text/javascript" src="' . $a->get_baseurl() . '/addon/openstreetmap/openstreetmap.js"></script>' . "\r\n";
        $a->page['htmlhead'] .= $addScriptTag;
 }
        $addScriptTag = '<script type="text/javascript" src="' . $a->get_baseurl() . '/addon/openstreetmap/openstreetmap.js"></script>' . "\r\n";
        $a->page['htmlhead'] .= $addScriptTag;
 }
@@ -53,7 +52,7 @@ function openstreetmap_alterheader($a, &$navHtml)
  *
  * If an item has coordinates add link to a tile map server, e.g. openstreetmap.org.
  * If an item has a location open it with the help of OSM's Nominatim reverse geocode search.
  *
  * If an item has coordinates add link to a tile map server, e.g. openstreetmap.org.
  * If an item has a location open it with the help of OSM's Nominatim reverse geocode search.
- *
+ * 
  * @param mixed $a
  * @param array& $item
  */
  * @param mixed $a
  * @param array& $item
  */
@@ -61,7 +60,6 @@ function openstreetmap_location($a, &$item)
 {
        if (!(strlen($item['location']) || strlen($item['coord']))) {
                return;
 {
        if (!(strlen($item['location']) || strlen($item['coord']))) {
                return;
-       }
 
        /*
         * Get the configuration variables from the config.
 
        /*
         * Get the configuration variables from the config.
@@ -94,15 +92,13 @@ function openstreetmap_location($a, &$item)
                }
        }
 
                }
        }
 
-       if ($target == "") {
+       if ($target == "")
                $target = $nomserver.'?q='.urlencode($item['location']);
                $target = $nomserver.'?q='.urlencode($item['location']);
-       }
 
 
-       if ($item['location'] != "") {
+       if ($item['location'] != "")
                $title = $item['location'];
                $title = $item['location'];
-       } else {
+       else
                $title = $item['coord'];
                $title = $item['coord'];
-       }
 
        $item['html'] = '<a target="map" title="'.$title.'" href= "'.$target.'">'.$title.'</a>';
 }
 
        $item['html'] = '<a target="map" title="'.$title.'" href= "'.$target.'">'.$title.'</a>';
 }
@@ -216,3 +212,5 @@ function openstreetmap_addon_admin_post(&$a)
 
        info(L10n::t('Settings updated.') . EOL);
 }
 
        info(L10n::t('Settings updated.') . EOL);
 }
+
+