diff options
-rw-r--r-- | Zotlabs/Widget/Activity_filter.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Zotlabs/Widget/Activity_filter.php b/Zotlabs/Widget/Activity_filter.php index 40f294fa5..6ed1748ae 100644 --- a/Zotlabs/Widget/Activity_filter.php +++ b/Zotlabs/Widget/Activity_filter.php @@ -10,12 +10,14 @@ class Activity_filter { return ''; $cmd = \App::$cmd; + $filter_active = false; $tabs = []; if(feature_enabled(local_channel(),'personal_tab')) { if(x($_GET,'conv')) { $conv_active = (($_GET['conv'] == 1) ? 'active' : ''); + $filter_active = true; } $tabs[] = [ @@ -30,6 +32,7 @@ class Activity_filter { if(feature_enabled(local_channel(),'star_posts')) { if(x($_GET,'star')) { $starred_active = (($_GET['star'] == 1) ? 'active' : ''); + $filter_active = true; } $tabs[] = [ @@ -50,6 +53,7 @@ class Activity_filter { foreach($groups as $g) { if(x($_GET,'gid')) { $group_active = (($_GET['gid'] == $g['id']) ? 'active' : ''); + $filter_active = true; } $tabs[] = [ @@ -73,6 +77,7 @@ class Activity_filter { foreach($terms as $t) { if(x($_GET,'file')) { $file_active = (($_GET['file'] == $t['term']) ? 'active' : ''); + $filter_active = true; } $tabs[] = [ @@ -86,6 +91,21 @@ class Activity_filter { } } + if(x($_GET,'search')) { + $filter_active = true; + } + + if($filter_active) { + $reset = [ + 'label' => t('Remove Filter'), + 'icon' => 'remove', + 'url'=> z_root() . '/' . $cmd, + 'sel'=> 'active bg-danger', + 'title' => t('Remove active filter'), + ]; + array_unshift($tabs, $reset); + } + $arr = ['tabs' => $tabs]; call_hooks('network_tabs', $arr); |