BUG Don't hard-code folder into treedropdownfield search hint

Fixes https://github.com/silverstripe/silverstripe-cms/issues/1518
This commit is contained in:
Damian Mooyman 2016-06-30 18:00:41 +12:00
parent f728b144ca
commit 06623537c4
No known key found for this signature in database
GPG Key ID: 78B823A10DE27D1A

View File

@ -217,11 +217,12 @@ class TreeDropdownField extends FormField {
Requirements::css(FRAMEWORK_DIR . '/thirdparty/jquery-ui-themes/smoothness/jquery-ui.css');
Requirements::css(FRAMEWORK_DIR . '/client/dist/styles/TreeDropdownField.css');
if($this->showSearch) {
$emptyTitle = _t('DropdownField.CHOOSESEARCH', '(choose folder)', 'start value of a dropdown');
} else {
$emptyTitle = _t('DropdownField.CHOOSE', '(Choose)', 'start value of a dropdown');
}
$item = DataObject::singleton($this->sourceObject);
$emptyTitle = _t(
'DropdownField.CHOOSE_MODEL',
'(Choose {name})',
['name' => $item->i18n_singular_name()]
);
$record = $this->Value() ? $this->objectForKey($this->Value()) : null;
if($record instanceof ViewableData) {