X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=googlemaps%2Fgooglemaps.php;h=356ce68ca5f8b24b009ff98e5495ae68cb60eadc;hb=77ad52d1f41f99de3e2ee3a1f894b56fafae5389;hp=09a566e8b46b2071027cc85fe0cd678ac783b459;hpb=b303aedd668010f80457cc5b0080a39c8919a09c;p=friendica-addons.git diff --git a/googlemaps/googlemaps.php b/googlemaps/googlemaps.php index 09a566e8..356ce68c 100644 --- a/googlemaps/googlemaps.php +++ b/googlemaps/googlemaps.php @@ -6,6 +6,8 @@ * Author: Michael Vogel * */ + +use Friendica\App; use Friendica\Core\Hook; use Friendica\Core\Logger; @@ -13,34 +15,26 @@ function googlemaps_install() { Hook::register('render_location', 'addon/googlemaps/googlemaps.php', 'googlemaps_location'); - Logger::log("installed googlemaps"); -} - -function googlemaps_uninstall() -{ - Hook::unregister('render_location', 'addon/googlemaps/googlemaps.php', 'googlemaps_location'); - - Logger::log("removed googlemaps"); + Logger::notice('installed googlemaps'); } -function googlemaps_location($a, &$item) +function googlemaps_location(&$item) { - - if(! (strlen($item['location']) || strlen($item['coord']))) { + if (!(strlen($item['location']) || strlen($item['coord']))) { return; } - if ($item['coord'] != ""){ - $target = "http://maps.google.com/?q=".urlencode($item['coord']); + if ($item['coord'] != '') { + $target = 'http://maps.google.com/?q=' . urlencode($item['coord']); } else { - $target = "http://maps.google.com/?q=".urlencode($item['location']); + $target = 'http://maps.google.com/?q=' . urlencode($item['location']); } - if ($item['location'] != "") { + if ($item['location'] != '') { $title = $item['location']; } else { $title = $item['coord']; } - $item['html'] = ''.$title.''; + $item['html'] = '' . $title . ''; }