protected function _initColumns() { $this->_columns->add(new Kwf_Grid_Column('pos')); $this->_columns->add(new Kwf_Grid_Column_Visible()); for ($i = 1; $i <= $this->_getComponent()->chained->getComponent()->getColumnCount(); $i++) { $this->_columns->add(new Kwf_Grid_Column("column{$i}" . "data"))->setData(new Kwc_Basic_Table_Trl_ControllerIsTrlData("column{$i}")); $ed = new Kwf_Form_Field_TextField(); $ed->setAllowTags(true); $this->_columns->add(new Kwf_Grid_Column("column{$i}", $this->_getColumnLetterByIndex($i - 1), 150))->setRenderer('tableTrl')->setEditor($ed); } }
public function testValidate() { $model = new Kwf_Model_FnF(); $row = $model->createRow(); $this->assertEquals(array(), $this->_textField->validate($row, array('test12' => 'foobar'))); // eigenes feld weil beim vorigen _addValidators schon augerufen wurde $newTextField = new Kwf_Form_Field_TextField('test123'); $newTextField->setVtype('email'); $this->assertEquals(1, count($newTextField->validate($row, array('test123' => 'foobar')))); $this->assertEquals(0, count($newTextField->validate($row, array('test123' => '*****@*****.**')))); }
protected function _getValueFromPostData($postData) { $ret = parent::_getValueFromPostData($postData); $punycode = new Kwf_Util_Punycode(); $ret = $punycode->encode($ret); 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; }
protected function _initColumns() { $component = Kwf_Component_Data_Root::getInstance()->getComponentByDbId($this->_getParam('componentId'), array('ignoreVisible' => true, 'limit' => 1)); $maxColumns = Kwc_Abstract::getSetting($component->componentClass, 'maxColumns'); $sel = new Kwf_Form_Field_Select(); $rowStyles = Kwc_Abstract::getSetting($this->_getParam('class'), 'rowStyles'); $rowStylesSelect = array(); foreach ($rowStyles as $k => $rowStyle) { $rowStylesSelect[$k] = $rowStyle['name']; } $sel->setValues($rowStylesSelect); $sel->setShowNoSelection(true); $this->_columns->add(new Kwf_Grid_Column_Visible()); $this->_columns->add(new Kwf_Grid_Column('css_style', trlKwf('Style'), 100))->setEditor($sel); for ($i = 1; $i <= $maxColumns; $i++) { $ed = new Kwf_Form_Field_TextField(); $ed->setAllowTags(true); $this->_columns->add(new Kwf_Grid_Column("column{$i}", $this->_getColumnLetterByIndex($i - 1), 150))->setEditor($ed); } }
protected function _addValidators() { parent::_addValidators(); unset($this->_validators['noNewline']); }
public function __construct($field_name = null, $field_label = null) { parent::__construct($field_name, $field_label); $this->setInputType('password'); }
protected function _initColumns() { $editor = new Kwf_Form_Field_TextField(); $editor->addValidator(new Kwf_Validate_Row_Unique()); $this->_columns->add(new Kwf_Grid_Column('name', trlKwf('Name'), 200))->setEditor($editor); }
protected function _addValidators() { parent::_addValidators(); $this->addValidator(new Kwc_User_LostPassword_Form_ValidateEMail()); }
public function getTemplateVars($values, $fieldNamePostfix = '', $idPrefix = '') { $ret = parent::getTemplateVars($values, $fieldNamePostfix, $idPrefix); //add additional hidden input field for frontend forms so we know the posted value is from frontend and formatted like current locale $ret['html'] .= "\n<input type=\"hidden\" name=\"" . $this->getFieldName() . $fieldNamePostfix . "-format\" value=\"fe\" />"; return $ret; }