public function saveState(array &$params, $reflection = null) { if ($this->registration !== null) { $params['registration'] = $this->registration->getId(); } if ($this->invitation !== null) { $params['hash'] = $this->invitation->getHash(); } parent::saveState($params, $reflection); }
/** * @return \Nette\Application\UI\Form */ public function create() { \Kdyby\Replicator\Container::register(); $form = $this->formFactory->create(); $userTypes = array(); foreach ($this->securityManager->getUserTypes() as $name => $val) { $userTypes[$name] = $val->getName(); } $form->addCheckbox('enabled', 'Enabled'); $form->addCheckbox('invitation', 'Only as invitation'); $form->addText('name', 'Name'); $form->addHidden('key'); $form->addSelect('userType', 'Type', $userTypes); $form->addSelect('mode', 'Mode', Registration::getModes()); $form->addSelect('loginProviderMode', 'Login provider mode', Registration::getLoginProviderModes()); $form->addMultiSelect('roles', 'Roles')->setOption(IComponentMapper::ITEMS_TITLE, 'name'); return $form; }