Index: branches/5.0.x/core/kernel/db/db_tag_processor.php =================================================================== diff -u -r12382 -r12497 --- branches/5.0.x/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 12382) +++ branches/5.0.x/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 12497) @@ -1,6 +1,6 @@ getObject($params); + $grids = $this->Application->getUnitOption($this->Prefix, 'Grids'); + $grid = $grids[ $params['grid'] ]; - $grids = $this->Application->getUnitOption($this->Prefix,'Grids'); - $icons =& $grids[ $params['grid'] ]['Icons']; + if (!array_key_exists('Icons', $grid)) { + return ''; + } - $key = ''; - $status_fields = $this->Application->getUnitOption($this->Prefix,'StatusField'); - if(!$status_fields) return $icons['default']; + $icons = $grid['Icons']; - foreach($status_fields as $status_field) - { - $key .= $object->GetDBField($status_field).'_'; + if (array_key_exists('name', $params)) { + $icon_name = $params['name']; + return array_key_exists($icon_name, $icons) ? $icons[$icon_name] : ''; } - $key = rtrim($key,'_'); - $value = ($key !== false) ? $key : 'default'; - return isset($icons[$value]) ? $icons[$value] : $icons['default']; + $status_fields = $this->Application->getUnitOption($this->Prefix, 'StatusField'); + + if (!$status_fields) { + return $icons['default']; + } + + $object =& $this->getObject($params); + /* @var $object kDBList */ + + $icon = ''; + + foreach ($status_fields as $status_field) { + $icon .= $object->GetDBField($status_field) . '_'; + } + + $icon = rtrim($icon, '_'); + + return array_key_exists($icon, $icons) ? $icons[$icon] : $icons['default']; } /**