/** * @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->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 */ public function configure(Form $form) { $form->addGroup(); $form->addFileEntityInput('image', 'Image'); $form->addText('alt', 'Alt'); if (!$form->data->hideWidth || !$form->data->hideHeight || !$form->data->hideFormat) { $form->addGroup('Size'); if (!$form->data->hideWidth) { $form->addText('width', 'Width')->addCondition($form::FILLED)->addRule($form::INTEGER); } if (!$form->data->hideHeight) { $form->addText('height', 'Height')->addCondition($form::FILLED)->addRule($form::INTEGER); } if (!$form->data->hideFormat) { $form->addSelect('format', 'Format', array(0 => 'Fit', 1 => 'Shrink only', 2 => 'Stretch', 4 => 'Fill', 8 => 'Exact')); } } if (!$form->data->hideType) { $form->addSelect('type', 'Type', array('png' => 'PNG', 'jpeg' => 'JPEG', 'gif' => 'GIF'))->setPrompt('-- default --'); } $form->setCurrentGroup(); $form->addSaveButton('Save'); }
/** * @param Form $form */ public function configure(Form $form) { $form->addFileEntityInput('file', 'File'); $form->addSaveButton('Save'); }
public function configure(Form $form) { $form->addFileEntityInput('_photos', 'Upload photos')->setMulti(TRUE); $form->addSaveButton('Upload'); }