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_get_array_value('pagination', $vars, true);
$full_view = elgg_get_array_value('full_view', $vars, false);
$offset_key = elgg_get_array_value('offset_key', $vars, 'offset');
$position = elgg_get_array_value('position', $vars, 'after');
$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, $full_view);
$html .= '
';
}
$html .= '
';
}
if ($position == 'before' || $position == 'both') {
$html = $nav . $html;
}
if ($position == 'after' || $position == 'both') {
$html .= $nav;
}
echo $html;