/** * Returns specific attribute type * @param $lang * @return array */ public function getType($lang) { $repo = new AttributeRepository(); return $repo->getTypes($lang, $this->type); }
public function dispShopToolEditAttribute() { $srl = Context::get('attribute_srl'); $attributeRepository = new AttributeRepository(); if (!$attributes = $attributeRepository->getAttributes(array($srl))) throw new ShopException("Attribute doesn't exist"); $attribute = array_shift($attributes); if(is_array($attribute->values)) $attribute->values = implode('|', $attribute->values); Context::set('attribute', $attribute); Context::set('types', $attributeRepository->getTypes(Context::get('lang'))); // Retrieve existing categories $categoryRepository = new CategoryRepository(); $tree = $categoryRepository->getCategoriesTree($this->module_srl); // Prepare tree for display $tree_config = new HtmlCategoryTreeConfig(); $tree_config->showCheckbox = TRUE; $tree_config->selected = $attribute->category_scope; $tree_config->checkboxesName = 'category_scope'; $tree_config->HTMLmode = FALSE; $HTML_tree = $tree->toHTML($tree_config); Context::set('HTML_tree', $HTML_tree); $this->setTemplateFile('AddAttribute'); }