Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/units/helpers/navigation_bar.php
Show First 20 Lines • Show All 197 Lines • ▼ Show 20 Line(s) | |||||
if ( !$category_path ) { | if ( !$category_path ) { | ||||
// in "Home" category | // in "Home" category | ||||
return ''; | return ''; | ||||
} | } | ||||
$main_category_id = $this->_getCurrentCategoryId(); | $main_category_id = $this->_getCurrentCategoryId(); | ||||
/** @var CategoryHelper $category_helper */ | |||||
$category_helper = $this->Application->recallObject('CategoryHelper'); | $category_helper = $this->Application->recallObject('CategoryHelper'); | ||||
/* @var $category_helper CategoryHelper */ | |||||
$module_info = $category_helper->getCategoryModule($this->_params, array_keys($category_path)); | $module_info = $category_helper->getCategoryModule($this->_params, array_keys($category_path)); | ||||
$module_item_id = $this->Application->GetVar($module_info['Var'] . '_id'); | $module_item_id = $this->Application->GetVar($module_info['Var'] . '_id'); | ||||
$ret = ''; | $ret = ''; | ||||
$block_params = $this->_getBaseParams(); | $block_params = $this->_getBaseParams(); | ||||
$block_params['category'] = 1; | $block_params['category'] = 1; | ||||
$block_params['template'] = ''; // to prevent warning when category element is rendered using general "render_as" block | $block_params['template'] = ''; // to prevent warning when category element is rendered using general "render_as" block | ||||
▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Line(s) | |||||
$category_title = isset($this->_params['category_title']) ? $this->_params['category_title'] : 'Name'; | $category_title = isset($this->_params['category_title']) ? $this->_params['category_title'] : 'Name'; | ||||
$cache_key = 'parent_paths_named[%CIDSerial:' . $main_category_id . '%]:' . $category_title; | $cache_key = 'parent_paths_named[%CIDSerial:' . $main_category_id . '%]:' . $category_title; | ||||
$cached_path = $this->Application->getCache($cache_key); | $cached_path = $this->Application->getCache($cache_key); | ||||
if ( $cached_path === false ) { | if ( $cached_path === false ) { | ||||
$parent_path = explode('|', substr($this->getParentPath($main_category_id), 1, -1)); | $parent_path = explode('|', substr($this->getParentPath($main_category_id), 1, -1)); | ||||
/** @var kMultiLanguage $ml_formatter */ | |||||
$ml_formatter = $this->Application->recallObject('kMultiLanguage'); | $ml_formatter = $this->Application->recallObject('kMultiLanguage'); | ||||
/* @var $ml_formatter kMultiLanguage */ | |||||
$navbar_field = $ml_formatter->LangFieldName($category_title); | $navbar_field = $ml_formatter->LangFieldName($category_title); | ||||
$id_field = $this->Application->getUnitOption('c', 'IDField'); | $id_field = $this->Application->getUnitOption('c', 'IDField'); | ||||
$table_name = $this->Application->getUnitOption('c', 'TableName'); | $table_name = $this->Application->getUnitOption('c', 'TableName'); | ||||
$this->Conn->nextQueryCachable = true; | $this->Conn->nextQueryCachable = true; | ||||
$sql = 'SELECT ' . $navbar_field . ', ' . $id_field . ' | $sql = 'SELECT ' . $navbar_field . ', ' . $id_field . ' | ||||
▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines |