FIX: ensure page type filter includes all by default. Fixes #27

This commit is contained in:
Tim Klein 2012-08-05 17:49:16 +12:00 committed by Will Rossiter
parent 432ff1a1ea
commit 9e5af18b5c

View File

@ -214,6 +214,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
}
return $filter_options;
}
public function SiteTreeFilterDateField() {
$dateField = new DateField('SiteTreeFilterDate');
@ -224,11 +225,15 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
return $dateField->Field();
}
public function SiteTreeFilterPageTypeField() {
$types = SiteTree::page_type_classes(); array_unshift($types, 'All');
$types = SiteTree::page_type_classes();
array_unshift($types, 'Any');
$source = array_combine($types, $types);
asort($source);
$optionsetField = new DropdownField('ClassName', 'ClassName', $source, 'Any');
return $optionsetField->Field();
}