Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/units/helpers/category_helper.php
Show First 20 Lines • Show All 195 Lines • ▼ Show 20 Line(s) | |||||
if ( $data ) { | if ( $data ) { | ||||
$data = unserialize($data); | $data = unserialize($data); | ||||
return $data; | return $data; | ||||
} | } | ||||
// generate structure tree from scratch | // generate structure tree from scratch | ||||
/** @var kMultiLanguageHelper $ml_helper */ | |||||
$ml_helper = $this->Application->recallObject('kMultiLanguageHelper'); | $ml_helper = $this->Application->recallObject('kMultiLanguageHelper'); | ||||
/* @var $ml_helper kMultiLanguageHelper */ | |||||
$languages = $ml_helper->getLanguages(); | $languages = $ml_helper->getLanguages(); | ||||
$root_category = $this->Application->getBaseCategory(); | $root_category = $this->Application->getBaseCategory(); | ||||
$data = $this->_getChildren($root_category, $languages); | $data = $this->_getChildren($root_category, $languages); | ||||
if ( $this->Application->isCachingType(CACHING_TYPE_MEMORY) ) { | if ( $this->Application->isCachingType(CACHING_TYPE_MEMORY) ) { | ||||
$this->Application->setCache('master:StructureTree', serialize($data)); | $this->Application->setCache('master:StructureTree', serialize($data)); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Line(s) | |||||
// OR on Front-End, because it's not used there | // OR on Front-End, because it's not used there | ||||
return Array (); | return Array (); | ||||
} | } | ||||
if ( isset($this->_structureTree) ) { | if ( isset($this->_structureTree) ) { | ||||
return $this->_structureTree; | return $this->_structureTree; | ||||
} | } | ||||
/** @var kThemesHelper $themes_helper */ | |||||
$themes_helper = $this->Application->recallObject('ThemesHelper'); | $themes_helper = $this->Application->recallObject('ThemesHelper'); | ||||
/* @var $themes_helper kThemesHelper */ | |||||
$data = $this->_getStructureTree(); | $data = $this->_getStructureTree(); | ||||
$theme_id = (int)$themes_helper->getCurrentThemeId(); | $theme_id = (int)$themes_helper->getCurrentThemeId(); | ||||
$this->_primaryLanguageId = $this->Application->GetDefaultLanguageId(); | $this->_primaryLanguageId = $this->Application->GetDefaultLanguageId(); | ||||
$this->_structureTree = $this->_printChildren($data, $data['id'], $this->Application->GetVar('m_lang'), $theme_id); | $this->_structureTree = $this->_printChildren($data, $data['id'], $this->Application->GetVar('m_lang'), $theme_id); | ||||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |