get('groupby', 0)) : $cats = []; $cols = $params->get('groupby_columns', 3); foreach ($list as $l) : $cats[] = array('catid' => $l->catid, 'title' => $l->category_title); endforeach; $cats = array_values(array_map('unserialize', array_unique(array_map('serialize', $cats)))); foreach ($cats as $k => $cat) : $items = []; foreach ($list as $item) : if ($item->catid == $cat['catid']) : $items[] = $item; endif; endforeach; if ($cols > 1) : if ($k % $cols == 0) : echo '
'; endif; echo '
'; endif; if ($params->get('groupby_showtitle', 1)) : echo '' . htmlspecialchars($cat['title'], ENT_COMPAT, 'UTF-8') . ''; endif; echo ''; if ($cols > 1) : echo '
'; if (($k + 1) % $cols == 0 || $k == count($cats) - 1) : echo '
'; endif; endif; endforeach; else : echo ''; endif; ?>