elgg_deprecated_notice('display_cloud() was deprecated by elgg_view_tagcloud()!', 1.8);
- return elgg_view("output/tagcloud",array('value' => get_tags($threshold, $limit, $metadata_name, $entity_type, $entity_subtype, $owner_guid, $site_guid, $start_ts, $end_ts),
- 'type' => $entity_type,
- 'subtype' => $entity_subtype));
+ $tags = get_tags($threshold, $limit, $metadata_name, $entity_type, $entity_subtype, $owner_guid, $site_guid, $start_ts, $end_ts);
+ return elgg_view('output/tagcloud', array(
+ 'value' => $tags,
+ 'type' => $entity_type,
+ 'subtype' => $entity_subtype,
+ ));
}
/**
// register the standard tags metadata name
elgg_register_tag_metadata_name('tags');
+
+register_page_handler('tags', 'elgg_tagcloud_page_handler');
+function elgg_tagcloud_page_handler($page) {
+ global $CONFIG;
+
+ switch ($page[0]) {
+ default:
+ $title = elgg_view_title(elgg_echo('tags:site_cloud'));
+ $tags = display_tagcloud(0, 100, 'tags');
+ $body = elgg_view_layout('one_column_with_sidebar', $title . $tags);
+
+ page_draw(elgg_echo('tags:site_cloud'), $body);
+ break;
+ }
+}
*/
'tag_names:tags' => 'Tags',
+ 'tags:site_cloud' => 'Site Tag Cloud',
/**
* Languages according to ISO 639-1
function tagcloud_init() {
add_widget_type('tagcloud', elgg_echo('tagcloud:widget:title'), elgg_echo('tagcloud:widget:description'));
-
elgg_extend_view('css','tagcloud/css');
- register_page_handler('tagcloud', 'tagcloud_page_handler');
-}
-
-function tagcloud_page_handler($page) {
- global $CONFIG;
-
- switch ($page[0]) {
- default:
- $title = elgg_view_title(elgg_echo('tagcloud:site:title'));
- $tags = display_tagcloud(0, 100, 'tags');
- $body = elgg_view_layout('one_column_with_sidebar', $title . $tags);
-
- page_draw(elgg_echo('tagcloud:site:title'), $body);
- break;
- }
}
register_elgg_event_handler('init', 'system', 'tagcloud_init');
+++ /dev/null
-<?php
-
-echo '<p class="tags">';
-echo "<a href=\"{$vars['url']}pg/tagcloud\">All site tags</a>";
-echo '</p>';
\ No newline at end of file
* @uses $vars['subtype'] Entity subtype
*/
+$context = get_context();
+
if (!empty($vars['subtype'])) {
$subtype = "&entity_subtype=" . urlencode($vars['subtype']);
} else {
$cloud = "";
$max = 0;
- $cloud .= '<h3>'.elgg_echo('tagcloud').'</h3>';
+ if ($context != 'tags') {
+ $title = elgg_echo('tagcloud');
+ $cloud .= "<h3>$title</h3>";
+ }
+
$cloud .= '<div class="tagcloud">';
foreach($vars['tagcloud'] as $tag) {
$cloud .= "$list</div>";
+ if ($context != 'tags') {
+ $cloud .= '<p class="tags">';
+ $cloud .= "<a href=\"{$vars['url']}pg/tags\">All site tags</a>";
+ $cloud .= '</p>';
+ }
+
$cloud .= elgg_view('tagcloud/extend');
echo $cloud;