Index: branches/5.2.x/core/units/helpers/navigation_bar.php =================================================================== diff -u -N -r15424 -r16055 --- branches/5.2.x/core/units/helpers/navigation_bar.php (.../navigation_bar.php) (revision 15424) +++ branches/5.2.x/core/units/helpers/navigation_bar.php (.../navigation_bar.php) (revision 16055) @@ -1,6 +1,6 @@ _getCurrentCategoryId(); - if ( isset($this->_params['shift']) && $this->_params['shift'] ) { - array_splice($category_path, 0, $this->_params['shift']); - } - $category_helper = $this->Application->recallObject('CategoryHelper'); /* @var $category_helper CategoryHelper */ @@ -226,7 +222,7 @@ $no_current = isset($this->_params['no_current']) && $this->_params['no_current']; $backup_category_id = $this->Application->GetVar('c_id'); - foreach ($category_path as $category_id => $category_name) { + foreach ($this->shiftCategoryPath($category_path) as $category_id => $category_name) { $block_params['cat_id'] = $category_id; $block_params['cat_name'] = $block_params['title'] = $category_name; @@ -257,6 +253,22 @@ } /** + * Shift category path. + * + * @param array $category_path Category path. + * + * @return array + */ + protected function shiftCategoryPath(array $category_path) + { + if ( isset($this->_params['shift']) && $this->_params['shift'] ) { + return array_slice($category_path, $this->_params['shift'], null, true); + } + + return $category_path; + } + + /** * Returns given category's parent path as array of id=>name elements * * @return Array @@ -364,4 +376,4 @@ return ''; } -} \ No newline at end of file +}