/** * @return \Nette\Application\UI\Form */ protected function createComponentLoadBackup() { $form = new \Nette\Application\UI\Form(); $form->addUpload('upload', 'Zip archiv se zálohou:')->addRule(\Nette\Application\UI\Form::MIME_TYPE, "Soubor musí být zip archiv", "application/zip"); $form->addSubmit('send', 'Nahrát'); $form->onSuccess[] = $this->loadBackupSubmitted; $form->onError[] = function ($form) { foreach ($form->errors as $er) { $form->getPresenter()->flashMessage($er, 'error'); } $form->cleanErrors(); }; return $form; }