Index: branches/5.2.x/core/units/permissions/permissions_tag_processor.php =================================================================== diff -u -N -r14244 -r14628 --- branches/5.2.x/core/units/permissions/permissions_tag_processor.php (.../permissions_tag_processor.php) (revision 14244) +++ branches/5.2.x/core/units/permissions/permissions_tag_processor.php (.../permissions_tag_processor.php) (revision 14628) @@ -1,6 +1,6 @@ Application->recallObject('SectionsHelper'); + /* @var $sections_helper kSectionsHelper */ + $section_data =& $sections_helper->getSectionData($section_name); return array_search($params['perm_name'], $section_data['permissions']) !== false; @@ -31,6 +33,8 @@ $section_name = $params['section_name']; $sections_helper =& $this->Application->recallObject('SectionsHelper'); + /* @var $sections_helper kSectionsHelper */ + $section_data =& $sections_helper->getSectionData($section_name); $ret = false; @@ -49,6 +53,8 @@ $perm_name = $params['perm_name']; $sections_helper =& $this->Application->recallObject('SectionsHelper'); + /* @var $sections_helper kSectionsHelper */ + $section_data =& $sections_helper->getSectionData($section_name); if ($section_data && isset($section_data['perm_prefix'])) { @@ -57,6 +63,8 @@ } $permissions_helper =& $this->Application->recallObject('PermissionsHelper'); + /* @var $permissions_helper kPermissionsHelper */ + if (!$permissions_helper->isOldPermission($section_name, $perm_name)) { $perm_name = $section_name.'.'.$perm_name; } @@ -181,25 +189,29 @@ * Returns category name by ID * * @param Array $params + * @return string + * @access protected */ - function CategoryPath($params) + protected function CategoryPath($params) { $category_id = $params['cat_id']; $cache_key = 'category_paths[%CIDSerial:' . $category_id . '%][%PhrasesSerial%][Adm:' . (int)$this->Application->isAdmin . ']'; $category_path = $this->Application->getCache($cache_key); - if ($category_path === false) { - // not chached - if ($category_id > 0) { + if ( $category_path === false ) { + // not cached + if ( $category_id > 0 ) { $id_field = $this->Application->getUnitOption('c', 'IDField'); $table_name = $this->Application->getUnitOption('c', 'TableName'); + $ml_formatter =& $this->Application->recallObject('kMultiLanguage'); + /* @var $ml_formatter kMultiLanguage */ - $sql = 'SELECT '.$ml_formatter->LangFieldName('CachedNavbar').' - FROM '.$table_name.' - WHERE '.$id_field.' = '.$category_id; + $sql = 'SELECT ' . $ml_formatter->LangFieldName('CachedNavbar') . ' + FROM ' . $table_name . ' + WHERE ' . $id_field . ' = ' . $category_id; $cached_navbar = preg_replace('/^Content(&\|&){0,1}/i', '', $this->Conn->GetOne($sql)); - $category_path = trim($this->CategoryPath( Array('cat_id' => 0) ).' > '.str_replace('&|&', ' > ', $cached_navbar), ' > '); + $category_path = trim($this->CategoryPath(Array ('cat_id' => 0)) . ' > ' . str_replace('&|&', ' > ', $cached_navbar), ' > '); } else { $category_path = $this->Application->Phrase(($this->Application->isAdmin ? 'la_' : 'lu_') . 'rootcategory_name');