aboutsummaryrefslogtreecommitdiff
path: root/mod
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 /mod
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 'mod')
-rw-r--r--mod/tagcloud/start.php38
-rw-r--r--mod/tagcloud/views/default/tagcloud/extend.php5
2 files changed, 29 insertions, 14 deletions
diff --git a/mod/tagcloud/start.php b/mod/tagcloud/start.php
index d026163a0..9cd9164f6 100644
--- a/mod/tagcloud/start.php
+++ b/mod/tagcloud/start.php
@@ -1,18 +1,28 @@
<?php
- function tagcloud_init() {
- add_widget_type('tagcloud', elgg_echo('tagcloud:widget:title'), elgg_echo('tagcloud:widget:description'));
-
- // Extend CSS
+/**
+ *
+ */
+
+
+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;
- if(is_plugin_enabled('blog')) {
- // extend blog sidebar with a tag-cloud
- }
- if(is_plugin_enabled('bookmarks')) {
- // extend bkmrks sidebar with a tag-cloud
- }
-
- }
+ 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', $title . $tags);
- register_elgg_event_handler('init', 'system', 'tagcloud_init');
-?>
+ page_draw(elgg_echo('tagcloud:site:title'), $body);
+ break;
+ }
+}
+
+register_elgg_event_handler('init', 'system', 'tagcloud_init');
diff --git a/mod/tagcloud/views/default/tagcloud/extend.php b/mod/tagcloud/views/default/tagcloud/extend.php
new file mode 100644
index 000000000..d70fa77ad
--- /dev/null
+++ b/mod/tagcloud/views/default/tagcloud/extend.php
@@ -0,0 +1,5 @@
+<?php
+
+echo '<div>';
+echo "<a href=\"{$vars['url']}pg/tagcloud\">All site tags</a>";
+echo '</div>'; \ No newline at end of file