feat(main): Made group and blocks translatable.
Still need to do slide and FAQ entities
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user