element
* @uses $vars['item_class'] Additional CSS class for the
elements
*/
$items = $vars['items'];
$offset = $vars['offset'];
$limit = $vars['limit'];
$count = $vars['count'];
$base_url = $vars['base_url'];
$pagination = elgg_extract('pagination', $vars, true);
$offset_key = elgg_extract('offset_key', $vars, 'offset');
$position = elgg_extract('position', $vars, 'after');
// @todo standardize on full_view - will require backward compatible code
if (isset($vars['full_view'])) {
$vars['full'] = $vars['full_view'];
}
$list_class = 'elgg-list';
if (isset($vars['list_class'])) {
$list_class = "{$vars['list_class']} $list_class";
}
$item_class = 'elgg-list-item';
if (isset($vars['item_class'])) {
$item_class = "{$vars['item_class']} $item_class";
}
$html = "";
$nav = "";
if ($pagination && $count) {
$nav .= elgg_view('navigation/pagination', array(
'baseurl' => $base_url,
'offset' => $offset,
'count' => $count,
'limit' => $limit,
'offset_key' => $offset_key,
));
}
if (is_array($items) && count($items) > 0) {
$html .= "";
foreach ($items as $item) {
if (elgg_instanceof($item)) {
$id = "elgg-{$item->getType()}-{$item->getGUID()}";
} else {
$id = "item-{$item->getType()}-{$item->id}";
}
$html .= "- ";
$html .= elgg_view_list_item($item, $vars);
$html .= '
';
}
$html .= '
';
}
if ($position == 'before' || $position == 'both') {
$html = $nav . $html;
}
if ($position == 'after' || $position == 'both') {
$html .= $nav;
}
echo $html;