Index: branches/RC/core/units/categories/categories_tag_processor.php
===================================================================
diff -u -r11648 -r11649
--- branches/RC/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 11648)
+++ branches/RC/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 11649)
@@ -962,7 +962,8 @@
// 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), '.');
+ $special = $tab_params['special'] ? $tab_params['special'] : $this->Special;
+ $params['prefix'] = trim($this->Prefix.'.'.$special, '.');
$prefix_append = $this->Application->GetVar('prefix_append');
if ($prefix_append) {
@@ -978,6 +979,10 @@
$params['tab_dependant'] = $tab_params['dependant'];
$params['show_category'] = $tab_params['special'] == 'showall' ? 1 : 0; // this is advanced view -> show category name
+ if ($special == 'showall' || $special == 'user') {
+ $params['grid_name'] .= 'ShowAll';
+ }
+
return $this->Application->ParseBlock($params, 1);
}
@@ -997,8 +1002,24 @@
if ($category_path === false) {
// not chached
if ($category_id > 0) {
- $cached_navbar = preg_replace('/^Content&\|&/i', '', $object->GetField('CachedNavbar'));
+ $cached_navbar = $object->GetField('CachedNavbar');
+ if ($category_id == $object->GetDBField('ParentId')) {
+ // parent category cached navbar is one element smaller, then current ones
+ $cached_navbar = explode('&|&', $cached_navbar);
+ array_pop($cached_navbar);
+ $cached_navbar = implode('&|&', $cached_navbar);
+ }
+ else {
+ // no relation with current category object -> query from db
+ $sql = 'SELECT l' . $this->Application->GetVar('m_lang') . '_CachedNavbar
+ FROM ' . $object->TableName . '
+ WHERE ' . $object->IDField . ' = ' . $category_id;
+ $cached_navbar = $this->Conn->GetOne($sql);
+ }
+
+ $cached_navbar = preg_replace('/^Content&\|&/i', '', $cached_navbar);
+
$category_path = trim($this->CategoryName( Array('cat_id' => 0) ).' > '.str_replace('&|&', ' > ', $cached_navbar), ' > ');
}
else {
Index: branches/RC/core/units/general/cat_tag_processor.php
===================================================================
diff -u -r11538 -r11649
--- branches/RC/core/units/general/cat_tag_processor.php (.../cat_tag_processor.php) (revision 11538)
+++ branches/RC/core/units/general/cat_tag_processor.php (.../cat_tag_processor.php) (revision 11649)
@@ -142,8 +142,10 @@
// 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), '.');
+ $special = $tab_params['special'] ? $tab_params['special'] : $this->Special;
+ $params['prefix'] = trim($this->Prefix.'.'.$special, '.');
+
$prefix_append = $this->Application->GetVar('prefix_append');
if ($prefix_append) {
$params['prefix'] .= $prefix_append;
@@ -152,12 +154,17 @@
$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['cat_prefix'] = trim('c.'.$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
+ if ($special == 'showall' || $special == 'user') {
+ $params['grid_name'] .= 'ShowAll';
+ }
+
return $this->Application->ParseBlock($params, 1);
}
Index: branches/RC/core/admin_templates/catalog_tab.tpl
===================================================================
diff -u -r11623 -r11649
--- branches/RC/core/admin_templates/catalog_tab.tpl (.../catalog_tab.tpl) (revision 11623)
+++ branches/RC/core/admin_templates/catalog_tab.tpl (.../catalog_tab.tpl) (revision 11649)
@@ -50,24 +50,22 @@
$menu_frame.SyncActive('');*/
+
+
+ ">
+
+
-
- *
-
-
-
-
- : ">
-
, '');" title="">
-
- *
-
+
+ *
+
+
Index: branches/RC/core/units/general/cat_event_handler.php
===================================================================
diff -u -r11538 -r11649
--- branches/RC/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 11538)
+++ branches/RC/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 11649)
@@ -2424,6 +2424,16 @@
$this->Application->setUnitOption($event->Prefix, 'ListSortings', $list_sortings);
}
+
+ // add grids for advanced view (with primary category column)
+ $grids = $this->Application->getUnitOption($this->Prefix, 'Grids');
+ $process_grids = Array ('Default', 'Radio');
+ foreach ($process_grids as $process_grid) {
+ $grid_data = $grids[$process_grid];
+ $grid_data['Fields']['CachedNavbar'] = Array ('title' => 'la_col_Path', 'data_block' => 'grid_primary_category_td', 'filter_block' => 'grid_like_filter');
+ $grids[$process_grid . 'ShowAll'] = $grid_data;
+ }
+ $this->Application->setUnitOption($this->Prefix, 'Grids', $grids);
}
/**
Index: branches/RC/core/units/categories/categories_event_handler.php
===================================================================
diff -u -r11646 -r11649
--- branches/RC/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 11646)
+++ branches/RC/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 11649)
@@ -1600,6 +1600,16 @@
$list_sortings['']['ForcedSorting'] = Array ("CurrentSort" => 'asc');
$this->Application->setUnitOption($event->Prefix, 'ListSortings', $list_sortings);
}
+
+ // add grids for advanced view (with primary category column)
+ $grids = $this->Application->getUnitOption($this->Prefix, 'Grids');
+ $process_grids = Array ('Default', 'Radio');
+ foreach ($process_grids as $process_grid) {
+ $grid_data = $grids[$process_grid];
+ $grid_data['Fields']['CachedNavbar'] = Array ('title' => 'la_col_Path', 'data_block' => 'grid_parent_category_td', 'filter_block' => 'grid_like_filter');
+ $grids[$process_grid . 'ShowAll'] = $grid_data;
+ }
+ $this->Application->setUnitOption($this->Prefix, 'Grids', $grids);
}
function _printChildren(&$data, $parent_category_id, $language_id, $theme_id, $level = 0)
Index: branches/RC/core/admin_templates/categories/ci_blocks.tpl
===================================================================
diff -u -r11623 -r11649
--- branches/RC/core/admin_templates/categories/ci_blocks.tpl (.../ci_blocks.tpl) (revision 11623)
+++ branches/RC/core/admin_templates/categories/ci_blocks.tpl (.../ci_blocks.tpl) (revision 11649)
@@ -18,15 +18,20 @@
-
+
+
+
+
+
+
|