protected function _init()
 {
     parent::_init();
     $this->setLabelWidth(150);
     $this->add(new Kwf_Form_Field_TextField('url', trl('Application URL')))->setWidth(500)->setAllowBlank(false);
     $this->add(new Kwf_Form_Field_ShowField('template_url', trl('HTML Template URL')))->setWidth(500)->setData(new Kwc_Advanced_IntegratorTemplate_FormData());
 }
 public function testOrderDropdown()
 {
     $acl = new Kwf_Acl();
     $acl->add(new Kwf_Acl_Resource_MenuDropdown('fooBar', array('text' => trl('FooBar'), 'icon' => 'heart.png')));
     $acl->add(new Kwf_Acl_Resource_MenuUrl('foo', array('text' => 'Foo', 'icon' => 'heart.png', 'order' => 1), '/admin/foo'), 'fooBar');
     $acl->add(new Kwf_Acl_Resource_MenuUrl('bar', array('text' => 'Bar', 'icon' => 'heart.png'), '/admin/bar'), 'fooBar');
     $acl->allow(null, 'fooBar');
     $config = $acl->getMenuConfig(null);
     $this->assertEquals('Bar', $config[0]['children'][0]['menuConfig']['text']);
 }
Beispiel #3
0
 protected function _init()
 {
     $this->setModel(new Kwf_Model_FnF());
     $this->add(new Kwf_Form_Field_TextField('fullname', 'Name'))->setAllowBlank(false);
     $cards = $this->fields->add(new Kwf_Form_Container_Cards('type', trl('Example')));
     $cards->getCombobox()->setDefaultValue('foo');
     $card = $cards->add();
     $card->setName('foo');
     $card->setTitle('Foo');
     $card->fields->add(new Kwf_Form_Field_TextField('foo_value', trl('Foo')))->setAllowBlank(false);
     $card = $cards->add();
     $card->setName('bar');
     $card->setTitle('Bar');
     $card->fields->add(new Kwf_Form_Field_TextField('bar_value', trl('Bar')))->setAllowBlank(false);
     parent::_init();
 }
 protected function _initFields()
 {
     $cards = $this->_form->add(new Kwf_Form_Container_Cards('type', trlKwf('Type')));
     $cards->setCombobox(new Kwf_Form_Field_Radio('type', trlKwf('Type')));
     $card = $cards->add();
     $card->setTitle('foocard');
     $card->setName("foo");
     $card->add(new Kwf_Form_Field_TextField('comment', 'Comment'));
     $card = $cards->add();
     $card->setTitle('barcard');
     $card->setName("bar");
     $fieldset = $card->add(new Kwf_Form_Container_FieldSet(trl('Fieldset legend')));
     $mf = $fieldset->add(new Kwf_Form_Field_MultiFields('ToRelation'));
     $mf->setMinEntries(0);
     $mf->fields->add(new Kwf_Form_Field_Select('data_id', 'Select Value'))->setValues(array(array('id' => 1, 'value' => 'v1'), array('id' => 2, 'value' => 'v2'), array('id' => 3, 'value' => 'v3')))->setEditable(true)->setForceSelection(true)->setAllowBlank(false);
 }