added function to add simple text input fields

This commit is contained in:
Roland Gruber 2013-03-10 14:37:03 +00:00
parent 2b94e72ec6
commit 74a5bc7e0d
1 changed files with 5 additions and 1 deletions

View File

@ -1169,14 +1169,18 @@ abstract class baseModule {
* @param String $attrName attribute name * @param String $attrName attribute name
* @param String $label label name * @param String $label label name
* @param boolean $required this is a required field (default false) * @param boolean $required this is a required field (default false)
* @param integer $length field length
*/ */
protected function addSimpleInputTextField(&$container, $attrName, $label, $required = false) { protected function addSimpleInputTextField(&$container, $attrName, $label, $required = false, $length = null) {
$value = ''; $value = '';
if (isset($this->attributes[$attrName][0])) { if (isset($this->attributes[$attrName][0])) {
$value = $this->attributes[$attrName][0]; $value = $this->attributes[$attrName][0];
} }
$input = new htmlTableExtendedInputField($label, $attrName, $value, $attrName); $input = new htmlTableExtendedInputField($label, $attrName, $value, $attrName);
$input->setRequired($required); $input->setRequired($required);
if ($length != null) {
$input->setFieldSize($length);
}
$container->addElement($input, true); $container->addElement($input, true);
} }