Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/units/helpers/category_helper.php
Show First 20 Lines • Show All 203 Lines • ▼ Show 20 Line(s) | |||||
/** @var kMultiLanguageHelper $ml_helper */ | /** @var kMultiLanguageHelper $ml_helper */ | ||||
$ml_helper = $this->Application->recallObject('kMultiLanguageHelper'); | $ml_helper = $this->Application->recallObject('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), 0); | ||||
} | } | ||||
else { | else { | ||||
$this->Application->setDBCache('StructureTree', serialize($data)); | $this->Application->setDBCache('StructureTree', serialize($data), 0); | ||||
} | } | ||||
return $data; | return $data; | ||||
} | } | ||||
/** | /** | ||||
* Returns template mapping (between physical and virtual pages) | * Returns template mapping (between physical and virtual pages) | ||||
* | * | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | |||||
else { | else { | ||||
$dst_template = preg_replace('/^Content\//i', '', $page['DstTemplate']); | $dst_template = preg_replace('/^Content\//i', '', $page['DstTemplate']); | ||||
} | } | ||||
$mapping[$src_template] = $dst_template; | $mapping[$src_template] = $dst_template; | ||||
} | } | ||||
if ( $this->Application->isCachingType(CACHING_TYPE_MEMORY) ) { | if ( $this->Application->isCachingType(CACHING_TYPE_MEMORY) ) { | ||||
$data = $this->Application->setCache('master:template_mapping', serialize($mapping)); | $data = $this->Application->setCache('master:template_mapping', serialize($mapping), 0); | ||||
} | } | ||||
else { | else { | ||||
$this->Application->setDBCache('template_mapping', serialize($mapping)); | $this->Application->setDBCache('template_mapping', serialize($mapping), 0); | ||||
} | } | ||||
return $mapping; | return $mapping; | ||||
} | } | ||||
/** | /** | ||||
* Returns category structure as field option list | * Returns category structure as field option list | ||||
* | * | ||||
▲ Show 20 Lines • Show All 73 Lines • Show Last 20 Lines |