public static function getGroupOption() { $result = array(); $obj = new PsSliderGroup(); $groups = $obj->getGroups(null, null); foreach ($groups as $group) { $temp = array(); $temp['id'] = $group['id_pssliderlayer_groups']; $temp['name'] = $group['title']; $result[] = $temp; } return $result; }
/** * return list group */ public function renderGroupList() { $obj = new PsSliderGroup(); $id_shop = $this->context->shop->id; $groups = $obj->getGroups(null, $id_shop); foreach ($groups as $key => $group) { if ($group['id_pssliderlayer_groups'] == Tools::getValue('id_group') || !Tools::getValue('id_group') && !Tools::isSubmit('addNewGroup') && $group['id_pssliderlayer_groups'] == Configuration::get('PSSLIDERLAYER_GROUP_DE')) { $this->_currentGroup['id_group'] = $group['id_pssliderlayer_groups']; $this->_currentGroup['title'] = $group['title']; $params = Tools::jsonDecode(PsSliderSlide::base64Decode($group['params']), true); if ($params) { $groupResult = array(); } foreach ($params as $k => $v) { $groupResult[$k] = $v; } $groupResult['title'] = $group['title']; $groupResult['id_pssliderlayer_groups'] = $group['id_pssliderlayer_groups']; $groupResult['id_shop'] = $group['id_shop']; $groupResult['hook'] = $group['hook']; $groupResult['active'] = $group['active']; if ($groupResult) { $this->groupData = array_merge($this->groupData, $groupResult); } } $groups[$key]['status'] = $this->displayGStatus($group['id_pssliderlayer_groups'], $group['active']); } $this->context->smarty->assign(array('link' => $this->context->link, 'groups' => $groups, 'curentGroup' => $this->_currentGroup['id_group'], 'languages' => $this->context->controller->getLanguages(), 'exportLink' => Context::getContext()->link->getAdminLink('AdminPsSliderLayer') . '&ajax=1&exportGroup=1', 'previewLink' => Context::getContext()->link->getModuleLink($this->name, 'preview', array('secure_key' => $this->secure_key)), 'msecure_key' => $this->secure_key, 'exported' => Tools::getValue('exported'), 'export_folder' => _PS_MODULE_DIR_ . 'pssliderlayer/exports/')); return $this->display(__FILE__, 'grouplist.tpl'); }