getObject($params); $url = $object->GetDBField($params['field']); if (!preg_match('/^(http|ftp|mailto:)(.*)/U', $url)) { $url = 'http://' . $url; } return $url; } /** * Show CachedNavbar of current item primary category * * @param Array $params * @return string */ function CategoryName($params) { // show category cachednavbar of $object =& $this->getObject($params); $category_id = isset($params['cat_id']) ? $params['cat_id'] : $object->GetDBField('CategoryId'); $category_path = $this->Application->getCache('category_paths', $category_id); if ($category_path === false) { // not chached if ($category_id > 0) { $cached_navbar = preg_replace('/^(Content&\|&|Content)/i', '', $object->GetDBField('CachedNavbar')); $category_path = trim($this->CategoryName( Array('cat_id' => 0) ).' > '.str_replace('&|&', ' > ', $cached_navbar), ' > '); } else { $category_path = $this->Application->Phrase( $this->Application->ConfigValue('Root_Name') ); } $this->Application->setCache('category_paths', $category_id, $category_path); } return $category_path; } }