diff options
Diffstat (limited to 'ui/include/classes/services/CTabFilterProfile.php')
-rw-r--r-- | ui/include/classes/services/CTabFilterProfile.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ui/include/classes/services/CTabFilterProfile.php b/ui/include/classes/services/CTabFilterProfile.php index b05218c0436..34a3b14bb7b 100644 --- a/ui/include/classes/services/CTabFilterProfile.php +++ b/ui/include/classes/services/CTabFilterProfile.php @@ -71,6 +71,11 @@ class CTabFilterProfile { */ public $filter_defaults; + /** + * Is selected tab modified by user input. + */ + public $modified = false; + public function __construct($idx, array $filter_defaults) { $this->namespace = $idx; $this->tabfilters = []; @@ -180,6 +185,11 @@ class CTabFilterProfile { unset($input['filter_name']); } + $this->modified = array_diff_assoc( + array_map('serialize', CArrayHelper::unsetEqualValues($input, $this->filter_defaults)), + array_map('serialize', $this->tabfilters[$this->selected]) + ); + $input += $this->filter_defaults; $input['filter_show_counter'] = (int) $input['filter_show_counter']; $input['filter_custom_time'] = (int) $input['filter_custom_time']; |