Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/units/helpers/menu_helper.php
Show First 20 Lines • Show All 162 Lines • ▼ Show 20 Line(s) | |||||
* @param Array $params | * @param Array $params | ||||
* @return int | * @return int | ||||
*/ | */ | ||||
function _getCategoryId($params) | function _getCategoryId($params) | ||||
{ | { | ||||
$cat = isset($params['category_id']) && $params['category_id'] != '' ? $params['category_id'] : $this->Application->GetVar('m_cat_id'); | $cat = isset($params['category_id']) && $params['category_id'] != '' ? $params['category_id'] : $this->Application->GetVar('m_cat_id'); | ||||
if ( "$cat" == 'parent' ) { | if ( "$cat" == 'parent' ) { | ||||
/** @var kDBItem $this_category */ | |||||
$this_category = $this->Application->recallObject('c'); | $this_category = $this->Application->recallObject('c'); | ||||
/* @var $this_category kDBItem */ | |||||
$cat = $this_category->GetDBField('ParentId'); | $cat = $this_category->GetDBField('ParentId'); | ||||
} | } | ||||
elseif ( $cat == 0 ) { | elseif ( $cat == 0 ) { | ||||
$cat = $this->Application->getBaseCategory(); | $cat = $this->Application->getBaseCategory(); | ||||
} | } | ||||
return $cat; | return $cat; | ||||
▲ Show 20 Lines • Show All 159 Lines • ▼ Show 20 Line(s) | |||||
* @return Array | * @return Array | ||||
* @access protected | * @access protected | ||||
*/ | */ | ||||
protected function _getSubCategories($parent_id, $category_limit = NULL) | protected function _getSubCategories($parent_id, $category_limit = NULL) | ||||
{ | { | ||||
static $items_by_parent = NULL, $lang_part = NULL; | static $items_by_parent = NULL, $lang_part = NULL; | ||||
if ( !isset($lang_part) ) { | if ( !isset($lang_part) ) { | ||||
/** @var kMultiLanguageHelper $ml_helper */ | |||||
$ml_helper = $this->Application->recallObject('kMultiLanguageHelper'); | $ml_helper = $this->Application->recallObject('kMultiLanguageHelper'); | ||||
/* @var $ml_helper kMultiLanguageHelper */ | |||||
$lang_part = ''; | $lang_part = ''; | ||||
$languages = $ml_helper->getLanguages(); | $languages = $ml_helper->getLanguages(); | ||||
foreach ($languages as $language_id) { | foreach ($languages as $language_id) { | ||||
$lang_part .= 'c.l' . $language_id . '_MenuTitle AS l' . $language_id . '_ItemName,' . "\n"; | $lang_part .= 'c.l' . $language_id . '_MenuTitle AS l' . $language_id . '_ItemName,' . "\n"; | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |