Elgg  Version 6.1
statistics.php
Go to the documentation of this file.
1 <?php
7 
9 if (!$user instanceof \ElggUser) {
12 }
13 
14 if (!$user->canEdit()) {
15  throw new EntityPermissionsException();
16 }
17 
18 if ($user->guid === elgg_get_logged_in_user_guid()) {
19  $title = elgg_echo('usersettings:statistics');
20 } else {
21  $title = elgg_echo('usersettings:statistics:user', [$user->getDisplayName()]);
22 }
23 
24 echo elgg_view_page($title, [
25  'content' => elgg_view('core/settings/statistics', [
26  'entity' => $user,
27  ]),
28  'show_owner_block_menu' => false,
29  'filter_id' => 'settings',
30  'filter_value' => 'statistics',
31 ]);
$title
Definition: generic.php:50
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
elgg_set_page_owner_guid(int $guid)
Set the guid of the entity that owns this page.
Definition: pageowner.php:34
$user
Definition: statistics.php:8
elgg_view(string $view, array $vars=[], string $viewtype= '')
Return a parsed view.
Definition: views.php:156
Thrown when entity can not be edited or container permissions do not allow it to be written...
elgg_view_page(string $title, string|array $body, string $page_shell= 'default', array $vars=[])
Assembles and outputs a full page.
Definition: views.php:235
elgg_get_page_owner_entity()
Gets the owner entity for the current page.
Definition: pageowner.php:23
elgg_get_logged_in_user_entity()
Return the current logged in user, or null if no user is logged in.
Definition: sessions.php:24
elgg_get_logged_in_user_guid()
Return the current logged in user by guid.
Definition: sessions.php:34