From 38f8d3d11b10d20b3802b1769568ca987ad4cd95 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Fri, 20 Nov 2009 17:33:22 -0500 Subject: Revert "Use the geo microformat as documented at http://microformats.org/wiki/geo" This reverts commit 67add6429136dd6c2f5a924fb6bfef3ae099b495. --- lib/noticelist.php | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'lib/noticelist.php') diff --git a/lib/noticelist.php b/lib/noticelist.php index dd97b85bd..5877827ff 100644 --- a/lib/noticelist.php +++ b/lib/noticelist.php @@ -392,6 +392,11 @@ 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 : ''; @@ -400,17 +405,16 @@ class NoticeListItem extends Widget $this->out->elementStart('span', array('class' => 'location')); $this->out->text(_('at')); - - $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'); - + 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->elementEnd('span'); } -- cgit v1.2.3-54-g00ecf