Index: branches/5.2.x/core/units/helpers/category_helper.php =================================================================== diff -u -N -r14560 -r14628 --- branches/5.2.x/core/units/helpers/category_helper.php (.../category_helper.php) (revision 14560) +++ branches/5.2.x/core/units/helpers/category_helper.php (.../category_helper.php) (revision 14628) @@ -1,6 +1,6 @@ Application->getCache($cache_key); - if ($cached_path === false) { + if ( $cached_path === false ) { $ml_formatter =& $this->Application->recallObject('kMultiLanguage'); + /* @var $ml_formatter kMultiLanguage */ + $navbar_field = $ml_formatter->LangFieldName('CachedNavBar'); $id_field = $this->Application->getUnitOption('c', 'IDField'); $table_name = $this->Application->getUnitOption('c', 'TableName'); $this->Conn->nextQueryCachable = true; - $sql = 'SELECT '.$navbar_field.', ParentPath - FROM '.$table_name.' - WHERE '.$id_field.' = '.$main_category_id; + $sql = 'SELECT ' . $navbar_field . ', ParentPath + FROM ' . $table_name . ' + WHERE ' . $id_field . ' = ' . $main_category_id; $category_data = $this->Conn->GetRow($sql); $cached_path = Array (); $skip_category = $this->Application->getBaseCategory(); - if ($category_data) { + if ( $category_data ) { $category_names = explode('&|&', $category_data[$navbar_field]); $category_ids = explode('|', substr($category_data['ParentPath'], 1, -1)); foreach ($category_ids as $category_index => $category_id) { - if ($category_id == $skip_category) { + if ( $category_id == $skip_category ) { continue; } @@ -326,26 +328,31 @@ return $cached_path; } - /** - * Not tag, method for parameter - * selection from list in this TagProcessor + /** + * Not tag. Method for parameter selection from list in this TagProcessor * * @param Array $params - * @param string $possible_names + * @param Array $possible_names + * * @return string - * @access public + * @access protected */ - function SelectParam($params, $possible_names) + protected function SelectParam($params, $possible_names) { - if (!is_array($params)) return; - if (!is_array($possible_names)) + if ( !is_array($params) ) { + return ''; + } + if ( !is_array($possible_names) ) { + $possible_names = explode(',', $possible_names); + } - $possible_names = explode(',', $possible_names); - foreach ($possible_names as $name) - { - if( isset($params[$name]) ) return $params[$name]; + foreach ($possible_names as $name) { + if ( isset($params[$name]) ) { + return $params[$name]; + } } - return false; + + return ''; } /**