Elgg  Version 2.3
content.php
Go to the documentation of this file.
1 <?php
6 $widget = elgg_extract('entity', $vars);
7 
8 $num_display = sanitize_int($widget->num_display, false);
9 // set default value for display number
10 if (!$num_display) {
11  $num_display = 8;
12 }
13 
16 arsort($object_stats);
17 $object_stats = array_slice($object_stats, 0, $num_display);
18 
19 echo '<table class="elgg-table-alt">';
20 echo '<tr><th>' . elgg_echo('widget:content_stats:type') . '</th>';
21 echo '<th>' . elgg_echo('widget:content_stats:number') . '</th></tr>';
22 foreach ($object_stats as $subtype => $num) {
23  $name = elgg_echo("item:object:$subtype");
24  echo "<tr><td>$name</td><td>$num</td></tr>";
25 }
26 echo '</table>';
27 
28 echo '<div class="mtm elgg-widget-more">';
29 echo elgg_view('output/url', [
30  'href' => 'admin/statistics/overview',
31  'text' => elgg_echo('more'),
32  'is_trusted' => true,
33 ]);
34 echo '</div>';
get_entity_statistics($owner_guid=0)
Return an array reporting the number of various entities in the system.
Definition: statistics.php:20
if($guid==elgg_get_logged_in_user_guid()) $name
Definition: delete.php:21
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
if(elgg_in_context('default_widgets')) $widget
Definition: content.php:8
if(!$num_display) $entity_stats
Definition: content.php:14
$subtype
Definition: delete.php:28
elgg echo
Translates a string.
Definition: languages.js:48
elgg_view($view, $vars=array(), $ignore1=false, $ignore2=false, $viewtype= '')
Return a parsed view.
Definition: views.php:336
$num_display
Definition: content.php:7
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1375
$object_stats
Definition: content.php:15
$vars['title']
Definition: content.php:19
sanitize_int($int, $signed=true)
Sanitizes an integer for database use.
Definition: database.php:180