aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Widget
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-05-31 14:02:34 +0200
committerMario Vavti <mario@mariovavti.com>2018-05-31 14:02:34 +0200
commitd03c27d18c10d287cbfd3133b3301934d0457636 (patch)
tree959592f7dca144045b5a7f256663cde9d2e129ef /Zotlabs/Widget
parent7e8c7f86f0d103dbffa0ee4fc7538d89a0925a15 (diff)
downloadvolse-hubzilla-d03c27d18c10d287cbfd3133b3301934d0457636.tar.gz
volse-hubzilla-d03c27d18c10d287cbfd3133b3301934d0457636.tar.bz2
volse-hubzilla-d03c27d18c10d287cbfd3133b3301934d0457636.zip
implement reset button for filters
Diffstat (limited to 'Zotlabs/Widget')
-rw-r--r--Zotlabs/Widget/Activity_filter.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/Zotlabs/Widget/Activity_filter.php b/Zotlabs/Widget/Activity_filter.php
index e56d13fc1..a85ab8dc1 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);