getList4grid(array('addonWhere' => " and show_on_home = 'y'", 'order_by' => 'home_sorter')); $anc = $anc['list']; if (is_array($anc) && !empty($anc)) { foreach ($anc as &$v) { $v['clicks'] = $DBObj->getClick($v['id']); if ($v['id_type'] == 2) { // event announcement $v['event'] = $this->getEventData($v['id_event']); } } } $Doc->addContent(array('tpl' => 'Announcement/summary.tpl', 'list' => $anc)); } function getEventData($id_event) { $id_event = (int)$id_event; $Events = SiteMap::getObj('Event/Event.php'); $ev = $Events->getList4grid(array('addonWhere' => ' and Event.id = ' . $id_event)); return $ev['list'][0]; } }