added function to add simple text input fields
This commit is contained in:
parent
981cf628a8
commit
11e0c84be4
|
@ -1160,6 +1160,26 @@ abstract class baseModule {
|
||||||
*/
|
*/
|
||||||
public abstract function display_html_attributes();
|
public abstract function display_html_attributes();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds a simple text input field to the given htmlTable.
|
||||||
|
* The field name will be the same as the attribute name. There must also be a help entry with the attribute name as ID.
|
||||||
|
* A new line will also be added after this entry so multiple calls will show the fields one below the other.
|
||||||
|
*
|
||||||
|
* @param htmlTable $container parent container
|
||||||
|
* @param String $attrName attribute name
|
||||||
|
* @param String $label label name
|
||||||
|
* @param boolean $required this is a required field (default false)
|
||||||
|
*/
|
||||||
|
protected function addSimpleInputTextField(&$container, $attrName, $label, $required = false) {
|
||||||
|
$value = '';
|
||||||
|
if (isset($this->attributes[$attrName][0])) {
|
||||||
|
$value = $this->attributes[$attrName][0];
|
||||||
|
}
|
||||||
|
$input = new htmlTableExtendedInputField($label, $attrName, $value, $attrName);
|
||||||
|
$input->setRequired($required);
|
||||||
|
$container->addElement($input, true);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of managed object classes for this module.
|
* Returns a list of managed object classes for this module.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue