aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Widget/Catcloud.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-05-04 09:46:27 +0200
committerMario Vavti <mario@mariovavti.com>2018-05-04 09:46:27 +0200
commitbe4c9a9598350fb4333480f0c7b302acebcddfd4 (patch)
treefb0c2606ad4ca0bc1a710d6fdf82f55c326b3427 /Zotlabs/Widget/Catcloud.php
parentf15c12376adad6534c8c0ea547a7548697eb8379 (diff)
parentbe852ba857f4cb8e75574a762945b50c8bddcff9 (diff)
downloadvolse-hubzilla-be4c9a9598350fb4333480f0c7b302acebcddfd4.tar.gz
volse-hubzilla-be4c9a9598350fb4333480f0c7b302acebcddfd4.tar.bz2
volse-hubzilla-be4c9a9598350fb4333480f0c7b302acebcddfd4.zip
Merge branch '3.4RC'3.4
Diffstat (limited to 'Zotlabs/Widget/Catcloud.php')
-rw-r--r--Zotlabs/Widget/Catcloud.php46
1 files changed, 46 insertions, 0 deletions
diff --git a/Zotlabs/Widget/Catcloud.php b/Zotlabs/Widget/Catcloud.php
new file mode 100644
index 000000000..c53f9bbf6
--- /dev/null
+++ b/Zotlabs/Widget/Catcloud.php
@@ -0,0 +1,46 @@
+<?php
+
+namespace Zotlabs\Widget;
+
+class Catcloud {
+
+ function widget($arr) {
+
+ if((! \App::$profile['profile_uid']) || (! \App::$profile['channel_hash']))
+ return '';
+
+ $limit = ((array_key_exists('limit',$arr)) ? intval($arr['limit']) : 50);
+
+ if(array_key_exists('type',$arr)) {
+ switch($arr['type']) {
+
+ case 'cards':
+
+ if(! perm_is_allowed(\App::$profile['profile_uid'], get_observer_hash(), 'view_pages'))
+ return '';
+
+ return card_catblock(\App::$profile['profile_uid'], $limit, '', \App::$profile['channel_hash']);
+
+ case 'articles':
+
+ if(! perm_is_allowed(\App::$profile['profile_uid'], get_observer_hash(), 'view_pages'))
+ return '';
+
+ return article_catblock(\App::$profile['profile_uid'], $limit, '', \App::$profile['channel_hash']);
+
+
+ default:
+ break;
+ }
+ }
+
+
+ if(! perm_is_allowed(\App::$profile['profile_uid'], get_observer_hash(), 'view_stream'))
+ return '';
+
+ return catblock(\App::$profile['profile_uid'], $limit, '', \App::$profile['channel_hash']);
+
+
+ }
+
+}