From e084b776eee9f1fc66e3f4a37b92ec70ccc49286 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 23 Aug 2017 00:01:02 -0700 Subject: cards feature --- Zotlabs/Widget/Categories.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'Zotlabs/Widget') diff --git a/Zotlabs/Widget/Categories.php b/Zotlabs/Widget/Categories.php index d1dcfda93..a11b3d919 100644 --- a/Zotlabs/Widget/Categories.php +++ b/Zotlabs/Widget/Categories.php @@ -8,8 +8,13 @@ class Categories { function widget($arr) { + $cards = ((array_key_exists('cards',$arr) && $arr['cards']) ? true : false); + + if(($cards) && (! feature_enabled(\App::$profile['profile_uid'],'cards')) + return ''; + if((! \App::$profile['profile_uid']) - || (! perm_is_allowed(\App::$profile['profile_uid'],get_observer_hash(),'view_stream'))) { + || (! perm_is_allowed(\App::$profile['profile_uid'],get_observer_hash(),(($cards) ? 'view_pages' : 'view_stream')))) { return ''; } @@ -18,6 +23,10 @@ class Categories { $srchurl = rtrim(preg_replace('/cat\=[^\&].*?(\&|$)/is','',$srchurl),'&'); $srchurl = str_replace(array('?f=','&f='),array('',''),$srchurl); - return categories_widget($srchurl, $cat); + if($cards) + return cardcategories_widget($srchurl, $cat); + else + return categories_widget($srchurl, $cat); + } } -- cgit v1.2.3 From 9518dc0e4ee40c9672e533afbb1a506c3a85c598 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 23 Aug 2017 02:03:39 -0700 Subject: typo --- Zotlabs/Widget/Categories.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs/Widget') diff --git a/Zotlabs/Widget/Categories.php b/Zotlabs/Widget/Categories.php index a11b3d919..84deb03d6 100644 --- a/Zotlabs/Widget/Categories.php +++ b/Zotlabs/Widget/Categories.php @@ -10,7 +10,7 @@ class Categories { $cards = ((array_key_exists('cards',$arr) && $arr['cards']) ? true : false); - if(($cards) && (! feature_enabled(\App::$profile['profile_uid'],'cards')) + if(($cards) && (! feature_enabled(\App::$profile['profile_uid'],'cards'))) return ''; if((! \App::$profile['profile_uid']) -- cgit v1.2.3