diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php index 50fff94..0336374 100755 --- a/Admin/Routes/Web/Backend.php +++ b/Admin/Routes/Web/Backend.php @@ -18,7 +18,7 @@ use phpOMS\Account\PermissionType; use phpOMS\Router\RouteVerb; return [ - '^.*/survey.*$' => [ + '^.*/survey(\?.*$|$)' => [ [ 'dest' => '\Modules\Surveys\Controller\BackendController:setUpBackend', 'verb' => RouteVerb::GET, @@ -29,7 +29,7 @@ return [ ], ], ], - '^.*/survey/list.*$' => [ + '^.*/survey/list(\?.*$|$)' => [ [ 'dest' => '\Modules\Surveys\Controller\BackendController:viewSurveysList', 'verb' => RouteVerb::GET, @@ -40,7 +40,7 @@ return [ ], ], ], - '^.*/survey/create.*$' => [ + '^.*/survey/create(\?.*$|$)' => [ [ 'dest' => '\Modules\Surveys\Controller\BackendController:viewSurveysCreate', 'verb' => RouteVerb::GET, @@ -51,7 +51,7 @@ return [ ], ], ], - '^.*/survey/edit.*$' => [ + '^.*/survey/edit(\?.*$|$)' => [ [ 'dest' => '\Modules\Surveys\Controller\BackendController:viewSurveysEdit', 'verb' => RouteVerb::GET, @@ -62,7 +62,7 @@ return [ ], ], ], - '^.*/survey(\?.*|$)$' => [ + '^.*/survey(\?.*$|$)' => [ [ 'dest' => '\Modules\Surveys\Controller\BackendController:viewSurveysSurvey', 'verb' => RouteVerb::GET, diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 3a92c57..33baf82 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -26,9 +26,7 @@ use Modules\Surveys\Models\SurveyTemplateElementMapper; use Modules\Surveys\Models\SurveyTemplateL11n; use Modules\Surveys\Models\SurveyTemplateLabelL11n; use Modules\Surveys\Models\SurveyTemplateMapper; -use Modules\Tag\Models\NullTag; use phpOMS\Localization\ISO639x1Enum; -use phpOMS\Message\Http\HttpResponse; use phpOMS\Message\Http\RequestStatusCode; use phpOMS\Message\RequestAbstract; use phpOMS\Message\ResponseAbstract; @@ -105,38 +103,20 @@ final class ApiController extends Controller $template = new SurveyTemplate(); $template->start = $request->getDataDateTime('start'); $template->end = $request->getDataDateTime('end'); - $template->status = $request->getDataInt('status') ?? SurveyStatus::ACTIVE; + $template->status = SurveyStatus::tryFromValue($request->getDataInt('status')) ?? SurveyStatus::ACTIVE; $template->createdBy = new NullAccount($request->header->account); $l11n = new SurveyTemplateL11n( $request->getDataString('title') ?? '', Markdown::parse($request->getDataString('description') ?? ''), $request->getDataString('description') ?? '', - $request->getDataString('language') ?? ISO639x1Enum::_EN + ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? ISO639x1Enum::_EN ); $template->setL11n($l11n); - if (!empty($tags = $request->getDataJson('tags'))) { - foreach ($tags as $tag) { - if (!isset($tag['id'])) { - $request->setData('title', $tag['title'], true); - $request->setData('color', $tag['color'], true); - $request->setData('icon', $tag['icon'] ?? null, true); - $request->setData('language', $tag['language'], true); - - $internalResponse = new HttpResponse(); - $this->app->moduleManager->get('Tag')->apiTagCreate($request, $internalResponse); - - if (!\is_array($data = $internalResponse->getDataArray($request->uri->__toString()))) { - continue; - } - - $template->addTag($data['response']); - } else { - $template->addTag(new NullTag((int) $tag['id'])); - } - } + if ($request->hasData('tags')) { + $template->tags = $this->app->moduleManager->get('Tag', 'Api')->createTagsFromRequest($request); } if (!empty($uploadedFiles = $request->files)) { @@ -150,13 +130,13 @@ final class ApiController extends Controller ); foreach ($uploaded as $media) { - $template->addMedia($media); + $template->files[] = $media; } } if (!empty($mediaFiles = $request->getDataJson('media'))) { foreach ($mediaFiles as $media) { - $template->addMedia(new NullMedia($media)); + $template->files[] = new NullMedia($media); } } @@ -235,7 +215,7 @@ final class ApiController extends Controller $request->getDataString('text') ?? '', Markdown::parse($request->getDataString('description') ?? ''), $request->getDataString('description') ?? '', - $request->getDataString('language') ?? ISO639x1Enum::_EN + ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? ISO639x1Enum::_EN ); $element->setL11n($l11n); @@ -244,7 +224,7 @@ final class ApiController extends Controller foreach ($labels as $text) { $label = new SurveyTemplateLabelL11n( $text, - $request->getDataString('language') ?? ISO639x1Enum::_EN + ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? ISO639x1Enum::_EN ); $element->addLabel($label); diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 6f63c2c..f2903eb 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -131,7 +131,7 @@ final class BackendController extends Controller ->with('elements') ->with('elements/l11n') ->with('elements/labels') - ->with('media') + ->with('files') ->with('l11n') ->with('tags') ->with('tags/title') diff --git a/Models/SurveyAnswer.php b/Models/SurveyAnswer.php index 412763c..72ca7b5 100755 --- a/Models/SurveyAnswer.php +++ b/Models/SurveyAnswer.php @@ -31,25 +31,4 @@ final class SurveyAnswer * @since 1.0.0 */ public int $id = 0; - - /** - * Constructor - * - * @since 1.0.0 - */ - public function __construct() - { - } - - /** - * Get id. - * - * @return int - * - * @since 1.0.0 - */ - public function getId() : int - { - return $this->id; - } } diff --git a/Models/SurveyTemplate.php b/Models/SurveyTemplate.php index 48d0f88..4e3ea94 100755 --- a/Models/SurveyTemplate.php +++ b/Models/SurveyTemplate.php @@ -15,8 +15,6 @@ declare(strict_types=1); namespace Modules\Surveys\Models; use Modules\Admin\Models\Account; -use Modules\Media\Models\Media; -use Modules\Tag\Models\NullTag; use Modules\Tag\Models\Tag; use phpOMS\Localization\ISO639x1Enum; @@ -120,14 +118,6 @@ class SurveyTemplate */ public array $elements = []; - /** - * Media files - * - * @var Media[] - * @since 1.0.0 - */ - public array $media = []; - /** * Constructor. * @@ -138,18 +128,6 @@ class SurveyTemplate $this->createdAt = new \DateTimeImmutable('now'); } - /** - * Get id. - * - * @return int - * - * @since 1.0.0 - */ - public function getId() : int - { - return $this->id; - } - /** * @return SurveyTemplateL11n * @@ -175,104 +153,6 @@ class SurveyTemplate $this->l11n = $l11n; } - /** - * Get tags - * - * @return array - * - * @since 1.0.0 - */ - public function getTags() : array - { - return $this->tags; - } - - /** - * Get tag. - * - * @param int $id Element id - * - * @return Tag - * - * @since 1.0.0 - */ - public function getTag(int $id) : Tag - { - return $this->tags[$id] ?? new NullTag(); - } - - /** - * Add tag - * - * @param Tag $tag Tag - * - * @return void - * - * @since 1.0.0 - */ - public function addTag(Tag $tag) : void - { - $this->tags[] = $tag; - } - - /** - * Remove Tag from list. - * - * @param int $id Tag - * - * @return bool - * - * @since 1.0.0 - */ - public function removeTag($id) : bool - { - if (isset($this->tags[$id])) { - unset($this->tags[$id]); - - return true; - } - - return false; - } - - /** - * Get all media - * - * @return Media[] - * - * @since 1.0.0 - */ - public function getMedia() : array - { - return $this->media; - } - - /** - * Add media - * - * @param Media $media Media to add - * - * @return void - * - * @since 1.0.0 - */ - public function addMedia(Media $media) : void - { - $this->media[] = $media; - } - - /** - * Get elements - * - * @return array - * - * @since 1.0.0 - */ - public function getElements() : array - { - return $this->elements; - } - /** * Add element * @@ -302,7 +182,7 @@ class SurveyTemplate 'virtualPath' => $this->virtualPath, 'tags' => $this->tags, 'elements' => $this->elements, - 'media' => $this->media, + 'media' => $this->files, ]; } @@ -313,4 +193,6 @@ class SurveyTemplate { return $this->toArray(); } + + use \Modules\Media\Models\MediaListTrait; } diff --git a/Models/SurveyTemplateElement.php b/Models/SurveyTemplateElement.php index 8fe95da..ac92eae 100755 --- a/Models/SurveyTemplateElement.php +++ b/Models/SurveyTemplateElement.php @@ -90,18 +90,6 @@ class SurveyTemplateElement */ public array $values = []; - /** - * Get id. - * - * @return int - * - * @since 1.0.0 - */ - public function getId() : int - { - return $this->id; - } - /** * @return SurveyTemplateElementL11n * @@ -177,13 +165,13 @@ class SurveyTemplateElement public function toArray() : array { return [ - 'id' => $this->id, - 'type' => $this->type, - 'isOptional' => $this->isOptional, - 'order' => $this->order, - 'template' => $this->template, - 'labels' => $this->labels, - 'values' => $this->values, + 'id' => $this->id, + 'type' => $this->type, + 'isOptional' => $this->isOptional, + 'order' => $this->order, + 'template' => $this->template, + 'labels' => $this->labels, + 'values' => $this->values, ]; } diff --git a/Models/SurveyTemplateElementL11n.php b/Models/SurveyTemplateElementL11n.php index d15241f..47d57f7 100755 --- a/Models/SurveyTemplateElementL11n.php +++ b/Models/SurveyTemplateElementL11n.php @@ -124,12 +124,12 @@ class SurveyTemplateElementL11n implements \JsonSerializable public function toArray() : array { return [ - 'id' => $this->id, - 'text' => $this->text, - 'description' => $this->description, - 'descriptionPlain' => $this->descriptionPlain, - 'element' => $this->element, - 'language' => $this->language, + 'id' => $this->id, + 'text' => $this->text, + 'description' => $this->description, + 'descriptionPlain' => $this->descriptionPlain, + 'element' => $this->element, + 'language' => $this->language, ]; } diff --git a/Models/SurveyTemplateElementL11nMapper.php b/Models/SurveyTemplateElementL11nMapper.php index 8aebd85..d2d6fb3 100755 --- a/Models/SurveyTemplateElementL11nMapper.php +++ b/Models/SurveyTemplateElementL11nMapper.php @@ -33,12 +33,12 @@ final class SurveyTemplateElementL11nMapper extends DataMapperFactory * @since 1.0.0 */ public const COLUMNS = [ - 'survey_template_element_l11n_id' => ['name' => 'survey_template_element_l11n_id', 'type' => 'int', 'internal' => 'id'], - 'survey_template_element_l11n_text' => ['name' => 'survey_template_element_l11n_text', 'type' => 'string', 'internal' => 'text', 'autocomplete' => true], - 'survey_template_element_l11n_description' => ['name' => 'survey_template_element_l11n_description', 'type' => 'string', 'internal' => 'description'], - 'survey_template_element_l11n_description_plain' => ['name' => 'survey_template_element_l11n_description_plain', 'type' => 'string', 'internal' => 'descriptionPlain'], - 'survey_template_element_l11n_element' => ['name' => 'survey_template_element_l11n_element', 'type' => 'int', 'internal' => 'element'], - 'survey_template_element_l11n_language' => ['name' => 'survey_template_element_l11n_language', 'type' => 'string', 'internal' => 'language'], + 'survey_template_element_l11n_id' => ['name' => 'survey_template_element_l11n_id', 'type' => 'int', 'internal' => 'id'], + 'survey_template_element_l11n_text' => ['name' => 'survey_template_element_l11n_text', 'type' => 'string', 'internal' => 'text', 'autocomplete' => true], + 'survey_template_element_l11n_description' => ['name' => 'survey_template_element_l11n_description', 'type' => 'string', 'internal' => 'description'], + 'survey_template_element_l11n_description_plain' => ['name' => 'survey_template_element_l11n_description_plain', 'type' => 'string', 'internal' => 'descriptionPlain'], + 'survey_template_element_l11n_element' => ['name' => 'survey_template_element_l11n_element', 'type' => 'int', 'internal' => 'element'], + 'survey_template_element_l11n_language' => ['name' => 'survey_template_element_l11n_language', 'type' => 'string', 'internal' => 'language'], ]; /** diff --git a/Models/SurveyTemplateElementMapper.php b/Models/SurveyTemplateElementMapper.php index 44c8407..dd51e6a 100755 --- a/Models/SurveyTemplateElementMapper.php +++ b/Models/SurveyTemplateElementMapper.php @@ -36,12 +36,12 @@ final class SurveyTemplateElementMapper extends DataMapperFactory * @since 1.0.0 */ public const COLUMNS = [ - 'survey_template_element_id' => ['name' => 'survey_template_element_id', 'type' => 'int', 'internal' => 'id'], - 'survey_template_element_type' => ['name' => 'survey_template_element_type', 'type' => 'int', 'internal' => 'type'], - 'survey_template_element_order' => ['name' => 'survey_template_element_order', 'type' => 'int', 'internal' => 'order'], - 'survey_template_element_optional' => ['name' => 'survey_template_element_optional', 'type' => 'bool', 'internal' => 'isOptional'], - 'survey_template_element_values' => ['name' => 'survey_template_element_values', 'type' => 'Json', 'internal' => 'values'], - 'survey_template_element_template' => ['name' => 'survey_template_element_template', 'type' => 'int', 'internal' => 'template'], + 'survey_template_element_id' => ['name' => 'survey_template_element_id', 'type' => 'int', 'internal' => 'id'], + 'survey_template_element_type' => ['name' => 'survey_template_element_type', 'type' => 'int', 'internal' => 'type'], + 'survey_template_element_order' => ['name' => 'survey_template_element_order', 'type' => 'int', 'internal' => 'order'], + 'survey_template_element_optional' => ['name' => 'survey_template_element_optional', 'type' => 'bool', 'internal' => 'isOptional'], + 'survey_template_element_values' => ['name' => 'survey_template_element_values', 'type' => 'Json', 'internal' => 'values'], + 'survey_template_element_template' => ['name' => 'survey_template_element_template', 'type' => 'int', 'internal' => 'template'], ]; /** @@ -52,17 +52,17 @@ final class SurveyTemplateElementMapper extends DataMapperFactory */ public const HAS_MANY = [ 'l11n' => [ - 'mapper' => SurveyTemplateElementL11nMapper::class, - 'table' => 'survey_template_element_l11n', - 'self' => 'survey_template_element_l11n_element', - 'conditional' => true, - 'external' => null, + 'mapper' => SurveyTemplateElementL11nMapper::class, + 'table' => 'survey_template_element_l11n', + 'self' => 'survey_template_element_l11n_element', + 'conditional' => true, + 'external' => null, ], 'labels' => [ - 'mapper' => SurveyTemplateLabelL11nMapper::class, - 'table' => 'survey_template_element_label_l11n', - 'self' => 'survey_template_element_label_l11n_element', - 'external' => null, + 'mapper' => SurveyTemplateLabelL11nMapper::class, + 'table' => 'survey_template_element_label_l11n', + 'self' => 'survey_template_element_label_l11n_element', + 'external' => null, ], ]; diff --git a/Models/SurveyTemplateL11n.php b/Models/SurveyTemplateL11n.php index 25924c0..4eb7221 100755 --- a/Models/SurveyTemplateL11n.php +++ b/Models/SurveyTemplateL11n.php @@ -140,12 +140,12 @@ class SurveyTemplateL11n implements \JsonSerializable public function toArray() : array { return [ - 'id' => $this->id, - 'title' => $this->title, - 'description' => $this->description, - 'descriptionPlain' => $this->descriptionPlain, - 'template' => $this->template, - 'language' => $this->language, + 'id' => $this->id, + 'title' => $this->title, + 'description' => $this->description, + 'descriptionPlain' => $this->descriptionPlain, + 'template' => $this->template, + 'language' => $this->language, ]; } diff --git a/Models/SurveyTemplateL11nMapper.php b/Models/SurveyTemplateL11nMapper.php index 1e16ed7..8a662bb 100755 --- a/Models/SurveyTemplateL11nMapper.php +++ b/Models/SurveyTemplateL11nMapper.php @@ -36,14 +36,14 @@ final class SurveyTemplateL11nMapper extends DataMapperFactory * @since 1.0.0 */ public const COLUMNS = [ - 'survey_template_l11n_id' => ['name' => 'survey_template_l11n_id', 'type' => 'int', 'internal' => 'id'], - 'survey_template_l11n_title' => ['name' => 'survey_template_l11n_title', 'type' => 'string', 'internal' => 'title', 'autocomplete' => true], - 'survey_template_l11n_description' => ['name' => 'survey_template_l11n_description', 'type' => 'string', 'internal' => 'description'], - 'survey_template_l11n_description_plain' => ['name' => 'survey_template_l11n_description_plain', 'type' => 'string', 'internal' => 'descriptionPlain'], - 'survey_template_l11n_footer' => ['name' => 'survey_template_l11n_footer', 'type' => 'string', 'internal' => 'footer'], - 'survey_template_l11n_footer_plain' => ['name' => 'survey_template_l11n_footer_plain', 'type' => 'string', 'internal' => 'footerPlain'], - 'survey_template_l11n_template' => ['name' => 'survey_template_l11n_template', 'type' => 'int', 'internal' => 'template'], - 'survey_template_l11n_language' => ['name' => 'survey_template_l11n_language', 'type' => 'string', 'internal' => 'language'], + 'survey_template_l11n_id' => ['name' => 'survey_template_l11n_id', 'type' => 'int', 'internal' => 'id'], + 'survey_template_l11n_title' => ['name' => 'survey_template_l11n_title', 'type' => 'string', 'internal' => 'title', 'autocomplete' => true], + 'survey_template_l11n_description' => ['name' => 'survey_template_l11n_description', 'type' => 'string', 'internal' => 'description'], + 'survey_template_l11n_description_plain' => ['name' => 'survey_template_l11n_description_plain', 'type' => 'string', 'internal' => 'descriptionPlain'], + 'survey_template_l11n_footer' => ['name' => 'survey_template_l11n_footer', 'type' => 'string', 'internal' => 'footer'], + 'survey_template_l11n_footer_plain' => ['name' => 'survey_template_l11n_footer_plain', 'type' => 'string', 'internal' => 'footerPlain'], + 'survey_template_l11n_template' => ['name' => 'survey_template_l11n_template', 'type' => 'int', 'internal' => 'template'], + 'survey_template_l11n_language' => ['name' => 'survey_template_l11n_language', 'type' => 'string', 'internal' => 'language'], ]; /** diff --git a/Models/SurveyTemplateLabelL11n.php b/Models/SurveyTemplateLabelL11n.php index ea2757f..ed8b424 100755 --- a/Models/SurveyTemplateLabelL11n.php +++ b/Models/SurveyTemplateLabelL11n.php @@ -112,11 +112,11 @@ class SurveyTemplateLabelL11n implements \JsonSerializable public function toArray() : array { return [ - 'id' => $this->id, - 'title' => $this->title, - 'element' => $this->element, - 'order' => $this->order, - 'language' => $this->language, + 'id' => $this->id, + 'title' => $this->title, + 'element' => $this->element, + 'order' => $this->order, + 'language' => $this->language, ]; } diff --git a/Models/SurveyTemplateLabelL11nMapper.php b/Models/SurveyTemplateLabelL11nMapper.php index cf5652f..96995d6 100755 --- a/Models/SurveyTemplateLabelL11nMapper.php +++ b/Models/SurveyTemplateLabelL11nMapper.php @@ -36,11 +36,11 @@ final class SurveyTemplateLabelL11nMapper extends DataMapperFactory * @since 1.0.0 */ public const COLUMNS = [ - 'survey_template_element_label_l11n_id' => ['name' => 'survey_template_element_label_l11n_id', 'type' => 'int', 'internal' => 'id'], - 'survey_template_element_label_l11n_title' => ['name' => 'survey_template_element_label_l11n_title', 'type' => 'string', 'internal' => 'title', 'autocomplete' => true], - 'survey_template_element_label_l11n_element' => ['name' => 'survey_template_element_label_l11n_element', 'type' => 'int', 'internal' => 'element'], - 'survey_template_element_label_l11n_order' => ['name' => 'survey_template_element_label_l11n_order', 'type' => 'int', 'internal' => 'order'], - 'survey_template_element_label_l11n_language' => ['name' => 'survey_template_element_label_l11n_language', 'type' => 'string', 'internal' => 'language'], + 'survey_template_element_label_l11n_id' => ['name' => 'survey_template_element_label_l11n_id', 'type' => 'int', 'internal' => 'id'], + 'survey_template_element_label_l11n_title' => ['name' => 'survey_template_element_label_l11n_title', 'type' => 'string', 'internal' => 'title', 'autocomplete' => true], + 'survey_template_element_label_l11n_element' => ['name' => 'survey_template_element_label_l11n_element', 'type' => 'int', 'internal' => 'element'], + 'survey_template_element_label_l11n_order' => ['name' => 'survey_template_element_label_l11n_order', 'type' => 'int', 'internal' => 'order'], + 'survey_template_element_label_l11n_language' => ['name' => 'survey_template_element_label_l11n_language', 'type' => 'string', 'internal' => 'language'], ]; /** diff --git a/Models/SurveyTemplateMapper.php b/Models/SurveyTemplateMapper.php index 7318df6..f8671f9 100755 --- a/Models/SurveyTemplateMapper.php +++ b/Models/SurveyTemplateMapper.php @@ -40,14 +40,14 @@ final class SurveyTemplateMapper extends DataMapperFactory * @since 1.0.0 */ public const COLUMNS = [ - 'survey_template_id' => ['name' => 'survey_template_id', 'type' => 'int', 'internal' => 'id'], - 'survey_template_status' => ['name' => 'survey_template_status', 'type' => 'int', 'internal' => 'status'], - 'survey_template_public_result' => ['name' => 'survey_template_public_result', 'type' => 'bool', 'internal' => 'hasPublicResult'], - 'survey_template_start' => ['name' => 'survey_template_start', 'type' => 'DateTime', 'internal' => 'start'], - 'survey_template_end' => ['name' => 'survey_template_end', 'type' => 'DateTime', 'internal' => 'end'], - 'survey_template_virtual' => ['name' => 'survey_template_virtual', 'type' => 'string', 'internal' => 'virtualPath'], - 'survey_template_created_by' => ['name' => 'survey_template_created_by', 'type' => 'int', 'internal' => 'createdBy'], - 'survey_template_created_at' => ['name' => 'survey_template_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt'], + 'survey_template_id' => ['name' => 'survey_template_id', 'type' => 'int', 'internal' => 'id'], + 'survey_template_status' => ['name' => 'survey_template_status', 'type' => 'int', 'internal' => 'status'], + 'survey_template_public_result' => ['name' => 'survey_template_public_result', 'type' => 'bool', 'internal' => 'hasPublicResult'], + 'survey_template_start' => ['name' => 'survey_template_start', 'type' => 'DateTime', 'internal' => 'start'], + 'survey_template_end' => ['name' => 'survey_template_end', 'type' => 'DateTime', 'internal' => 'end'], + 'survey_template_virtual' => ['name' => 'survey_template_virtual', 'type' => 'string', 'internal' => 'virtualPath'], + 'survey_template_created_by' => ['name' => 'survey_template_created_by', 'type' => 'int', 'internal' => 'createdBy'], + 'survey_template_created_at' => ['name' => 'survey_template_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt'], ]; /** @@ -58,17 +58,17 @@ final class SurveyTemplateMapper extends DataMapperFactory */ public const HAS_MANY = [ 'elements' => [ - 'mapper' => SurveyTemplateElementMapper::class, - 'table' => 'survey_template_element', - 'self' => 'survey_template_element_template', - 'external' => null, + 'mapper' => SurveyTemplateElementMapper::class, + 'table' => 'survey_template_element', + 'self' => 'survey_template_element_template', + 'external' => null, ], 'l11n' => [ - 'mapper' => SurveyTemplateL11nMapper::class, - 'table' => 'survey_template_l11n', - 'self' => 'survey_template_l11n_template', - 'conditional' => true, - 'external' => null, + 'mapper' => SurveyTemplateL11nMapper::class, + 'table' => 'survey_template_l11n', + 'self' => 'survey_template_l11n_template', + 'conditional' => true, + 'external' => null, ], 'tags' => [ 'mapper' => TagMapper::class, @@ -76,7 +76,7 @@ final class SurveyTemplateMapper extends DataMapperFactory 'self' => 'survey_template_tag_dst', 'external' => 'survey_template_tag_src', ], - 'media' => [ + 'files' => [ 'mapper' => MediaMapper::class, 'table' => 'survey_template_media', 'external' => 'survey_template_media_dst', @@ -92,8 +92,8 @@ final class SurveyTemplateMapper extends DataMapperFactory */ public const BELONGS_TO = [ 'createdBy' => [ - 'mapper' => AccountMapper::class, - 'external' => 'survey_template_created_by', + 'mapper' => AccountMapper::class, + 'external' => 'survey_template_created_by', ], ]; diff --git a/Theme/Backend/Lang/de.lang.php b/Theme/Backend/Lang/de.lang.php index 15190ea..1cba012 100755 --- a/Theme/Backend/Lang/de.lang.php +++ b/Theme/Backend/Lang/de.lang.php @@ -49,8 +49,8 @@ return ['Surveys' => [ 'Type' => 'Typ', 'User' => 'Nutzer', 'UserGroup' => 'Benutzergruppe', - 'Headline' => 'Headline', - 'Textfield' => 'Textfeld', - 'Textarea' => 'Textblock', - 'Numeric' => 'Zahl', + 'Headline' => 'Headline', + 'Textfield' => 'Textfeld', + 'Textarea' => 'Textblock', + 'Numeric' => 'Zahl', ]]; diff --git a/Theme/Backend/Lang/en.lang.php b/Theme/Backend/Lang/en.lang.php index 68b0602..f5e75db 100755 --- a/Theme/Backend/Lang/en.lang.php +++ b/Theme/Backend/Lang/en.lang.php @@ -49,8 +49,8 @@ return ['Surveys' => [ 'Type' => 'Type', 'User' => 'User', 'UserGroup' => 'User/Group', - 'Headline' => 'Headline', - 'Textfield' => 'Textfield', - 'Textarea' => 'Textarea', - 'Numeric' => 'Numeric', + 'Headline' => 'Headline', + 'Textfield' => 'Textfield', + 'Textarea' => 'Textarea', + 'Numeric' => 'Numeric', ]]; diff --git a/Theme/Backend/surveys-create.tpl.php b/Theme/Backend/surveys-create.tpl.php index 00aca1f..3a4e28a 100755 --- a/Theme/Backend/surveys-create.tpl.php +++ b/Theme/Backend/surveys-create.tpl.php @@ -106,14 +106,14 @@ echo $this->data['nav']->render(); ?>