From 9e5af18b5c9c1b43fd56f0242f13810a81739e69 Mon Sep 17 00:00:00 2001 From: Tim Klein Date: Sun, 5 Aug 2012 17:49:16 +1200 Subject: [PATCH] FIX: ensure page type filter includes all by default. Fixes #27 --- code/CMSMain.php | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/code/CMSMain.php b/code/CMSMain.php index 0a84eb37..6c1c50db 100755 --- a/code/CMSMain.php +++ b/code/CMSMain.php @@ -214,23 +214,28 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr } return $filter_options; } - public function SiteTreeFilterDateField() { - $dateField = new DateField('SiteTreeFilterDate'); - - // TODO Enabling this means we load jQuery UI by default in the CMS, - // which is a pretty big performance hit in 2.4 (where the library isn't used for other parts - // of the interface). - // $dateField->setConfig('showcalendar', true); - - return $dateField->Field(); - } - public function SiteTreeFilterPageTypeField() { - $types = SiteTree::page_type_classes(); array_unshift($types, 'All'); - $source = array_combine($types, $types); - asort($source); - $optionsetField = new DropdownField('ClassName', 'ClassName', $source, 'Any'); - return $optionsetField->Field(); - } + + public function SiteTreeFilterDateField() { + $dateField = new DateField('SiteTreeFilterDate'); + + // TODO Enabling this means we load jQuery UI by default in the CMS, + // which is a pretty big performance hit in 2.4 (where the library isn't used for other parts + // of the interface). + // $dateField->setConfig('showcalendar', true); + + return $dateField->Field(); + } + + public function SiteTreeFilterPageTypeField() { + $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(); + } public function generateDataTreeHints() { $classes = ClassInfo::subclassesFor( $this->stat('tree_class') );