private function _setGroupData($groupsList, $hook_name) { foreach ($groupsList as &$group) { if (isset($group['columns'])) { foreach ($group['columns'] as &$column) { $pages = array(); if (isset($column['pages']) && $column['pages']) { $column['pages'] = str_replace(', ', ',', $column['pages']); $pages = explode(',', $column['pages']); } if (isset($column['rows'])) { foreach ($column['rows'] as &$row) { //is a widget if ($row['type'] == '0') { $content = $this->_widgets->renderContent($row['key_widget']); $content['type'] = LeomanagewidgetsHelper::processWidgetType($hook_name, $row['key_widget'], $content['type'], $content['data']); //if ($this->_load_owl_carousel_lib == false) // $this->_load_owl_carousel_lib = LeomanagewidgetsHelper::enableLoadOwlCarouselLib($content['data']); $row['content'] = $this->getWidgetContent($hook_name, $row['key_widget'], $content['type'], $content['data']); //is a module } else { if (isset($row['module_name']) && isset($row['hook_name']) && $row['module_name'] && $row['hook_name']) { $row['content'] = $this->execModuleHook($row['hook_name'], array(), $row['module_name'], false, $this->context->shop->id); } } } } } } } # validate module unset($pages); return $groupsList; }
private function _setGroupData($groupsList, $hook_name) { foreach ($groupsList as &$group) { if (isset($group["columns"])) { foreach ($group["columns"] as &$column) { $pages = array(); if (isset($column["pages"]) && $column["pages"]) { $column["pages"] = str_replace(", ", ",", $column["pages"]); $pages = explode(",", $column["pages"]); } if (isset($column["rows"])) { foreach ($column["rows"] as &$row) { //is a widget if ($row["type"] == "0") { $content = $this->_widgets->renderContent($row["key_widget"]); $content['type'] = LeomanagewidgetsHelper::processWidgetType($hook_name, $row["key_widget"], $content['type'], $content['data']); if ($this->_load_owl_carousel_lib == false) { $this->_load_owl_carousel_lib = LeomanagewidgetsHelper::enableLoadOwlCarouselLib($content['data']); } $row["content"] = $this->getWidgetContent($hook_name, $row["key_widget"], $content['type'], $content['data']); //is a module } else { if (isset($row["module_name"]) && isset($row["hook_name"]) && $row["module_name"] && $row["hook_name"]) { $row["content"] = $this->execModuleHook($row["hook_name"], array(), $row["module_name"], false, $this->context->shop->id); } } } } } } } return $groupsList; }