[BUGFIX] EM using filter in filter menu isn't clear enough
authorSteffen Kamper <info@sk-typo3.de>
Tue, 8 Mar 2011 11:44:07 +0000 (12:44 +0100)
committerSteffen Kamper <info@sk-typo3.de>
Tue, 22 Mar 2011 10:55:24 +0000 (11:55 +0100)
When checking one of the filter provided by the filter button menu, it gets printed bold.
However this seems not clear enough for many users, so display the "Clear filters" button would make it more clear.

Change-Id: I7345ab182fd5879ca18b2bf131c8c860f71def1f
Resolves: #M17892
Reviewed-on: http://review.typo3.org/1093
Reviewed-by: Peter Beernink <p.beernink@drecomm.nl>
Tested-by: Peter Beernink <p.beernink@drecomm.nl>
Reviewed-by: Markus Klein <klein.t3@mfc-linz.at>
Tested-by: Markus Klein <klein.t3@mfc-linz.at>
Reviewed-by: Steffen Kamper <info@sk-typo3.de>
Tested-by: Steffen Kamper <info@sk-typo3.de>
typo3/sysext/em/res/js/em_locallist.js

index 1d14dfc..d683a56 100644 (file)
@@ -359,7 +359,7 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                                },
                                datachanged: function(store) {
                                        Ext.getCmp('displayExtensionLabel').setText(TYPO3.lang.extensions + ' ' + store.data.length);
-                                       var hasFilters = false;
+                                       var hasFilters = store.hasStoreFilter();
                                        TYPO3.EM.Filters.filters.each(function (filter) {
                                                if (filter.active) {
                                                        hasFilters = true;
@@ -413,6 +413,21 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                                return true;
                        },
 
+                       hasStoreFilter: function() {
+                               return (TYPO3.settings.EM.hide_obsolete || TYPO3.settings.EM.hide_shy || TYPO3.settings.EM.display_installed);
+                       },
+
+                       clearStoreFilters: function(scope) {
+                               Ext.each(scope.filterMenuButton.menu.items.items, function(item) {
+                                       item.setChecked(false, true);
+                               });
+                               TYPO3.settings.EM.hide_obsolete = TYPO3.settings.EM.hide_shy = TYPO3.settings.EM.display_installed = 0;
+                               TYPO3.EM.ExtDirect.saveSetting('display_installed', 0);
+                               TYPO3.EM.ExtDirect.saveSetting('hide_shy', 0);
+                               TYPO3.EM.ExtDirect.saveSetting('hide_obsolete', 0);
+                               scope.filterRecords();
+                       },
+
                        highlightSearch: function(value) {
                                var control = Ext.getCmp('localSearchField');
                                if (control) {
@@ -533,6 +548,7 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                                        text: TYPO3.lang.cmd_ClearAllFilters,
                                        ref: '../doClearFilters',
                                        handler: function() {
+                                               this.localstore.clearStoreFilters(this);
                                                TYPO3.EM.Filters.clearFilters();
                                        },
                                        scope: this,