summaryrefslogtreecommitdiff
path: root/lib/noticelist.php
diff options
context:
space:
mode:
authorBrenda Wallace <shiny@cpan.org>2010-08-16 02:52:23 +0000
committerBrenda Wallace <shiny@cpan.org>2010-08-16 02:52:23 +0000
commit640e7e7c43fa8e9b1a8516b486e560df84bd9887 (patch)
tree26f895ccbdbc4510d377e283a47bf66c52d5d5a7 /lib/noticelist.php
parentaf4fd327429fcc01769b33ece458a77a37b2463f (diff)
parentc1cab9bfb83496d941f9a4da918d1e9221f3a08a (diff)
Merge commit 'origin/0.9.x' into 0.9.x
Diffstat (limited to 'lib/noticelist.php')
-rw-r--r--lib/noticelist.php23
1 files changed, 16 insertions, 7 deletions
diff --git a/lib/noticelist.php b/lib/noticelist.php
index 432ea78d5..529d6a3f9 100644
--- a/lib/noticelist.php
+++ b/lib/noticelist.php
@@ -96,8 +96,14 @@ class NoticeList extends Widget
break;
}
- $item = $this->newListItem($this->notice);
- $item->show();
+ try {
+ $item = $this->newListItem($this->notice);
+ $item->show();
+ } catch (Exception $e) {
+ // we log exceptions and continue
+ common_log(LOG_ERR, $e->getMessage());
+ continue;
+ }
}
$this->out->elementEnd('ol');
@@ -463,12 +469,14 @@ class NoticeListItem extends Widget
$this->out->elementEnd('span');
}
+ /**
+ * @param number $dec decimal degrees
+ * @return array split into 'deg', 'min', and 'sec'
+ */
function decimalDegreesToDMS($dec)
{
-
- $vars = explode(".",$dec);
- $deg = $vars[0];
- $tempma = "0.".$vars[1];
+ $deg = intval($dec);
+ $tempma = abs($dec) - abs($deg);
$tempma = $tempma * 3600;
$min = floor($tempma / 60);
@@ -491,9 +499,10 @@ class NoticeListItem extends Widget
$ns = $this->notice->getSource();
if ($ns) {
- $source_name = _($ns->code);
+ $source_name = (empty($ns->name)) ? ($ns->code ? _($ns->code) : _('web')) : _($ns->name);
$this->out->text(' ');
$this->out->elementStart('span', 'source');
+ // FIXME: probably i18n issue. If "from" is followed by text, that should be a parameter to "from" (from %s).
$this->out->text(_('from'));
$this->out->text(' ');