summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2009-11-19 19:12:22 -0500
committerCraig Andrews <candrews@integralblue.com>2009-11-19 19:13:55 -0500
commit67add6429136dd6c2f5a924fb6bfef3ae099b495 (patch)
treea4748468c694a1566e57df335ff8ddc92ed928d7
parentaadb4f20935fcf781771726397abd64b0157bf3e (diff)
Use the geo microformat as documented at http://microformats.org/wiki/geo
-rw-r--r--lib/noticelist.php26
1 files changed, 11 insertions, 15 deletions
diff --git a/lib/noticelist.php b/lib/noticelist.php
index 5877827ff..dd97b85bd 100644
--- a/lib/noticelist.php
+++ b/lib/noticelist.php
@@ -392,11 +392,6 @@ class NoticeListItem extends Widget
$name = $location->getName();
- if (empty($name)) {
- // XXX: Could be a translation issue. Fall back to... something?
- return;
- }
-
$lat = $this->notice->lat;
$lon = $this->notice->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->text(_('at'));
- if (empty($url)) {
- $this->out->element('span', array('class' => 'geo',
- 'title' => $latlon),
- $name);
- } else {
- $this->out->element('a', array('class' => 'geo',
- 'title' => $latlon,
- 'href' => $url),
- $name);
- }
+
+ $this->out->elementStart('a', array('class' => 'geo', 'href' => $url));
+ $this->out->elementStart('abbr', array('class' => 'latitude', 'title' => $lat, 'style' => empty($name)?null:'display: none'));
+ $this->out->text($lat); //TODO translate to a prettier format, like "S 37.2 deg" instead of "-37.2"
+ $this->out->elementEnd('abbr');
+ $this->out->elementStart('abbr', array('class' => 'longitude', 'title' => $lon, 'style' => empty($name)?null:'display: none'));
+ $this->out->text($lon);
+ $this->out->elementEnd('abbr');
+ $this->out->text($name);
+ $this->out->elementEnd('a');
+
$this->out->elementEnd('span');
}