/
Component.php
27 lines (26 loc) · 1015 Bytes
/
Component.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
class Kwc_Form_Field_TextField_Component extends Kwc_Form_Field_Abstract_Component
{
public static function getSettings($param = null)
{
$ret = parent::getSettings($param);
$ret['componentName'] = trlKwfStatic('Form.Textfield');
$ret['componentIcon'] = 'textfield';
return $ret;
}
protected function _getFormField()
{
$ret = new Kwf_Form_Field_TextField($this->getData()->componentId);
$ret->setFieldLabel($this->getRow()->field_label);
if ($this->getRow()->label_width) $ret->setLabelWidth($this->getRow()->label_width);
$ret->setWidth($this->getRow()->width);
$ret->setDefaultValue($this->getRow()->default_value);
$ret->setAllowBlank(!$this->getRow()->required);
$ret->setHideLabel($this->getRow()->hide_label);
$ret->setVtype($this->getRow()->vtype);
if ($this->getRow()->label_position_above) {
$ret->setLabelPosition('above');
}
return $ret;
}
}