Index: branches/RC/core/units/categories/categories_tag_processor.php =================================================================== diff -u -N -r11164 -r11368 --- branches/RC/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 11164) +++ branches/RC/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 11368) @@ -329,7 +329,12 @@ $no_special = isset($params['no_special']) && $params['no_special']; if ($no_special) return $this->Special; - $list_unique_key = $this->getUniqueListKey($params).$parent_cat_id; + $list_unique_key = $this->getUniqueListKey($params); + if (!$this->Application->IsAdmin()) { + // add parent category to special, when on Front-End, + // because there can be many category lists on same page + $list_unique_key .= $parent_cat_id; + } if ($list_unique_key == '') { return parent::BuildListSpecial($params); } @@ -854,6 +859,64 @@ $url_params = Array('admin' => 1, 'pass' => 'm', 'index_file' => 'index.php'); return $this->Application->HREF($template,'_FRONT_END_', $url_params); } + + function InitCatalogTab($params) + { + $tab_params['mode'] = $this->Application->GetVar('tm'); // single/multi selection possible + $tab_params['special'] = $this->Application->GetVar('ts'); // use special for this tab + $tab_params['dependant'] = $this->Application->GetVar('td'); // is grid dependant on categories grid + + // set default params (same as in catalog) + if ($tab_params['mode'] === false) $tab_params['mode'] = 'multi'; + if ($tab_params['special'] === false) $tab_params['special'] = ''; + if ($tab_params['dependant'] === false) $tab_params['dependant'] = 'yes'; + + // pass params to block with tab content + $params['name'] = $params['render_as']; + $params['prefix'] = trim($this->Prefix.'.'.($tab_params['special'] ? $tab_params['special'] : $this->Special), '.'); + + $prefix_append = $this->Application->GetVar('prefix_append'); + if ($prefix_append) { + $params['prefix'] .= $prefix_append; + } + + $default_grid = array_key_exists('default_grid', $params) ? $params['default_grid'] : 'Default'; + $radio_grid = array_key_exists('radio_grid', $params) ? $params['radio_grid'] : 'Radio'; + + $params['cat_prefix'] = trim('c.'.($tab_params['special'] ? $tab_params['special'] : $this->Special), '.'); + $params['tab_mode'] = $tab_params['mode']; + $params['grid_name'] = ($tab_params['mode'] == 'multi') ? $default_grid : $radio_grid; + $params['tab_dependant'] = $tab_params['dependant']; + $params['show_category'] = $tab_params['special'] == 'showall' ? 1 : 0; // this is advanced view -> show category name + + return $this->Application->ParseBlock($params, 1); + } + + /** + * Show CachedNavbar of current item primary category + * + * @param Array $params + * @return string + */ + function CategoryName($params) + { + // show category cachednavbar of + $object =& $this->getObject($params); + $category_id = isset($params['cat_id']) ? $params['cat_id'] : $object->GetDBField('CategoryId'); + + $category_path = $this->Application->getCache('category_paths', $category_id); + if ($category_path === false) { + // not chached + if ($category_id > 0) { + $category_path = trim($this->CategoryName( Array('cat_id' => 0) ).' > '.str_replace('&|&', ' > ', $object->GetField('CachedNavbar')), ' > '); + } + else { + $category_path = $this->Application->Phrase( $this->Application->ConfigValue('Root_Name') ); + } + $this->Application->setCache('category_paths', $category_id, $category_path); + } + return $category_path; + } } ?> \ No newline at end of file