element
* @uses $vars['item_class'] Additional CSS class for the
elements
*/
$items = $vars['items'];
$offset = elgg_extract('offset', $vars);
$limit = elgg_extract('limit', $vars);
$count = elgg_extract('count', $vars);
$base_url = elgg_extract('base_url', $vars, '');
$pagination = elgg_extract('pagination', $vars, true);
$offset_key = elgg_extract('offset_key', $vars, 'offset');
$position = elgg_extract('position', $vars, 'after');
$list_class = 'elgg-list';
if (isset($vars['list_class'])) {
$list_class = "$list_class {$vars['list_class']}";
}
$item_class = 'elgg-item';
if (isset($vars['item_class'])) {
$item_class = "$item_class {$vars['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;