NEW: Added a numeric field and associated png

NEW: Setup translations for number field

NEW: extend fromEditableTextfield use number class
This commit is contained in:
Kirk Mayo 2014-02-10 12:40:20 +13:00
parent f90b997c29
commit 938d2059fa
3 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,34 @@
<?php
/**
* EditableNumericField
*
* This control represents a user-defined numeric field in a user defined form
*
* @package userforms
*/
class EditableNumericField extends EditableTextField {
private static $singular_name = 'Numeric Field';
private static $plural_name = 'Numeric Fields';
/**
* @return TextareaField|TextField
*/
public function getFormField() {
if($this->getSetting('Rows') && $this->getSetting('Rows') > 1) {
$taf = new NumericField($this->Name, $this->Title);
$taf->setRows($this->getSetting('Rows'));
$taf->addExtraClass('number');
return $taf;
}
else {
$taf = new NumericField($this->Name, $this->Title, null, $this->getSetting('MaxLength'));
$taf->addExtraClass('number');
return $taf;
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 B

View File

@ -102,6 +102,11 @@ en:
PLURALNAME: 'Text Fields' PLURALNAME: 'Text Fields'
SINGULARNAME: 'Text Field' SINGULARNAME: 'Text Field'
TEXTLENGTH: 'Text length' TEXTLENGTH: 'Text length'
EditableNumericField:
NUMBERROWS: 'Number of rows'
PLURALNAME: 'Number Fields'
SINGULARNAME: 'Number Field'
TEXTLENGTH: 'Number length'
EditableUploadField: EditableUploadField:
SELECTUPLOADFOLDER: 'Select upload folder' SELECTUPLOADFOLDER: 'Select upload folder'
FieldEditor: FieldEditor: