e36f2bb1fb
- Add short form array syntax to po2php.php generation
25 lines
667 B
PHP
25 lines
667 B
PHP
<?php
|
|
/**
|
|
* @file src/Util/Map.php
|
|
*/
|
|
namespace Friendica\Util;
|
|
|
|
/**
|
|
* Leaflet Map related functions
|
|
*/
|
|
class Map {
|
|
public static function byCoordinates($coord) {
|
|
$coord = trim($coord);
|
|
$coord = str_replace([',','/',' '],[' ',' ',' '],$coord);
|
|
$arr = ['lat' => trim(substr($coord,0,strpos($coord,' '))), 'lon' => trim(substr($coord,strpos($coord,' ')+1)), 'html' => ''];
|
|
call_hooks('generate_map',$arr);
|
|
return ($arr['html']) ? $arr['html'] : $coord;
|
|
}
|
|
|
|
public static function byLocation($location) {
|
|
$arr = ['location' => $location, 'html' => ''];
|
|
call_hooks('generate_named_map',$arr);
|
|
return ($arr['html']) ? $arr['html'] : $location;
|
|
}
|
|
}
|