aboutsummaryrefslogtreecommitdiff
path: root/views/default/annotation/list.php
blob: f432ad6409884db5ec5ba225875836c38c6f5667 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/**
 * Annotation list
 *
 * @uses $vars['annotations']
 * @uses $vars['limit']
 * @uses $vars['offset']
 * @uses $vars['count']
 * @uses $vars['pagination']
 */

$offset = $vars['offset'];
$limit = $vars['limit'];
$count = $vars['count'];
$annotations = $vars['annotations'];
$pagination = elgg_get_array_value('pagination', $vars, true);

$html = "";
$nav = "";

if ($pagination) {
	$nav .= elgg_view('navigation/pagination', array(
		'baseurl' => $_SERVER['REQUEST_URI'],
		'offset' => $offset,
		'count' => $count,
		'limit' => $limit,
		'word' => 'annoff',
		'nonefound' => false,
	));
}

if (is_array($annotations) && count($annotations) > 0) {
	$html .= '<ul class="elgg-annotation-list elgg-list">';
	foreach ($annotations as $annotation) {
			$html .= '<li>';
			$html .= elgg_view_annotation($annotation, true);
			$html .= '</li>';
	}
	$html .= '</ul>';
}

if ($count) {
	$html .= $nav;
}

echo $html;