aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Widget/Categories.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-03-15 20:11:28 -0700
committerMario Vavti <mario@mariovavti.com>2017-03-29 11:50:03 +0200
commitf60309efa12be3b8d4f5b2c565ebdf7f051a987d (patch)
tree3e5669efa5d3842e7127aa486bb59568be5930f6 /Zotlabs/Widget/Categories.php
parent47f4007951ce3311ee267a863a2cc46085c4892a (diff)
downloadvolse-hubzilla-f60309efa12be3b8d4f5b2c565ebdf7f051a987d.tar.gz
volse-hubzilla-f60309efa12be3b8d4f5b2c565ebdf7f051a987d.tar.bz2
volse-hubzilla-f60309efa12be3b8d4f5b2c565ebdf7f051a987d.zip
more widget migrations
Diffstat (limited to 'Zotlabs/Widget/Categories.php')
-rw-r--r--Zotlabs/Widget/Categories.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/Zotlabs/Widget/Categories.php b/Zotlabs/Widget/Categories.php
new file mode 100644
index 000000000..82fffccc8
--- /dev/null
+++ b/Zotlabs/Widget/Categories.php
@@ -0,0 +1,22 @@
+<?php
+
+namespace Zotlabs\Widget;
+
+
+class Categories {
+
+ function widget($arr) {
+
+ if((! \App::$profile['profile_uid'])
+ || (! perm_is_allowed(\App::$profile['profile_uid'],get_observer_hash(),'view_stream'))) {
+ return '';
+ }
+
+ $cat = ((x($_REQUEST,'cat')) ? htmlspecialchars($_REQUEST['cat'],ENT_COMPAT,'UTF-8') : '');
+ $srchurl = \App::$query_string;
+ $srchurl = rtrim(preg_replace('/cat\=[^\&].*?(\&|$)/is','',$srchurl),'&');
+ $srchurl = str_replace(array('?f=','&f='),array('',''),$srchurl);
+
+ return categories_widget($srchurl, $cat);
+ }
+}