/** * @param Form $form */ public function configure(Form $form) { $form->addGroup('Person'); $form->addSelect('type', 'Person', PersonEntity::getTypes()); $form->addText('name', 'Name'); $form->addFileEntityInput('logo', 'Logo'); $form->addManyToMany('users', 'Users'); $form->addTextArea('description', 'Description'); $form->addGroup('Address'); $form->addText('street', 'Street'); $form->addText('number', 'Number'); $form->addText('city', 'City'); $form->addText('zip', 'ZIP'); $form->addGroup('Contacts'); $form->addText('email', 'Email')->addCondition($form::FILLED)->addRule($form::EMAIL); $form->addText('phone', 'Phone'); $form->addText('fax', 'Fax'); $form->addText('website', 'Website')->addCondition($form::FILLED)->addRule($form::URL); $form->addGroup('Billing information'); $form->addText('identificationNumber', 'IN'); $form->addText('taxIdentificationNumber', 'TIN'); $form->addText('registration', 'Registration'); $form->addCheckbox('taxpayer', 'Taxpayer'); $form->addFileEntityInput('signature', 'Signature'); $form->addSaveButton('Save'); }
/** * @param Form $form */ public function configure(Form $form) { $form->addTextWithSelect('name', 'Name')->setItems(array('English', 'Deutsch', 'Čeština'), false)->setOption('description', '(english, deutsch,...)')->addRule($form::FILLED, 'Please set name'); $form->addTextWithSelect('short', 'Short')->setItems(array('en', 'de', 'cs'), false)->setOption('description', '(en, de,...)')->addRule($form::FILLED, 'Please set short'); $form->addTextWithSelect('alias', 'Alias')->setItems(array('en', 'de', 'cs', 'www'), false)->setOption('description', '(www, en, de,...)')->addRule($form::FILLED, 'Please set alias'); $form->addSaveButton('Save'); }
/** * @param Form $form */ public function configure(Form $form) { $container = $form->addContainer('_inputs'); $container->setCurrentGroup($form->addGroup()); $container->addText('_email', 'E-mail')->addRule($form::EMAIL)->setRequired(true); $container->addText('_name', 'Name')->setRequired(true); foreach ($form->data->inputs as $key => $input) { if ($input->getType() === InputEntity::TYPE_GROUP) { $container->setCurrentGroup($form->addGroup($input->getLabel())); continue; } $control = $container->add($input->getType(), 'input_' . $key, $input->getLabel()); if ($input->required) { $control->setRequired(true); } if (in_array($input->getType(), array(InputEntity::TYPE_SELECT, InputEntity::TYPE_CHECKBOX_LIST, InputEntity::TYPE_RADIO_LIST))) { $items = array(); foreach ($input->getItems() as $item) { $items[$item] = $item; } $control->setItems($items); } } $form->addGroup(); $form->addSaveButton('Send'); }
/** * @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->addManyToMany('accounts', 'Accounts'); $form->addText('itemsPerPage', 'Items per page')->addRule($form::FILLED)->addRule($form::NUMERIC); $form->setCurrentGroup(); $form->addSaveButton('Save'); }
public function configure(Form $form) { $form->addGroup('Nastavení API'); $form->addText('accountNumber', 'Číslo účtu'); $form->setCurrentGroup(); $form->addSaveButton('Save'); }
public function configure(Form $form) { $group = $form->addGroup(); $form->addText('name', 'Name'); $form->addOne('route')->setCurrentGroup($group)->addTextArea('notation', 'Description', NULL, 4); $form->addSaveButton('Save'); }
/** * @param Form $form */ public function configure(Form $form) { $form->addText('startDepth', 'Start depth')->addCondition($form::FILLED)->addRule($form::INTEGER); $form->addText('maxDepth', 'Max depth')->addCondition($form::FILLED)->addRule($form::INTEGER); $form->addManyToOne('root', 'Root page'); $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 */ public function configure(Venne\Forms\Form $form) { $form->addGroup('Template'); $form->addTextArea('template', 'Product template')->getControlPrototype()->attrs['class'] = 'input-block-level'; $form->addMailform('mailform'); $form->addSaveButton('Save'); }
/** * @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) { $form->addText('itemsPerPage', 'Items per page'); $form->addManyToMany('pages', 'Pages'); $form->addManyToMany('categories', 'Categories'); $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 */ public function configure(Form $form) { $form->addGroup('Settings'); $form->addText('itemsPerPage', 'Items per page'); $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) { $account = $form->addContainer('account'); $account->setCurrentGroup($form->addGroup("Account")); $account->addCheckbox('activated', 'Activate')->addCondition($form::EQUAL, TRUE)->toggle('form-account-accountId'); $account->setCurrentGroup($form->addGroup()->setOption('id', 'form-account-accountId')); $account->addText('accountId', 'Account ID'); $api = $form->addContainer('api'); $api->setCurrentGroup($form->addGroup('Access by API')); $api->addCheckbox('activated', 'Activate')->addCondition($form::EQUAL, TRUE)->toggle('form-api'); $api->setCurrentGroup($form->addGroup()->setOption('id', 'form-api')); $api->addText('applicationName', 'Application name'); $api->addText('clientId', 'Client ID')->getControlPrototype()->class[] = 'span12'; $api->addText('clientMail', 'Client mail')->getControlPrototype()->class[] = 'span12'; $gaId = $api->addText('gaId', 'GA ID or URL'); $gaId->getControlPrototype()->class[] = 'span12'; $gaId->getControlPrototype()->onChange[] = 'if ($(this).val().length > 20) { var url = $(this).val().split("p"); url = url[url.length - 1]; if(url.substr(url.length -1 , 1) == "/") { url = url.substr(0, url.length - 1); } $(this).val(url); }'; if (file_exists($this->googleanalyticsDir . '/key.p12')) { $api->addCheckbox('keyFileNew', 'Change private key')->addCondition($form::EQUAL, TRUE)->toggle('group-keyFile'); } $api->setCurrentGroup($form->addGroup()->setOption('id', 'group-keyFile')); $api->addUpload('keyFile', 'Private key'); $form->addGroup(); $form->addSaveButton('Save'); }
/** * @param Form $form */ public function configure(Form $form) { $form->addHidden('provider')->setValue($this->provider); $form['parameters'] = $this->securityManager->getLoginProviderByName($this->provider)->getFormContainer(); $form->addSaveButton('Sign in')->getControlPrototype()->class[] = 'btn-primary'; $form->addSubmit('cancel', 'Cancel')->setValidationScope(FALSE); }
public function configure(Form $form) { $group = $form->addGroup(); $form->addText('name', 'Name'); $form->addOne('route')->setCurrentGroup($group)->addTextArea('notation', 'Notation', NULL, 4)->getControlPrototype()->attrs['class'] = 'input-block-level'; $form->addSaveButton('Save'); }
/** * @param Form $form */ public function configure(Form $form) { $form->addText('appId', 'App ID'); $form->addText('secret', 'Secret'); $form->addSelect('cookie', 'Use cookie', array(TRUE => 'yes', FALSE => 'no')); $form->addSaveButton('Save'); }
public function configure(Form $form) { $group = $form->addGroup(); $form->addText('name', 'Name'); $form->addOne('route')->setCurrentGroup($group)->addTextArea('notation', 'Notation', NULL, 4)->getControlPrototype()->attrs['class'] = 'input-block-level'; $form->addManyToOne('linkedRoute', 'Linked route')->setCriteria(array('page' => $form->data->extendedPage->linkedPage->id)); $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 */ public function configure(Form $form) { $form->addGroup('Settings'); $form->addText('itemsPerPage', 'Items per page'); $form->addText('messageMaxLength', 'Message max length')->addCondition($form::FILLED)->addRule($form::NUMERIC); $form->addGroup(); $form->addSaveButton('Save'); }
public function configure(Form $form) { $form->addText('text', 'Text'); $form->addText('priceFrom', 'Price from'); $form->addText('priceTo', 'Price to'); $form->addCheckboxList('labels', 'Labels')->setItems($this->getLabels(), FALSE); $form->addSaveButton('Apply'); }
/** * @param Form $form */ protected function configure(Form $form) { $facebook = $form->addContainer('facebook'); $facebook->setCurrentGroup($form->addGroup('Facebook')); $facebook->addText('name', 'Name')->addRule($form::FILLED); $facebook->addText('appId', 'App ID'); $facebook->addText('secret', 'Secret'); $form->addSaveButton('Save'); }
/** * @param Form $form */ public function configure(Form $form) { $form->addText('name', 'Name')->addRule($form::FILLED); $form->addText('domain', 'Domain')->addRule($form::FILLED); /** @var ManyToOne $page */ $page = $form->addOneToOne('page', 'Page'); $page->setQuery($this->pageRepository->createQueryBuilder('a')->orderBy('a.positionString', 'ASC')); $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 */ protected function configure(Form $form) { $form->addGroup('Content'); $form->addCheckbox('autoThumbnails', 'Auto thumbnails')->setDefaultValue(TRUE)->addCondition($form::EQUAL, TRUE)->toggle('form-lightbox'); $form->addGroup()->setOption('id', 'form-lightbox'); $form->addCheckbox('autoLightbox', 'Auto lightbox')->setDefaultValue(TRUE); $form->addGroup(); $form->addSaveButton('Save'); }
/** * @param Form $form */ public function configure(Form $form) { $form->addText('name', 'Jméno')->addRule($form::FILLED, 'Vyplňte prosím jméno'); $form->addText('latitude', 'Zeměpisná šířka (N)')->addCondition($form::FILLED)->addRule($form::FLOAT, 'Zadaná souřadnice je ve špatném tvaru'); $longitude = $form->addText('longitude', 'Zeměpisná výška (E)'); $longitude->addCondition($form::FILLED)->addRule($form::FLOAT, 'Zadaná souřadnice je ve špatném tvaru'); $form->addSubmit('_gps', 'Detekovat GPS')->onClick[] = $this->gpsClick; $form->addSaveButton('Save'); }
/** * @param Form $form */ public function configure(Form $form) { $route = $form->addOne('conditions')->addOne('route'); $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->addSaveButton('Save'); }