diff options
author | zotlabs <mike@macgirvin.com> | 2017-08-23 00:01:02 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-08-23 00:01:02 -0700 |
commit | e084b776eee9f1fc66e3f4a37b92ec70ccc49286 (patch) | |
tree | bf19cfd1d3823ec13df1606319bd638e142a4849 /Zotlabs/Widget/Categories.php | |
parent | 41ff8fdd375fcf395b547dd02f3bdcbb198ec0c1 (diff) | |
download | volse-hubzilla-e084b776eee9f1fc66e3f4a37b92ec70ccc49286.tar.gz volse-hubzilla-e084b776eee9f1fc66e3f4a37b92ec70ccc49286.tar.bz2 volse-hubzilla-e084b776eee9f1fc66e3f4a37b92ec70ccc49286.zip |
cards feature
Diffstat (limited to 'Zotlabs/Widget/Categories.php')
-rw-r--r-- | Zotlabs/Widget/Categories.php | 13 |
1 files changed, 11 insertions, 2 deletions
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); + } } |