protected function _initFields() { parent::_initFields(); $fs = new Kwf_Form_Container_FieldSet(trlKwf('Form Properties')); $fs->add(new Kwf_Form_Field_TextField('subject', trlKwf('E-Mail Subject')))->setWidth(400); $fs->add(new Kwf_Form_Field_TextField('submit_caption', trlKwf('Submit Caption')))->setWidth(400); $this->add($fs); $hiddenField = new Kwf_Form_Field_Hidden('send_confirm_mail'); $hiddenField->setData(new Kwc_Form_Dynamic_Trl_Data()); $cards = new Kwf_Form_Container_Cards(); $cards->setCombobox($hiddenField); $card = $cards->add(new Kwf_Form_Container_Card()); $card->setName('0'); $card = $cards->add(new Kwf_Form_Container_Card()); $card->setName('1'); $fs = $card->add(new Kwf_Form_Container_FieldSet(trlKwf('Send copy to User'))); $fs->add(new Kwf_Form_Field_TextField('confirm_subject', trlKwf('Subject')))->setWidth(300)->setAllowBlank(false); $this->add($cards); }
protected function _init() { parent::_init(); $gen = Kwc_Abstract::getSetting($this->getClass(), 'generators'); $classes = $gen['child']['component']; $cards = $this->add(new Kwf_Form_Container_Cards('component', trlKwf('Type')))->setDefaultValue(key($classes)); $hidden = new Kwf_Form_Field_Hidden('component'); $hidden->setData(new Kwc_Abstract_Cards_Trl_Form_ComponentData()); $cards->setCombobox($hidden); foreach ($classes as $name => $class) { $form = Kwc_Abstract_Form::createChildComponentForm($this->getClass(), '-' . $name, $name); if ($form) { $form->setIdTemplate('{0}-child'); $form->setAutoHeight(true); $form->setBaseCls('x2-plain'); } $card = $cards->add(); $card->setName($name); if ($form) { $card->add($form); } } }