Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MINOR Use of DropdownField in CMS should call setEmptyString instead of

use the $emptyString argument, as it's deprecated.
  • Loading branch information...
commit d9ee61c4a3e0d1f165f7c32f857b2d37352af496 1 parent 542d727
Sean Harvey halkyon authored
Showing with 14 additions and 16 deletions.
  1. +7 −7 code/controllers/AssetAdmin.php
  2. +7 −9 code/controllers/CMSMain.php
14 code/controllers/AssetAdmin.php
View
@@ -304,7 +304,7 @@ public function getSearchContext() {
foreach($context->getFields() as $field) $field->setName(sprintf('q[%s]', $field->getName()));
foreach($context->getFilters() as $filter) $filter->setFullName(sprintf('q[%s]', $filter->getFullName()));
- // Customize fields
+ // Customize fields
$appCategories = array(
'image' => _t('AssetAdmin.AppCategoryImage', 'Image'),
'audio' => _t('AssetAdmin.AppCategoryAudio', 'Audio'),
@@ -313,17 +313,17 @@ public function getSearchContext() {
'zip' => _t('AssetAdmin.AppCategoryArchive', 'Archive', 'A collection of files'),
);
$context->addField(
- new DropdownField(
+ $typeDropdown = new DropdownField(
'q[AppCategory]',
_t('AssetAdmin.Filetype', 'File type'),
- $appCategories,
- null,
- null,
- ' '
+ $appCategories
)
);
+
+ $typeDropdown->setEmptyString(' ');
+
$context->addField(
- new CheckboxField('q[CurrentFolderOnly]' ,_t('AssetAdmin.CurrentFolderOnly', 'Limit to current folder?'))
+ new CheckboxField('q[CurrentFolderOnly]', _t('AssetAdmin.CurrentFolderOnly', 'Limit to current folder?'))
);
$context->getFields()->removeByName('q[Title]');
16 code/controllers/CMSMain.php
View
@@ -280,23 +280,21 @@ function SearchForm() {
$dateTo = new DateField('q[LastEditedTo]', _t('CMSSearch.FILTERDATETO', 'To'))
),
new DropdownField(
- 'q[FilterClass]',
- _t('CMSMain.PAGES', 'Pages'),
+ 'q[FilterClass]',
+ _t('CMSMain.PAGES', 'Pages'),
$filterMap
),
- new DropdownField(
- 'q[ClassName]',
- _t('CMSMain.PAGETYPEOPT','Page Type', 'Dropdown for limiting search to a page type'),
- $pageTypes,
- null,
- null,
- _t('CMSMain.PAGETYPEANYOPT','Any')
+ $classDropdown = new DropdownField(
+ 'q[ClassName]',
+ _t('CMSMain.PAGETYPEOPT','Page Type', 'Dropdown for limiting search to a page type'),
+ $pageTypes
)
// new TextField('MetaTags', _t('CMSMain.SearchMetaTags', 'Meta tags'))
);
$dateGroup->subfieldParam = 'FieldHolder';
$dateFrom->setConfig('showcalendar', true);
$dateTo->setConfig('showcalendar', true);
+ $classDropdown->setEmptyString(_t('CMSMain.PAGETYPEANYOPT','Any'));
$actions = new FieldList(
FormAction::create('doSearch', _t('CMSMain_left.ss.APPLY FILTER', 'Apply Filter'))
Please sign in to comment.
Something went wrong with that request. Please try again.