mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
Merge pull request #1214 from scott1702/clear-filter
Remove 'Filtered Tree' notification when clearing the filter
This commit is contained in:
commit
9fd0c5b0d7
@ -290,7 +290,13 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
|||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function TreeIsFiltered() {
|
public function TreeIsFiltered() {
|
||||||
return $this->getRequest()->getVar('q');
|
$query = $this->getRequest()->getVar('q');
|
||||||
|
|
||||||
|
if (!$query || (count($query) === 1 && isset($query['FilterClass']) && $query['FilterClass'] === 'CMSSiteTreeFilter_Search')) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ExtraTreeTools() {
|
public function ExtraTreeTools() {
|
||||||
@ -351,8 +357,8 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
|||||||
// Create the Search and Reset action
|
// Create the Search and Reset action
|
||||||
$actions = new FieldList(
|
$actions = new FieldList(
|
||||||
FormAction::create('doSearch', _t('CMSMain_left_ss.APPLY_FILTER', 'Apply Filter'))
|
FormAction::create('doSearch', _t('CMSMain_left_ss.APPLY_FILTER', 'Apply Filter'))
|
||||||
->addExtraClass('ss-ui-action-constructive'),
|
->addExtraClass('ss-ui-action-constructive'),
|
||||||
Object::create('ResetFormAction', 'clear', _t('CMSMain_left_ss.RESET', 'Reset'))
|
Object::create('ResetFormAction', 'clear', _t('CMSMain_left_ss.CLEAR_FILTER', 'Clear Filter'))
|
||||||
);
|
);
|
||||||
|
|
||||||
// Use <button> to allow full jQuery UI styling on the all of the Actions
|
// Use <button> to allow full jQuery UI styling on the all of the Actions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user