Backend\Modules\Extensions\Actions\UploadModule::validateForm PHP Метод

validateForm() приватный Метод

Validate a submitted form and process it.
private validateForm ( )
    private function validateForm()
    {
        // the form is submitted
        if ($this->frm->isSubmitted()) {
            // shorten field variables
            $fileFile = $this->frm->getField('file');
            // validate the file
            if ($fileFile->isFilled(BL::err('FieldIsRequired')) && $fileFile->isAllowedExtension(array('zip'), sprintf(BL::getError('ExtensionNotAllowed'), 'zip'))) {
                $moduleName = $this->installModule();
            }
            // passed all validation
            if ($this->frm->isCorrect()) {
                // by now, the module has already been installed in processZipFile()
                // redirect with fireworks
                $this->redirect(BackendModel::createURLForAction('Modules') . '&report=module-installed&var=' . $moduleName . '&highlight=row-module_' . $moduleName);
            }
        }
    }