NEW: Set MinLength and MaxLength to numeric fields

BUG: replaced spaces with tabs to meet coding conventions
This commit is contained in:
Kirk Mayo 2014-02-11 09:11:18 +13:00
parent 938d2059fa
commit be573dcd3c
2 changed files with 5 additions and 5 deletions

View File

@ -27,8 +27,7 @@ class EditableNumericField extends EditableTextField {
else {
$taf = new NumericField($this->Name, $this->Title, null, $this->getSetting('MaxLength'));
$taf->addExtraClass('number');
return $taf;
return $taf;
}
}
}

View File

@ -23,10 +23,11 @@ class EditableTextField extends EditableFormField {
$extraFields = new FieldList(
new FieldGroup(_t('EditableTextField.TEXTLENGTH', 'Text length'),
new TextField($this->getSettingName('MinLength'), "", $min),
new TextField($this->getSettingName('MaxLength'), " - ", $max)
new NumericField($this->getSettingName('MinLength'), "", $min),
new NumericField($this->getSettingName('MaxLength'), " - ", $max)
),
new TextField($this->getSettingName('Rows'), _t('EditableTextField.NUMBERROWS', 'Number of rows'), $rows)
new NumericField($this->getSettingName('Rows'), _t('EditableTextField.NUMBERROWS',
'Number of rows'), $rows)
);
$fields->merge($extraFields);