diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 007c6db..a397368 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -123,18 +123,9 @@ final class ApiController extends Controller } $tag = $this->createTagFromRequest($request); + $tag->setL11n($request->getData('title'), $request->getData('language')); $this->createModel($request->header->account, $tag, TagMapper::class, 'tag', $request->getOrigin()); - $l11nRequest = new HttpRequest($request->uri); - $l11nRequest->setData('tag', $tag->getId()); - $l11nRequest->setData('title', $request->getData('title')); - $l11nRequest->setData('language', $request->getData('language')); - - $l11nTag = $this->createTagL11nFromRequest($l11nRequest); - $this->createModel($request->header->account, $l11nTag, TagL11nMapper::class, 'tag_l11n', $request->getOrigin()); - - $tag->setTitle($l11nTag); - $this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Tag', 'Tag successfully created', $tag); } diff --git a/Models/Tag.php b/Models/Tag.php index 7fe3fe3..36c0584 100755 --- a/Models/Tag.php +++ b/Models/Tag.php @@ -146,7 +146,7 @@ class Tag implements \JsonSerializable, ArrayableInterface * * @since 1.0.0 */ - public function getTitle() : string + public function getL11n() : string { return $this->title instanceof TagL11n ? $this->title->title : $this->title; } @@ -161,7 +161,7 @@ class Tag implements \JsonSerializable, ArrayableInterface * * @since 1.0.0 */ - public function setTitle($title, string $lang = ISO639x1Enum::_EN) : void + public function setL11n($title, string $lang = ISO639x1Enum::_EN) : void { if ($title instanceof TagL11n) { $this->title = $title; diff --git a/Theme/Backend/tag-list.tpl.php b/Theme/Backend/tag-list.tpl.php index c85b2cb..2ddc75c 100755 --- a/Theme/Backend/tag-list.tpl.php +++ b/Theme/Backend/tag-list.tpl.php @@ -38,7 +38,7 @@ echo $this->getData('nav')->render(); ?> $url = UriFactory::build('{/prefix}tag/single?{?}&id=' . $value->getId()); ?>    icon !== null ? '' : '      '; ?>  - printHtml($value->getTitle()); ?> + printHtml($value->getL11n()); ?> diff --git a/Theme/Backend/tag-single.tpl.php b/Theme/Backend/tag-single.tpl.php index e8d682d..474f2ec 100755 --- a/Theme/Backend/tag-single.tpl.php +++ b/Theme/Backend/tag-single.tpl.php @@ -29,7 +29,7 @@ echo $this->getData('nav')->render(); ?>
-
+