mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-06-07 09:54:27 +02:00
Changes:
- added more type-hints - cleaned up some files (curly braces, spaces)
This commit is contained in:
parent
a1e17968d1
commit
04df7f6e05
74 changed files with 603 additions and 529 deletions
|
@ -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>';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue