Elgg  Version 5.1
content.php
Go to the documentation of this file.
1 <?php
7 
9 if (empty($registered_entity_types)) {
10  echo elgg_view('output/longtext', [
11  'value' => elgg_echo('notfound'),
12  ]);
13 }
14 
15 $stats = [];
16 
18  foreach ($subtypes as $subtype) {
19  $value = elgg_extract($subtype, elgg_extract($type, $entity_stats), false);
20  if ($value !== false) {
21  $stats[elgg_echo("collection:{$type}:{$subtype}")] = $value;
22  }
23  }
24 }
25 
26 arsort($stats);
27 
28 echo '<table class="elgg-table">';
29 echo '<thead><tr>';
30 echo elgg_format_element('th', [], elgg_echo('admin:statistics:numentities:type'));
31 echo elgg_format_element('th', [], elgg_echo('admin:statistics:numentities:number'));
32 echo '</tr></thead>';
33 echo '<tbody>';
34 
35 foreach ($stats as $name => $num) {
36  echo "<tr><td>{$name}</td><td>{$num}</td></tr>";
37 }
38 
39 echo '</tbody>';
40 echo '</table>';
41 
42 echo elgg_view('page/components/list/widget_more', [
43  'widget_more' => elgg_view_url('admin/statistics/numentities', elgg_echo('more')),
44 ]);
elgg_get_entity_statistics(int $owner_guid=0)
Return an array reporting the number of various entities in the system.
Definition: entities.php:657
if(empty($registered_entity_types)) $stats
Definition: content.php:15
if(!$user||!$user->canDelete()) $name
Definition: delete.php:22
$entity_stats
Content stats widget.
Definition: content.php:6
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
$type
Definition: delete.php:22
$value
Definition: generic.php:51
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:254
elgg_view(string $view, array $vars=[], string $viewtype= '')
Return a parsed view.
Definition: views.php:177
$registered_entity_types
Definition: content.php:8
elgg_view_url(string $href, string $text=null, array $options=[])
Helper function for outputting urls.
Definition: views.php:1481
$subtype
Definition: delete.php:23
$subtypes
elgg_entity_types_with_capability(string $capability)
Returns an array of type/subtypes with the requested capability enabled.
Definition: entities.php:738
elgg_format_element(string $tag_name, array $attributes=[], string $text= '', array $options=[])
Format an HTML element.
Definition: output.php:145