aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Widget/Tagcloud.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-03-15 18:31:34 -0700
committerzotlabs <mike@macgirvin.com>2017-03-15 18:31:34 -0700
commit9cb9608209ab5f9fb123acc82a563ba54c450db1 (patch)
treecac1d07e7d04498ed2a555b3d8c3e89cd51b2634 /Zotlabs/Widget/Tagcloud.php
parentb20062efa6052e29b8d2d2a42ca966837db1c29f (diff)
downloadvolse-hubzilla-9cb9608209ab5f9fb123acc82a563ba54c450db1.tar.gz
volse-hubzilla-9cb9608209ab5f9fb123acc82a563ba54c450db1.tar.bz2
volse-hubzilla-9cb9608209ab5f9fb123acc82a563ba54c450db1.zip
convert more widgets to classes
Diffstat (limited to 'Zotlabs/Widget/Tagcloud.php')
-rw-r--r--Zotlabs/Widget/Tagcloud.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/Zotlabs/Widget/Tagcloud.php b/Zotlabs/Widget/Tagcloud.php
new file mode 100644
index 000000000..cf7a4932e
--- /dev/null
+++ b/Zotlabs/Widget/Tagcloud.php
@@ -0,0 +1,33 @@
+<?php
+
+namespace Zotlabs\Widget;
+
+// @FIXME The problem with this widget is that we don't have a search function for webpages
+// that we can send the links to. Then we should also provide an option to search webpages
+// and conversations.
+
+class Tagcloud {
+
+ function widget($args) {
+
+ $o = '';
+ $uid = \App::$profile_uid;
+ $count = ((x($args,'count')) ? intval($args['count']) : 24);
+ $flags = 0;
+ $type = TERM_CATEGORY;
+
+ // @FIXME there exists no $authors variable
+ $r = tagadelic($uid, $count, $authors, $owner, $flags, ITEM_TYPE_WEBPAGE, $type);
+
+ // @FIXME this should use a template
+
+ if($r) {
+ $o = '<div class="tagblock widget"><h3>' . t('Categories') . '</h3><div class="tags" align="center">';
+ foreach($r as $rv) {
+ $o .= '<span class="tag' . $rv[2] . '">' . $rv[0] .' </span> ' . "\r\n";
+ }
+ $o .= '</div></div>';
+ }
+ return $o;
+ }
+}