aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-04-09 21:44:04 -0700
committerzotlabs <mike@macgirvin.com>2018-04-09 21:44:04 -0700
commit6bf2c64aa2a5a25edbb84b747ab81a47d9e08abd (patch)
tree7d8c191799f5667d84edf5d55095a8479d0b77e0 /Zotlabs
parent1aba495a1c1feae2a02275d2db5dcd10c877d859 (diff)
downloadvolse-hubzilla-6bf2c64aa2a5a25edbb84b747ab81a47d9e08abd.tar.gz
volse-hubzilla-6bf2c64aa2a5a25edbb84b747ab81a47d9e08abd.tar.bz2
volse-hubzilla-6bf2c64aa2a5a25edbb84b747ab81a47d9e08abd.zip
Create catcloud widget and provide a type option which can include 'cards' or 'articles'
Diffstat (limited to 'Zotlabs')
-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']);
+
+
+ }
+
+}