Changeset View
Changeset View
Standalone View
Standalone View
core/units/category_items/category_items_tag_processor.php
Show All 14 Lines | |||||
defined('FULL_PATH') or die('restricted access!'); | defined('FULL_PATH') or die('restricted access!'); | ||||
class CategoryItemsTagProcessor extends kDBTagProcessor | class CategoryItemsTagProcessor extends kDBTagProcessor | ||||
{ | { | ||||
function CategoryName($params) | function CategoryName($params) | ||||
{ | { | ||||
$field = $this->SelectParam($params, 'name,field'); | $field = $this->SelectParam($params, 'name,field'); | ||||
/** @var kDBList $object */ | |||||
$object = $this->getObject($params); | $object = $this->getObject($params); | ||||
/* @var $object kDBList */ | |||||
$root_phrase = $this->Application->Phrase(($this->Application->isAdmin ? 'la_' : 'lu_') . 'rootcategory_name'); | $root_phrase = $this->Application->Phrase(($this->Application->isAdmin ? 'la_' : 'lu_') . 'rootcategory_name'); | ||||
$cached_navbar = preg_replace('/^(Content&\|&|Content)/i', '', $object->GetDBField($field)); | $cached_navbar = preg_replace('/^(Content&\|&|Content)/i', '', $object->GetDBField($field)); | ||||
$value = str_replace('&|&', ' > ', $cached_navbar); | $value = str_replace('&|&', ' > ', $cached_navbar); | ||||
$ret = $root_phrase . ($value ? ' > ' : '') . $value; | $ret = $root_phrase . ($value ? ' > ' : '') . $value; | ||||
if ($object->GetDBField('PrimaryCat')) { | if ($object->GetDBField('PrimaryCat')) { | ||||
$label = $params['primary_title']; | $label = $params['primary_title']; | ||||
$ret .= ' (' . $this->Application->Phrase($label) . ')'; | $ret .= ' (' . $this->Application->Phrase($label) . ')'; | ||||
} | } | ||||
return $ret; | return $ret; | ||||
} | } | ||||
function GetMainID($params) | function GetMainID($params) | ||||
{ | { | ||||
$object = $this->getObject($params); | $object = $this->getObject($params); | ||||
$table_info = $object->getLinkedInfo(); | $table_info = $object->getLinkedInfo(); | ||||
return $table_info['ParentId']; | return $table_info['ParentId']; | ||||
} | } | ||||
} | } | ||||
No newline at end of file | No newline at end of file |