_groups = array(); $Qgroups = $osC_Database->query('select * from :table_products_images_groups where language_id = :language_id'); $Qgroups->bindTable(':table_products_images_groups', TABLE_PRODUCTS_IMAGES_GROUPS); $Qgroups->bindInt(':language_id', $osC_Language->getID()); $Qgroups->setCache('images_groups-' . $osC_Language->getID()); $Qgroups->execute(); while ($Qgroups->next()) { $this->_groups[$Qgroups->valueInt('id')] = $Qgroups->toArray(); } $Qgroups->freeResult(); } function getID($code) { foreach ($this->_groups as $group) { if ($group['code'] == $code) { return $group['id']; } } return 1; } function getCode($id) { return $this->_groups[$id]['code']; } function getWidth($code) { return $this->_groups[$this->getID($code)]['size_width']; } function getHeight($code) { return $this->_groups[$this->getID($code)]['size_height']; } function show(&$image, &$title, $parameters = '', $group = 'default') { $group_id = $this->getID($group); $width = $height = ''; if ($this->_groups[$group_id]['force_size'] == '1') { $width = $this->_groups[$group_id]['size_width']; $height = $this->_groups[$group_id]['size_height']; } return tep_image(DIR_WS_HTTP_CATALOG . DIR_WS_IMAGES . 'products/' . $this->_groups[$group_id]['code'] . '/' . $image, $title, $width, $height, $parameters); } function getAddress(&$image, $group = 'default') { $group_id = $this->getID($group); return DIR_WS_IMAGES . 'products/' . $this->_groups[$group_id]['code'] . '/' . $image; } } ?>