feat(main): Made group and blocks translatable.

Still need to do slide and FAQ entities
This commit is contained in:
2026-09-09 11:56:18 +02:00
parent 85b56f1a13
commit 7cafc376b7
23 changed files with 451 additions and 82 deletions
+4 -3
View File
@@ -49,7 +49,8 @@ trait DisplayHooks
public function getWidgetVariables($hookName = null, array $configuration = [])
{
$groupList = $this->loadActiveGroupsWithBlocks((string) $hookName);
$idLang = (int) Context::getContext()->language->id;
$groupList = $this->loadActiveGroupsWithBlocks((string) $hookName, $idLang);
if (empty($groupList)) {
return [];
@@ -61,7 +62,7 @@ trait DisplayHooks
];
}
private function loadActiveGroupsWithBlocks(string $hookName): array
private function loadActiveGroupsWithBlocks(string $hookName, int $idLang): array
{
$groups = CustomHtmlGroup::getActiveByHookName($hookName);
@@ -69,7 +70,7 @@ trait DisplayHooks
return [];
}
$blocksByGroup = CustomHtmlBlock::getActiveByGroupIds(array_column($groups, 'id_ws_customhtml_group'));
$blocksByGroup = CustomHtmlBlock::getActiveByGroupIds(array_column($groups, 'id_ws_customhtml_group'), $idLang);
$blocksByGroup = $this->attachFaqsToBlocks($blocksByGroup);
$blocksByGroup = $this->attachImageUrls($blocksByGroup);
$blocksByGroup = $this->attachSlidesToBlocks($blocksByGroup);