Use the geo microformat as documented at http://microformats.org/wiki/geo
This commit is contained in:
parent
aadb4f2093
commit
67add64291
@ -392,11 +392,6 @@ class NoticeListItem extends Widget
|
|||||||
|
|
||||||
$name = $location->getName();
|
$name = $location->getName();
|
||||||
|
|
||||||
if (empty($name)) {
|
|
||||||
// XXX: Could be a translation issue. Fall back to... something?
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$lat = $this->notice->lat;
|
$lat = $this->notice->lat;
|
||||||
$lon = $this->notice->lon;
|
$lon = $this->notice->lon;
|
||||||
$latlon = (!empty($lat) && !empty($lon)) ? $lat.';'.$lon : '';
|
$latlon = (!empty($lat) && !empty($lon)) ? $lat.';'.$lon : '';
|
||||||
@ -405,16 +400,17 @@ class NoticeListItem extends Widget
|
|||||||
|
|
||||||
$this->out->elementStart('span', array('class' => 'location'));
|
$this->out->elementStart('span', array('class' => 'location'));
|
||||||
$this->out->text(_('at'));
|
$this->out->text(_('at'));
|
||||||
if (empty($url)) {
|
|
||||||
$this->out->element('span', array('class' => 'geo',
|
$this->out->elementStart('a', array('class' => 'geo', 'href' => $url));
|
||||||
'title' => $latlon),
|
$this->out->elementStart('abbr', array('class' => 'latitude', 'title' => $lat, 'style' => empty($name)?null:'display: none'));
|
||||||
$name);
|
$this->out->text($lat); //TODO translate to a prettier format, like "S 37.2 deg" instead of "-37.2"
|
||||||
} else {
|
$this->out->elementEnd('abbr');
|
||||||
$this->out->element('a', array('class' => 'geo',
|
$this->out->elementStart('abbr', array('class' => 'longitude', 'title' => $lon, 'style' => empty($name)?null:'display: none'));
|
||||||
'title' => $latlon,
|
$this->out->text($lon);
|
||||||
'href' => $url),
|
$this->out->elementEnd('abbr');
|
||||||
$name);
|
$this->out->text($name);
|
||||||
}
|
$this->out->elementEnd('a');
|
||||||
|
|
||||||
$this->out->elementEnd('span');
|
$this->out->elementEnd('span');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user