/** * @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'); }