*
*/
-require_once('include/cache.php');
+use Friendica\App;
+use Friendica\Core\Hook;
+use Friendica\Core\Logger;
+function googlemaps_install()
+{
+ Hook::register('render_location', 'addon/googlemaps/googlemaps.php', 'googlemaps_location');
-function googlemaps_install() {
- register_hook('render_location', 'addon/googlemaps/googlemaps.php', 'googlemaps_location');
-
- logger("installed googlemaps");
+ Logger::notice('installed googlemaps');
}
-function googlemaps_uninstall() {
- unregister_hook('render_location', 'addon/googlemaps/googlemaps.php', 'googlemaps_location');
-
- logger("removed googlemaps");
-}
-
-function googlemaps_location($a, &$item) {
-
- if(! (strlen($item['location']) || strlen($item['coord'])))
+function googlemaps_location(&$item)
+{
+ if (!(strlen($item['location']) || strlen($item['coord']))) {
return;
+ }
- if ($item['coord'] != "")
- $target = "http://maps.google.com/?q=".urlencode($item['coord']);
- else
- $target = "http://maps.google.com/?q=".urlencode($item['location']);
+ if ($item['coord'] != '') {
+ $target = 'http://maps.google.com/?q=' . urlencode($item['coord']);
+ } else {
+ $target = 'http://maps.google.com/?q=' . urlencode($item['location']);
+ }
- if ($item['location'] != "")
+ if ($item['location'] != '') {
$title = $item['location'];
- else
+ } else {
$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>';
}