Elgg  Version 3.0
username.php
Go to the documentation of this file.
1 <?php
2 
4  // only admins are allowed to change the username
5  return;
6 }
7 
9 if (!($user instanceof ElggUser)) {
10  return;
11 }
12 
14  '#type' => 'text',
15  '#help' => elgg_echo('user:username:help'),
16  'name' => 'username',
17  'value' => $user->username,
18 ]);
19 
20 echo elgg_view_module('info', elgg_echo('username'), $body);
elgg_view_field(array $params=[])
Renders a form field, usually with a wrapper element, a label, help text, etc.
Definition: views.php:1395
elgg_is_admin_logged_in()
Returns whether or not the viewer is currently logged in and an admin user.
Definition: sessions.php:57
if(!elgg_is_admin_logged_in()) $user
Definition: username.php:8
elgg_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
elgg_view_module($type, $title, $body, array $vars=[])
Wrapper function for the module display pattern.
Definition: views.php:1198
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
if(!($user instanceof ElggUser)) $body
Definition: username.php:13