<?php
 namespace App\Mvc\Controller\Form; abstract class PopupAbstract extends \App\Mvc\Controller\Form\WindowAbstract { protected function initialize() { parent::initialize(); $this->actionsCfg['index'] = ['checkSection' => false, 'checkOption' => false,]; } protected function actionIndex($R) { $msgs = \App\MessagesCollector::create(); $modelOutput = null; if ($R[$this->formSubmitButtonName]??null) { $modelOutput = $this->processFormData($R, $msgs); } $view = $this->buildViewObjectFromCurrentModuleForAction($this->getAction()); if (!($R[$this->formSubmitButtonName]??null)) { $formData = $this->getDefaultFormData($R); } else { $formData = $this->getSubmitFormData($R, $msgs); } $view->addInput('formData', $formData); $view->getMessagesCollector()->appendMessages($msgs); $view->addInput('formSubmitButtonName', $this->formSubmitButtonName); if ($modelOutput) { $view->setClosePopup(true); } $this->preRenderOperations($view, $formData); return new \Engine\Mvc\Response\Html($view->render()); } }