/** * @param Form $form */ public function configure(Form $form) { $form->addGroup('Settings'); $form->addText('itemsPerPage', 'Items per page'); $form->setCurrentGroup(); $form->addSaveButton('Save'); }
public function configure(Form $form) { $form->addGroup('Nastavení API'); $form->addText('accountNumber', 'Číslo účtu'); $form->setCurrentGroup(); $form->addSaveButton('Save'); }
/** * @param Form $form */ public function configure(Form $form) { $form->addManyToMany('accounts', 'Accounts'); $form->addText('itemsPerPage', 'Items per page')->addRule($form::FILLED)->addRule($form::NUMERIC); $form->setCurrentGroup(); $form->addSaveButton('Save'); }
/** * @param Form $form */ protected function configure(Form $form) { $group = $form->addGroup('Registration'); $userTypes = array(); foreach ($this->securityManager->getUserTypes() as $name => $val) { $userTypes[$name] = $val->getName(); } $registrations = $form->addDynamic('registrations', function (Container $registration) use($form, $group, $userTypes) { $group = $form->addGroup('Registration'); $registration->setCurrentGroup($group); $registration->addCheckbox('enabled', 'Enabled')->addCondition($form::EQUAL, TRUE)->toggle('reg-' . $registration->name); $registration->setCurrentGroup($registration->form->addGroup()->setOption('id', 'reg-' . $registration->name)); $registration->addText('name', 'Name'); $registration->addSelect('userType', 'Type', $userTypes); $registration->addSelect('mode', 'Mode', PageEntity::getModes())->addCondition($form::IS_IN, array(PageEntity::MODE_MAIL, PageEntity::MODE_MAIL_CHECKUP))->toggle('email-' . $registration->name); $registration->addSelect('loginProviderMode', 'Login provider mode', PageEntity::getSocialModes()); $registration->addMultiSelect('roles', 'Roles', $this->getRoles()); $email = $registration->addContainer('email'); $email->setCurrentGroup($form->addGroup()->setOption('id', 'email-' . $registration->name)); $email->addText('subject', 'Subject'); $email->addText('sender', 'Sender'); $email->addText('from', 'From'); $email->addTextArea('text', 'Text'); $registration->addSubmit('_remove', 'Remove')->addRemoveOnClick(); }, 1); $registrations->setCurrentGroup($group); $registrations->addSubmit('_add', 'Add')->addCreateOnClick(); $form->setCurrentGroup(); $form->addSaveButton('Save'); }
/** * @param Form $form */ protected function configure(Form $form) { $form->addText('name', 'Name'); $form->addSelect('file', 'File')->setItems($this->templateManager->getLayouts()); $form->setCurrentGroup(); $form->addSaveButton('Save'); }
/** * @param Form $form */ public function configure(Form $form) { $form->addGroup(); $money = $form->addRadioList('money', 'Přispívám částkou')->setItems(array('1000' => '1 000,-', '100' => '100,-', '250' => '250,-', '500' => '500,-', '2500' => '2 500,-', '5000' => '5 000,-', 'other' => 'jinou')); $money->setDefaultValue('1000')->addCondition($form::EQUAL, 'other')->toggle('group-other'); $form->addGroup()->setOption('id', 'group-other'); $form->addText('moneyOther', 'Částkou')->addConditionOn($money, $form::EQUAL, 'other')->addRule($form::INTEGER, 'Částka musí být celé kladné číslo'); $form->addGroup(); $form->addRadioList('ucely', 'Peníze použít na', array('1' => 'Nechám to na Vás', '2' => 'Kancelář', '4' => 'Internetová reklama', '8' => 'Billboardy', '16' => 'Kontaktní kampaň', '32' => 'Tiskoviny a reklamní materiály'))->setDefaultValue('1'); $person = $form->addRadioList('person', 'Osoba', array('fyzicka' => 'Fyzická osoba', 'pravnicka' => 'Právnická osoba')); $person->addRule($form::FILLED, 'Prosím vyplňte osobu'); $person->addCondition($form::EQUAL, 'fyzicka')->toggle('group-fyzicka')->endCondition()->addCondition($form::EQUAL, 'pravnicka')->toggle('group-pravnicka')->endCondition()->addCondition($form::IS_IN, array('pravnicka', 'fyzicka'))->toggle('group-next'); $fyzicka = $form->addContainer('fyzicka'); $fyzicka->setCurrentGroup($form->addGroup()->setOption('id', 'group-fyzicka')); $fyzicka->addText('name', 'Jméno a příjmení')->addConditionOn($person, $form::EQUAL, 'fyzicka')->addRule($form::FILLED, 'Prosím vyplňte jméno a příjmení'); $fyzicka->addText('bornDate', 'Datum narození')->setOption('description', '(vzor: 23.10.1980)')->addConditionOn($person, $form::EQUAL, 'fyzicka')->addRule($form::FILLED, 'Prosím vyplňte datum narození'); $pravnicka = $form->addContainer('pravnicka'); $pravnicka->setCurrentGroup($form->addGroup()->setOption('id', 'group-pravnicka')); $pravnicka->addText('name', 'Název firmy')->addConditionOn($person, $form::EQUAL, 'pravnicka')->addRule($form::FILLED, 'Prosím vyplňte název firmy'); $pravnicka->addText('person', 'Jméno a příjmení zástupce')->addConditionOn($person, $form::EQUAL, 'pravnicka')->addRule($form::FILLED, 'Prosím vyplňte jméno a příjmení zástupce'); $pravnicka->addText('IC', 'IČ')->addConditionOn($person, $form::EQUAL, 'pravnicka')->addRule($form::FILLED, 'Prosím vyplňte IČ'); $form->addGroup()->setOption('id', 'group-next'); $form->addText('street', 'Ulice a číslo popisné')->addRule($form::FILLED, 'Prosím vyplňte ulici'); $form->addText('city', 'Město / obec')->addRule($form::FILLED, 'Prosím vyplňte město / obec'); $form->addText('psc', 'PSČ')->addRule($form::FILLED, 'Prosím vyplňte PSČ'); $email = $form->addText('email', 'E-mail'); $email->addRule($form::FILLED, 'Prosím vyplňte e-mail')->addRule($form::EMAIL, 'E-mail není ve správném tvaru'); $email->controlPrototype->placeholder = '@'; $form->setCurrentGroup(); $form->addText('_captcha', 'Opište text z obrázku'); $submit = $form->addSaveButton('Odeslat'); $submit->getControlPrototype()->class = 'btn-primary btn-block'; }
/** * @param Form $form */ protected function configure(Form $form) { $form->addGroup('Basic settings'); $form->addSelect('driver', 'Driver')->setItems($this->drivers, false)->setDefaultValue('pdo_mysql'); $form['driver']->addCondition($form::IS_IN, array('pdo_mysql', 'oci8', 'pdo_oci'))->toggle('group-charset'); $form['driver']->addCondition($form::IS_IN, array('pdo_pgsql', 'pdo_mysql', 'oci8', 'pdo_oci', 'pdo_sqlsrv'))->toggle('group-connection'); $form['driver']->addCondition($form::EQUAL, 'pdo_sqlite')->toggle('group-sqlite'); $form->addGroup('Connection settings'); $form->addText('user', 'Username'); $form->addPassword('password', 'Password'); $form->addGroup()->setOption('id', 'group-connection'); $form->addText('host', 'Host'); $form->addText('port', 'Port')->getControlPrototype()->placeholder[] = 'default'; $form->addText('dbname', 'Database'); $form->addGroup()->setOption('id', 'group-sqlite'); $form->addTextWithSelect('path', 'Path')->setItems(array('%tempDir%/database.db'), false); $form->addCheckbox('memory', 'Db in memory'); $form->addGroup()->setOption('id', 'group-charset'); $form->addTextWithSelect('charset', 'Charset')->setItems(array('utf8'), false); $backups = $this->getBackups(); if (count($backups)) { $form->addGroup('Restore from backup'); $form->addSelect('_backup', 'Backup name', $backups)->setPrompt('--------'); } $form->setCurrentGroup(); $form->addSaveButton('Save'); }
/** * @param Form $form */ public function configure(Form $form) { $entity = $form->data; $form->addGroup('Supplier'); $form->addManyToOne('supplier', 'person')->addRule($form::FILLED); $form->addGroup('Customer'); $form->addManyToOne('customer', 'person')->addRule($form::FILLED); $form->addGroup('Billing information'); $form->addText('identification', 'Identification'); $form->addText('amount', 'Amount')->addRule($form::FILLED)->addRule($form::FLOAT); $form->addManyToOne('payment', 'Payment'); $form->addSelect('type', 'Type')->setItems(InvoiceEntity::getTypes()); $form->addSelect('state', 'State')->setItems(InvoiceEntity::getStates()); $form->addText('constantSymbol', 'Constant sb.'); $form->addText('variableSymbol', 'Variable sb.'); $form->addText('specificSymbol', 'Specific sb.'); $group = $form->addGroup('Items'); $recipients = $form->addMany('items', function (Container $container) use($group, $form) { $container->setCurrentGroup($group); $container->addText('name', 'Name')->addRule($form::FILLED); $container->addText('unitValue', 'Unit value')->addRule($form::FILLED)->addRule($form::FLOAT); $container->addText('units', 'Units')->addRule($form::FILLED)->addRule($form::INTEGER); $container->addText('qUnit', 'Quantity unit')->addRule($form::FILLED); $container->addText('tax', 'Tax')->addRule($form::FLOAT); $container->addCheckbox('unitValueIsTaxed', 'Value is taxed'); $container->addSubmit('remove', 'Remove')->addRemoveOnClick(); }, function () use($entity) { return new ItemEntity($entity); }); $recipients->setCurrentGroup($group); $recipients->addSubmit('add', 'Add item')->addCreateOnClick(); $form->setCurrentGroup(); $form->addSaveButton('Save'); }
/** * @param Form $form */ protected function configure(Form $form) { $form->addGroup('Administration settings'); $form->addText('routePrefix', 'Route prefix'); $form->addText('defaultPresenter', 'Default presenter'); $form->setCurrentGroup(); $form->addSaveButton('Save'); }
/** * @param Form $form */ protected function configure(Form $form) { $form->addGroup('Options'); $form->addRadioList('section', 'Section', array('all' => 'All', 'namespace' => 'Namespace', 'sessions' => 'Sessions'))->setDefaultValue('all')->addCondition($form::EQUAL, 'namespace')->toggle('namespace'); $form->addGroup('Namespace')->setOption('id', 'namespace'); $form->addText('namespace'); $form->setCurrentGroup(); $form->addSaveButton('Clear'); }
/** * @param Form $form */ public function configure(Form $form) { $form->addGroup('Options'); $form->addManyToOne('rootPage', 'Root page')->setPrompt(NULL); $form->addText('maxDepth', 'Maximal depth')->addRule($form::INTEGER); $form->addText('maxWidth', 'Maximal width')->addRule($form::INTEGER); $form->setCurrentGroup(); $form->addSaveButton('Save'); }
/** * @param Form $form */ public function configure(Form $form) { $route = $form->addOne('page')->addOne('mainRoute'); $route->setCurrentGroup($form->addGroup()->setOption('class', 'full')); $route->addContentEditor('text', NULL, NULL, 30)->getControlPrototype()->class[] = 'input-block-level'; $route['text']->getControlPrototype()->data['cms-route'] = $form->data->page->mainRoute->id; $route['text']->getControlPrototype()->data['cms-page'] = $form->data->page->id; $form->setCurrentGroup(); $form->addSaveButton('Save'); }
public function handleAttached(Form $form) { $form->setCurrentGroup(); $form->addSaveButton('Save'); if ($form->isSubmitted()) { if (!$form['user']['password_new']->value) { unset($form['user']['password']); } } }
/** * @param Form $form */ public function configure(Form $form) { $form->addText('name', 'Name'); $form->addManyToOne('account', 'Account')->addRule($form::FILLED); $form->addText('identificationFormat', 'ID format')->addRule($form::FILLED); $form->addSelect('identificationInterval', 'ID interval', AccountEntity::getIntervals())->addRule($form::FILLED); $form->addText('due', 'Invoice due')->addRule($form::FILLED)->addRule($form::INTEGER); $form->setCurrentGroup(); $form->addSaveButton('Save'); }
/** * @param Form $form */ public function configure(Form $form) { $page = $form->addOne('page'); $mainRoute = $page->addOne('mainRoute'); $mainRoute->setCurrentGroup($form->addGroup()); $mainRoute->addCheckbox('published', 'Publish'); $mainRoute->addDateTime('released', 'Release')->addRule($form::FILLED); $mainRoute->addDateTime('expired', 'Expire'); $form->setCurrentGroup(); $form->addSaveButton('Save'); }
/** * @param Form $form */ public function configure(Form $form) { $form->addGroup(); $langMode = $form->addSelect('langMode', 'Language mode', ElementEntity::getLangModes()); $langMode->addCondition($form::EQUAL, ElementEntity::LANGMODE_SPLIT)->toggle('form-group-language'); $form->setCurrentGroup($form->addGroup()->setOption('id', 'form-group-language')); $form->addManyToOne('language', 'Language')->addConditionOn($langMode, $form::EQUAL, ElementEntity::LANGMODE_SPLIT)->addRule($form::FILLED); $form->addGroup(); $mode = $form->addSelect('mode', 'Share data with', ElementEntity::getModes()); $mode->addCondition($form::IS_IN, array(1))->toggle('form-group-layout')->endCondition()->addCondition($form::IS_IN, array(2, 4))->toggle('form-group-page')->endCondition()->addCondition($form::EQUAL, 4)->toggle('form-group-route'); $form->addGroup()->setOption('id', 'form-group-layout'); $form->addManyToOne('layout', 'Layout')->addConditionOn($mode, $form::IS_IN, array(1))->addRule($form::FILLED); $form->addGroup()->setOption('id', 'form-group-page'); $page = $form->addManyToOne('page', 'Page'); $page->addConditionOn($mode, $form::IS_IN, array(2, 4))->addRule($form::FILLED); $form->addGroup()->setOption('id', 'form-group-route'); $form->addManyToOne('route', 'Route')->setDependOn($page, 'page')->addConditionOn($mode, $form::EQUAL, 4)->addRule($form::FILLED); $form->setCurrentGroup(); $form->addSaveButton('Save'); }
/** * @param Form $form */ public function configure(Form $form) { $form->addGroup(); $form->addText('name', 'Name'); $form->addText('localUrl', 'URL'); $form->addText('title', 'Title'); $form->addText('keywords', 'Keywords'); $form->addText('description', 'Description'); $form->addManyToOne('author', 'Author'); $form->addSelect('robots', 'Robots')->setItems(RouteEntity::getRobotsValues(), FALSE); $form->addSelect('changefreq', 'Change frequency')->setItems(RouteEntity::getChangefreqValues(), FALSE)->setPrompt('-------'); $form->addSelect('priority', 'Priority')->setItems(RouteEntity::getPriorityValues(), FALSE)->setPrompt('-------'); // layout $form->setCurrentGroup($form->addGroup()); $form->addCheckbox('copyLayoutFromParent', 'Layout from parent'); $form['copyLayoutFromParent']->addCondition($form::EQUAL, FALSE)->toggle('group-layout_' . $form->data->id); $form->setCurrentGroup($form->getForm()->addGroup()->setOption('id', 'group-layout_' . $form->data->id)); $form->addManyToOne('layout', 'Layout'); $form->setCurrentGroup($form->addGroup()); $form->addCheckbox('copyLayoutToChildren', 'Share layout with children'); $form['copyLayoutToChildren']->addCondition($form::EQUAL, FALSE)->toggle('group-layout2_' . $form->data->id); $form->setCurrentGroup($form->getForm()->addGroup()->setOption('id', 'group-layout2_' . $form->data->id)); $form->addManyToOne('childrenLayout', 'Share new layout'); // cache $form->setCurrentGroup($form->addGroup()); $form->addCheckbox('copyCacheModeFromParent', 'Cache mode from parent'); $form['copyCacheModeFromParent']->addCondition($form::EQUAL, FALSE)->toggle('group-cache_' . $form->data->id); $form->setCurrentGroup($form->getForm()->addGroup()->setOption('id', 'group-cache_' . $form->data->id)); $form->addSelect('cacheMode', 'Cache strategy')->setItems(\CmsModule\Content\Entities\RouteEntity::getCacheModes(), FALSE)->setPrompt('off'); $form->setCurrentGroup($form->addGroup()); $form->addFileEntityInput('photo', 'Photo'); $form->addTextArea('notation', 'Notation'); $form->addTextArea('text', 'Text'); $form->addGroup('Dates'); $form->addDateTime('created', 'Created')->setDisabled(TRUE); $form->addDateTime('updated', 'Updated')->setDisabled(TRUE); $form->addDateTime('released', 'Released')->addRule($form::FILLED); $form->addDateTime('expired', 'Expired'); $form->addGroup('Tags'); $form->addContentTags('tags'); $aliases = $form->addMany('aliases', function (\Venne\Forms\Container $container) use($form) { $container->setCurrentGroup($form->addGroup('URL alias')); $container->addText('aliasUrl', 'Url')->setRequired(); $container->addText('aliasLang', 'Language alias'); $container->addText('aliasDomain', 'Domain url'); $container->addSubmit('remove', 'Remove alias')->addRemoveOnClick(); }); $aliases->addSubmit('add', 'Add alias')->addCreateOnClick(); $form->setCurrentGroup(); $form->addSaveButton('Save'); }
/** * @param Form $form */ protected function configure(Form $form) { $form->addGroup('Admin account'); $form->addText('name', 'Name'); $form->addPassword('password', 'Password')->setOption('description', 'minimal length is 5 char'); $form->addPassword('_password', 'Confirm password'); $form['name']->addRule($form::FILLED, 'Enter name'); $form['password']->addRule($form::FILLED, 'Enter password')->addRule($form::MIN_LENGTH, 'Password is short', 5); $form['_password']->addRule($form::EQUAL, 'Invalid re password', $form['password']); $form->setCurrentGroup(); $form->addSaveButton('Save'); }
/** * @param Form $form */ protected function configure(Form $form) { $form->addGroup(); $user = $form->addOne('user'); $user->addMany('loginProviders', function (\Venne\Forms\Container $container) use($form) { $container->setCurrentGroup($form->addGroup($container->data->type)); $container->addSelect('type', 'Type')->setItems($this->securityManager->getLoginProviders(), false); $container->addText('uid', 'UID'); $container->addSubmit('remove', 'Remove')->addRemoveOnClick(); }); $form->setCurrentGroup(); $form->addSaveButton('Save'); }
/** * @param Form $form */ protected function configure(Form $form) { $form->addGroup(); $form->addSelect('type', 'Type')->setItems(array('presenter', 'component'), FALSE)->addCondition($form::EQUAL, 'presenter')->toggle($form->name . '-presenter')->endCondition()->addCondition($form::EQUAL, 'component')->toggle($form->name . '-component'); $form->addGroup()->setOption('id', $form->name . '-presenter'); $form->addSelect('presenter', 'Presenter'); $form->addGroup()->setOption('id', $form->name . '-component'); $form->addSelect('component', 'Component'); $form->addGroup('Target'); $form->addSelect('target', 'Target module')->setTranslator(NULL)->setItems(array_keys($this->modules), FALSE)->getControlPrototype()->onChange = 'this.form.submit();'; $form->addSelect('layout', 'Target layout'); $form->setCurrentGroup(); $form->addSaveButton('Save'); }
/** * @param Form $form */ public function configure(Form $form) { $route = $form->addContainer('mainRoute'); $group = $form->addGroup('Settings'); $form->addText('name', 'Name')->addRule($form::FILLED); $route->setCurrentGroup($group); $route->addTextArea('notation', 'Notation'); $form->addText('items', 'Items')->addRule($form::FILLED)->addRule($form::INTEGER); $form->addGroup('Target'); $form->addSelect('class', 'Route type', $this->getClasses())->setPrompt('--------'); $form->addManyToMany('targetPages', 'Target pages'); $form->setCurrentGroup(); $form->addSaveButton('Save'); }
/** * @param Form $form */ public function configure(Form $form) { $form->addGroup('Redirection'); $form->addRadioList('type', 'Type', array('page' => 'Page', 'url' => 'URL')); $form['type']->addCondition($form::EQUAL, 'page')->toggle('page'); $form['type']->addCondition($form::EQUAL, 'url')->toggle('url'); $form['type']->getControlPrototype()->onClick = 'if( $(this).val() == "page" ) { $("#url").find("input").val("") } else ( $("#page").find("select").val("") );'; $form->addGroup()->setOption('id', 'url'); $form->addText('redirectUrl', 'URL'); $form->addGroup()->setOption('id', 'page'); $form->addManyToOne('redirect', 'Page'); $form->setCurrentGroup(); $form->addSaveButton('Save'); }
/** * @param Form $form */ public function configure(Form $form) { $form->addGroup('Settings'); $form->addSelect('mode', 'Registration mode', PageEntity::getModes())->addCondition($form::IS_IN, array(PageEntity::MODE_MAIL, PageEntity::MODE_MAIL_CHECKUP))->toggle('form-group-email'); $form->addSelect('socialMode', 'Login provider mode', PageEntity::getSocialModes()); $form->addSelect('userType', 'User type', $this->getUserTypes()); $form->addManyToMany('roles', 'Roles for new user'); $form->addGroup('E-mail')->setOption('id', 'form-group-email'); $form->addText('mailFrom', 'From')->addConditionOn($form['mode'], $form::IS_IN, array(PageEntity::MODE_MAIL, PageEntity::MODE_MAIL_CHECKUP))->addRule($form::EMAIL); $form->addText('sender', 'Sender'); $form->addText('subject', 'Subject'); $form->addEditor('email', 'E-mail body'); $form->setCurrentGroup(); $form->addSaveButton('Save'); }
/** * @param Form $form */ public function configure(Form $form) { $form->addGroup('Kontakty'); $form->addText('position', 'Pozice'); $form->addText('city', 'Město'); $form->addText('street', 'Ulice'); $form->addText('zip', 'PSČ'); $form->addText('phone', 'Telefon'); $form->addText('email', 'E-mail'); $form->addText('account', 'Číslo účtu'); $form->addGroup('Sociální sítě'); $form->addText('fb', 'Facebook'); $form->setCurrentGroup(); $form->addSaveButton('Save'); }
/** * @param Form $form */ public function configure(Form $form) { $form->addGroup('Settings'); $form->addManyToOne('registration', 'Register by'); $form->addGroup('Forgot password'); $enabled = $form->addCheckbox('resetEnabled', 'Enabled'); $enabled->addCondition($form::EQUAL, TRUE)->toggle('form-reset'); $form->addGroup()->setOption('id', 'form-reset'); $form->addText('resetSubject', 'Subject')->addConditionOn($enabled, $form::EQUAL, TRUE)->addRule($form::FILLED); $form->addText('resetSender', 'Sender')->addConditionOn($enabled, $form::EQUAL, TRUE)->addRule($form::FILLED); $form->addText('resetFrom', 'From')->addConditionOn($enabled, $form::EQUAL, TRUE)->addRule($form::FILLED)->addRule($form::EMAIL); $form->addTextArea('resetText', 'Text')->addConditionOn($enabled, $form::EQUAL, TRUE)->addRule($form::FILLED); $form->setCurrentGroup(); $form->addSaveButton('Save'); }
/** * @param Form $form */ protected function configure(Form $form) { $form->addGroup(); $form->addSelect('target', 'Target module')->setTranslator(NULL)->setItems(array_keys($this->modules), FALSE); $form->addSelect('type', 'Type', $this->types)->addCondition($form::EQUAL, self::TYPE_LAYOUT)->toggle('form-layout')->endCondition()->addCondition($form::EQUAL, self::TYPE_TEMPLATE)->toggle('form-template'); $form->addGroup()->setOption('id', 'form-layout'); $form->addText('layoutName', 'Layout'); $form->addGroup()->setOption('id', 'form-template'); $form->addSelect('layout', 'Layout'); $form->addText('template', 'Template'); $form->addGroup('Template')->setOption('class', 'full'); $form->addCode('text', NULL, NULL, 30)->getControlPrototype()->attrs['class'] = 'input-block-level'; $form->setCurrentGroup(); $form->addSaveButton('Save'); }
public function configure(Form $form) { $form->addGroup('Nastavení API'); $form->addText('apiUrl', 'URL pro api'); if ($form->getData()->getApiUrl()) { $apiClient = $this->apiClientFactory->create($form->getData()->getApiUrl()); $data = $apiClient->callApi('/bodies.json'); $items = array(); foreach ($data['bodies'] as $organ) { $items[$organ['id']] = $organ['name']; } $form->addSelect('section', 'Sekce', $items); } $form->setCurrentGroup(); $form->addSaveButton('Save'); }
/** * @param Form $form */ protected function configure(Form $form) { $form->addGroup('Mailer'); $smtp = $form->addCheckbox('smtp', 'Use SMTP'); $smtp->addCondition($form::EQUAL, TRUE)->toggle('form-smtp'); $form->addGroup()->setOption('id', 'form-smtp'); $form->addText('host', 'Host')->addConditionOn($smtp, $form::EQUAL, TRUE)->addRule($form::FILLED, 'Enter host'); $form->addText('port', 'Port')->addConditionOn($smtp, $form::EQUAL, TRUE)->addCondition($form::FILLED)->addRule($form::INTEGER, 'Enter number format'); $form['port']->setOption('placeholder', '25'); $form->addSelect('secure', 'Secure', array('ssl' => 'ssl', 'tls' => 'tls'))->setPrompt('-----'); $form->addText('username', 'Username')->addConditionOn($smtp, $form::EQUAL, TRUE)->addCondition($form::FILLED)->addRule($form::EMAIL, 'Enter email address'); $form->addPassword('password', 'Password'); $form->addText('timeout', 'Timeout')->addConditionOn($smtp, $form::EQUAL, TRUE)->addCondition($form::FILLED)->addRule($form::INTEGER, 'Enter number format'); $form->setCurrentGroup(); $form->addSaveButton('Save'); }
/** * @param Form $form */ protected function configure(Form $form) { $form->addGroup(); $form->addText('name', 'Name'); if ($form->data->id) { $form->addManyToOne('parent', 'Parent')->setCriteria(array('invisible' => FALSE))->setOrderBy(array('path' => 'ASC')); } $form->addGroup('Permissions'); $form->addManyToOne('author', 'Owner'); $form->addManyToMany('write', 'Write'); $form->addManyToMany('read', 'Read'); $form->addCheckbox('protected', 'Protected'); $form->addCheckbox('recursively', 'Change recursively'); $form->setCurrentGroup(); $form->addSaveButton('Save'); }
/** * @param Form $form */ public function configure(Form $form) { $form->addGroup(); $form->addText('name', 'Name')->addRule($form::FILLED, 'Please set name'); $form->addTextArea('notation', 'Notation', NULL, 3); $form->addGroup('Langauge variants'); $languages = $form->addContainer('languages'); foreach ($this->getLanguageRepository()->findBy(array(), array('id' => 'ASC'), NULL, 1) as $language) { $c = $form->addCheckbox('lang_' . $language->id, (string) $language); $lang = $languages->addContainer($language->id); $lang->setCurrentGroup($form->addGroup($language->name)->setOption('id', 'group-' . $language->id)); $lang->addText('name', 'Name')->addConditionOn($c, $form::EQUAL, TRUE)->addRule($form::FILLED); $lang->addTextArea('notation', 'Notation', NULL, 3); $c->addCondition($form::EQUAL, TRUE)->toggle('group-' . $language->id); } $form->setCurrentGroup(); $form->addSaveButton('Save'); }