- added more type-hints
- cleaned up some files (curly braces, spaces)
This commit is contained in:
Roland Häder 2022-06-23 07:16:22 +02:00
parent a1e17968d1
commit 04df7f6e05
No known key found for this signature in database
GPG key ID: C82EDE5DDFA0BA77
74 changed files with 603 additions and 529 deletions

View file

@ -6,6 +6,8 @@
* Author: Michael Vogel <https://pirati.ca/profile/heluecht>
*
*/
use Friendica\App;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
@ -13,27 +15,26 @@ function googlemaps_install()
{
Hook::register('render_location', 'addon/googlemaps/googlemaps.php', 'googlemaps_location');
Logger::notice("installed googlemaps");
Logger::notice('installed googlemaps');
}
function googlemaps_location($a, &$item)
function googlemaps_location(App $a, &$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'] = '<a target="map" title="'.$title.'" href= "'.$target.'">'.$title.'</a>';
$item['html'] = '<a target="map" title="' . $title . '" href= "' . $target . '">' . $title . '</a>';
}