diff options
Diffstat (limited to 'modules/cloud.module')
-rw-r--r-- | modules/cloud.module | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/modules/cloud.module b/modules/cloud.module index 339fedc38..45e5ae764 100644 --- a/modules/cloud.module +++ b/modules/cloud.module @@ -141,25 +141,40 @@ function cloud_list($limit = 10) { $hour = -1; $list = -1; - + $inlist = false; + $output .= "<div class=\"item-list\">"; while ($site = db_fetch_object($result)) { if ($hour != floor((time() - $site->timestamp) / 3600)) { $hour = floor((time() - $site->timestamp) / 3600); if ($hour < 12) { + if ($inlist) { + $output .= "</ul>"; + $inlist = false; + } if ($hour == 0) { - $output .= "<br />". t("Updated less than one hour ago:"); - } - else { - $output .= "<br />". format_plural($hour, "Updated an hour ago:", "Updated %count hours ago:"); + $output .= t("Updated less than one hour ago:"); + } + else { + $output .= format_plural($hour, "Updated an hour ago:", "Updated %count hours ago:"); } } else if ($list) { - $output .= "<br />". format_plural($hour, "Updated more than an hour ago:", "Updated more than %count hours ago:"); + if ($inlist) { + $output .= "</ul>"; + $inlist = false; + } + $output .= format_plural($hour, "Updated more than an hour ago:", "Updated more than %count hours ago:"); $list = 0; } } - $output .= "<div style=\"padding-left: 10px;\"><a href=\"$site->link\">$site->name</a></div>"; + if (!$inlist) { + $output .= "<ul>"; + $inlist = true; + } + $output .= "<li><a href=\"$site->link\">$site->name</a></li>"; } + if ($inlist) $output .= "</ul>"; + $output .= "</div>"; return $output; } @@ -180,7 +195,7 @@ function cloud_block($op = "list", $delta = 0) { } else { $block["subject"] = t("Site cloud"); - $block["content"] = cloud_list(20) ."<br /><div align=\"right\">". l(t("more"), "cloud", array("title" => t("Monitor other sites in the cloud."))) ."</div>"; + $block["content"] = cloud_list(20) ."<div align=\"right\">". l(t("more"), "cloud", array("title" => t("Monitor other sites in the cloud."))) ."</div>"; return $block; } } |