aboutsummaryrefslogtreecommitdiff
path: root/views/default/widgets/content_stats/content.php
blob: 568ebeeff4f017deedfe56343f2684f42957cb52 (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
<?php
/**
 * Content stats widget
 */

$max = $vars['entity']->num_display;

$entity_stats = get_entity_statistics();
$object_stats = $entity_stats['object'];
arsort($object_stats);
$object_stats = array_slice($object_stats, 0, $max);

echo '<table class="elgg-table-alt">';
echo '<tr><th>' . elgg_echo('widget:content_stats:type') . '</th>';
echo '<th>' . elgg_echo('widget:content_stats:number') . '</th></tr>';
foreach ($object_stats as $subtype => $num) {
	$name = elgg_echo("item:object:$subtype");
	echo "<tr><td>$name</td><td>$num</td></tr>";
}
echo '</table>';

echo elgg_view('output/url', array(
	'href' => 'pg/admin/statistics/overview',
	'text' => 'more',
));