Elgg  Version 3.0
numentities.php
Go to the documentation of this file.
1 <?php
10 if (!$user instanceof ElggUser) {
11  return;
12 }
13 
15 
16 if (empty($entity_stats)) {
17  return;
18 }
19 
20 $rows = '';
21 
22 foreach ($entity_stats as $k => $entry) {
23  foreach ($entry as $a => $b) {
24  if ($a == "__base__") {
25  $a = elgg_echo("collection:{$k}");
26  if (empty($a)) {
27  $a = $k;
28  }
29  } else {
30  $a = elgg_echo("collection:{$k}:{$a}");
31  if (empty($a)) {
32  $a = "$k $a";
33  }
34  }
35  $rows .= <<< END
36  <tr>
37  <td class="column-one"><b>{$a}:</b></td>
38  <td>{$b}</td>
39  </tr>
40 END;
41  }
42 }
43 
44 $title = elgg_echo('usersettings:statistics:label:numentities');
45 $content = "<table class=\"elgg-table-alt\">$rows</table>";
46 
get_entity_statistics($owner_guid=0)
Return an array reporting the number of various entities in the system.
Definition: statistics.php:22
$user
Definition: numentities.php:9
$content
Definition: numentities.php:45
elgg_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
foreach($entity_stats as $k=> $entry) $title
Definition: numentities.php:44
elgg_view_module($type, $title, $body, array $vars=[])
Wrapper function for the module display pattern.
Definition: views.php:1198
$rows
Definition: numentities.php:33
elgg echo
Translates a string.
Definition: languages.js:43
elgg_get_page_owner_entity()
Gets the owner entity for the current page.
Definition: pageowner.php:65
$entity_stats
Definition: numentities.php:3