Fix: Events on Diaspora now should look fine

This commit is contained in:
Michael 2018-03-20 06:32:17 +00:00
parent 9c5f2ad0fc
commit f4ba5d9799
4 changed files with 40 additions and 19 deletions

View file

@ -10,17 +10,23 @@ use Friendica\Core\Addon;
* Leaflet Map related functions
*/
class Map {
public static function byCoordinates($coord) {
public static function byCoordinates($coord, $html_mode = 0) {
$coord = trim($coord);
$coord = str_replace([',','/',' '],[' ',' ',' '],$coord);
$arr = ['lat' => trim(substr($coord,0,strpos($coord,' '))), 'lon' => trim(substr($coord,strpos($coord,' ')+1)), 'html' => ''];
$arr = ['lat' => trim(substr($coord,0,strpos($coord,' '))), 'lon' => trim(substr($coord,strpos($coord,' ')+1)), 'mode' => $html_mode, 'html' => ''];
Addon::callHooks('generate_map',$arr);
return ($arr['html']) ? $arr['html'] : $coord;
}
public static function byLocation($location) {
$arr = ['location' => $location, 'html' => ''];
public static function byLocation($location, $html_mode = 0) {
$arr = ['location' => $location, 'mode' => $html_mode, 'html' => ''];
Addon::callHooks('generate_named_map',$arr);
return ($arr['html']) ? $arr['html'] : $location;
}
public static function getCoordinates($location) {
$arr = ['location' => $location, 'lat' => false, 'lon' => false];
Addon::callHooks('Map::getCoordinates', $arr);
return $arr;
}
}