diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 584881e..fd52ca0 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -82,7 +82,7 @@ final class ApiController extends Controller public function apiSurveyTemplateCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void { if (!empty($val = $this->validateSurveyTemplateCreate($request))) { - $response->set($request->uri->__toString(), new FormValidation($val)); + $response->data[$request->uri->__toString()] = new FormValidation($val); $response->header->status = RequestStatusCode::R_400; return; @@ -141,7 +141,7 @@ final class ApiController extends Controller } } - if (!empty($uploadedFiles = $request->getFiles())) { + if (!empty($uploadedFiles = $request->files)) { $uploaded = $this->app->moduleManager->get('Media')->uploadFiles( [], [], @@ -205,7 +205,7 @@ final class ApiController extends Controller public function apiSurveyTemplateElementCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void { if (!empty($val = $this->validateSurveyTemplateElementCreate($request))) { - $response->set($request->uri->__toString(), new FormValidation($val)); + $response->data[$request->uri->__toString()] = new FormValidation($val); $response->header->status = RequestStatusCode::R_400; return; @@ -293,7 +293,7 @@ final class ApiController extends Controller public function apiSurveyAnswerCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void { if (!empty($val = $this->validateSurveyAnswerCreate($request))) { - $response->set($request->uri->__toString(), new FormValidation($val)); + $response->data[$request->uri->__toString()] = new FormValidation($val); $response->header->status = RequestStatusCode::R_400; return; diff --git a/Controller/BackendController.php b/Controller/BackendController.php index c8eb24e..2abc766 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -47,7 +47,7 @@ final class BackendController extends Controller */ public function setUpBackend(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void { - $head = $response->get('Content')->getData('head'); + $head = $response->get('Content')->head; $head->addAsset(AssetType::CSS, '/Modules/Surveys/Theme/Backend/styles.css?v=1.0.0'); } @@ -67,21 +67,21 @@ final class BackendController extends Controller { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Surveys/Theme/Backend/surveys-list'); - $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000801001, $request, $response)); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1000801001, $request, $response); $path = \str_replace('+', ' ', (string) ($request->getData('path') ?? '/')); $surveys = SurveyTemplateMapper::getByVirtualPath($path) - ->where('tags/title/language', $response->getLanguage()) - ->where('l11n/language', $response->getLanguage()) + ->where('tags/title/language', $response->header->l11n->language) + ->where('l11n/language', $response->header->l11n->language) ->execute(); list($collection, $parent) = CollectionMapper::getCollectionsByPath($path); - $view->addData('parent', $parent); - $view->addData('collections', $collection); - $view->addData('path', $path); - $view->addData('surveys', $surveys); - $view->addData('account', $this->app->accountManager->get($request->header->account)); + $view->data['parent'] = $parent; + $view->data['collections'] = $collection; + $view->data['path'] = $path; + $view->data['surveys'] = $surveys; + $view->data['account'] = $this->app->accountManager->get($request->header->account); return $view; } @@ -102,7 +102,7 @@ final class BackendController extends Controller { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Surveys/Theme/Backend/surveys-create'); - $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000801001, $request, $response)); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1000801001, $request, $response); return $view; } @@ -123,7 +123,7 @@ final class BackendController extends Controller { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Surveys/Theme/Backend/surveys-create'); - $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000801001, $request, $response)); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1000801001, $request, $response); /** @var \Modules\Surveys\Models\SurveyTemplate $survey */ $survey = SurveyTemplateMapper::get() @@ -136,13 +136,13 @@ final class BackendController extends Controller ->with('tags') ->with('tags/title') ->where('id', $request->getData('id')) - ->where('tags/title/language', $response->getLanguage()) - ->where('l11n/language', $response->getLanguage()) - ->where('elements/l11n/language', $response->getLanguage()) - ->where('elements/labels/language', $response->getLanguage()) + ->where('tags/title/language', $response->header->l11n->language) + ->where('l11n/language', $response->header->l11n->language) + ->where('elements/l11n/language', $response->header->l11n->language) + ->where('elements/labels/language', $response->header->l11n->language) ->execute(); - $view->addData('survey', $survey); + $view->data['survey'] = $survey; return $view; } @@ -163,7 +163,7 @@ final class BackendController extends Controller { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Surveys/Theme/Backend/surveys-survey'); - $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000801001, $request, $response)); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1000801001, $request, $response); return $view; } diff --git a/Models/SurveyTemplateElementL11n.php b/Models/SurveyTemplateElementL11n.php index ceea284..df1de7d 100755 --- a/Models/SurveyTemplateElementL11n.php +++ b/Models/SurveyTemplateElementL11n.php @@ -92,18 +92,6 @@ class SurveyTemplateElementL11n implements \JsonSerializable $this->language = $language; } - /** - * Get id - * - * @return int - * - * @since 1.0.0 - */ - public function getId() : int - { - return $this->id; - } - /** * Get language * diff --git a/Models/SurveyTemplateL11n.php b/Models/SurveyTemplateL11n.php index 665dff9..f946540 100755 --- a/Models/SurveyTemplateL11n.php +++ b/Models/SurveyTemplateL11n.php @@ -108,18 +108,6 @@ class SurveyTemplateL11n implements \JsonSerializable $this->language = $language; } - /** - * Get id - * - * @return int - * - * @since 1.0.0 - */ - public function getId() : int - { - return $this->id; - } - /** * Get language * diff --git a/Models/SurveyTemplateLabelL11n.php b/Models/SurveyTemplateLabelL11n.php index e9001a5..047095b 100755 --- a/Models/SurveyTemplateLabelL11n.php +++ b/Models/SurveyTemplateLabelL11n.php @@ -80,18 +80,6 @@ class SurveyTemplateLabelL11n implements \JsonSerializable $this->language = $language; } - /** - * Get id - * - * @return int - * - * @since 1.0.0 - */ - public function getId() : int - { - return $this->id; - } - /** * Get language * diff --git a/Theme/Backend/surveys-create.tpl.php b/Theme/Backend/surveys-create.tpl.php index b857278..89380f2 100755 --- a/Theme/Backend/surveys-create.tpl.php +++ b/Theme/Backend/surveys-create.tpl.php @@ -15,9 +15,9 @@ declare(strict_types=1); use Modules\Surveys\Models\SurveyElementType; /** @var null|Modules\Surveys\Models\SurveyTemplate $survey */ -$survey = $this->getData('survey'); +$survey = $this->data['survey']; -echo $this->getData('nav')->render(); ?> +echo $this->data['nav']->render(); ?>