aboutsummaryrefslogtreecommitdiff
path: root/views/default
diff options
context:
space:
mode:
authornickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-06-01 16:22:51 +0000
committernickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-06-01 16:22:51 +0000
commitff46b7f628d928abaaaed721e0bb1434de9997b3 (patch)
tree2f71d9fa5c79dd5bc7756b96f9d8f4e60c54fc8c /views/default
parent0865f660a74a784b6306afde8b45ec4aa9d176cc (diff)
downloadelgg-ff46b7f628d928abaaaed721e0bb1434de9997b3.tar.gz
elgg-ff46b7f628d928abaaaed721e0bb1434de9997b3.tar.bz2
Extending default tagcloud view to include a link to all site tags.
Also fixing a bug where errant "," was prepended to tag list. git-svn-id: http://code.elgg.org/elgg/trunk@6309 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default')
-rw-r--r--views/default/output/tagcloud.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/views/default/output/tagcloud.php b/views/default/output/tagcloud.php
index 2296c01fe..ced3f2f30 100644
--- a/views/default/output/tagcloud.php
+++ b/views/default/output/tagcloud.php
@@ -34,26 +34,32 @@ if (!empty($vars['tagcloud']) && is_array($vars['tagcloud'])) {
$cloud = "";
$max = 0;
- $cloud .= "<h3>".elgg_echo('tagcloud')."</h3><div class='tagcloud'>";
+ $cloud .= '<h3>'.elgg_echo('tagcloud').'</h3>';
+ $cloud .= '<div class="tagcloud">';
foreach($vars['tagcloud'] as $tag) {
if ($tag->total > $max) {
$max = $tag->total;
}
}
+
+ $list = '';
foreach($vars['tagcloud'] as $tag) {
- if (!empty($cloud)) {
- $cloud .= ", ";
+ if ($list != '') {
+ $list .= ', ';
}
// protecting against division by zero warnings
$size = round((log($tag->total) / log($max + .0001)) * 100) + 30;
if ($size < 100) {
$size = 100;
}
- $url = $vars['url'] . "pg/search/?q=". urlencode($tag->tag) . "&search_type=tags{$type}{$subtype}";
- $cloud .= "<a href=\"{$url}\" style=\"font-size: {$size}%\" title=\"".addslashes($tag->tag)." ({$tag->total})\" style=\"text-decoration:none;\">" . htmlentities($tag->tag, ENT_QUOTES, 'UTF-8') . "</a>";
+ $url = "{$vars['url']}pg/search/?q=". urlencode($tag->tag) . "&search_type=tags$type$subtype";
+ $list .= "<a href=\"$url\" style=\"font-size: $size%\" title=\"".addslashes($tag->tag)." ($tag->total)\" style=\"text-decoration:none;\">" . htmlentities($tag->tag, ENT_QUOTES, 'UTF-8') . "</a>";
}
- $cloud .= "</div>";
+ $cloud .= "$list</div>";
+
+ $cloud .= elgg_view('tagcloud/extend');
+
echo $cloud;
} \ No newline at end of file