setName('setup_welcome'); $this->setViewScript('form/setup-welcome.phtml'); $this->configDir = preg_replace('_/$_', '', Icinga::app()->getConfigDir()); } /** * @see Form::createElements() */ public function createElements(array $formData) { $this->addElement( 'text', 'token', array( 'required' => true, 'label' => t('Setup Token'), 'description' => t( 'For security reasons, we need to check that you are permitted to execute this setup. Please provide the token from the file "setup.token".' ), 'validators' => array(new TokenValidator(Icinga::app()->getConfigDir() . '/setup.token')) ) ); } }