Elgg  Version 6.1
useradd.php
Go to the documentation of this file.
1 <?php
6 elgg_import_esm('forms/useradd');
7 
8 echo elgg_view_field([
9  '#type' => 'text',
10  '#label' => elgg_echo('name'),
11  'name' => 'name',
12  'value' => elgg_extract('name', $vars),
13  'required' => true,
14 ]);
15 
16 echo elgg_view_field([
17  '#type' => 'text',
18  '#label' => elgg_echo('username'),
19  'name' => 'username',
20  'value' => elgg_extract('username', $vars),
21  'required' => true,
22 ]);
23 
24 echo elgg_view_field([
25  '#type' => 'email',
26  '#label' => elgg_echo('email'),
27  'name' => 'email',
28  'value' => elgg_extract('email', $vars),
29  'required' => true,
30 ]);
31 
32 echo elgg_view_field([
33  '#type' => 'switch',
34  '#label' => elgg_echo('autogen_password_option'),
35  'name' => 'autogen_password',
36  'value' => elgg_extract('autogen_password', $vars),
37 ]);
38 
39 echo elgg_view_field([
40  '#type' => 'password',
41  '#label' => elgg_echo('password'),
42  'name' => 'password',
43  'required' => true,
44  'autocomplete' => 'new-password',
45  'add_security_requirements' => true,
46 ]);
47 
48 echo elgg_view_field([
49  '#type' => 'password',
50  '#label' => elgg_echo('passwordagain'),
51  'name' => 'password2',
52  'required' => true,
53  'autocomplete' => 'new-password',
54  'add_security_requirements' => true,
55 ]);
56 
57 echo elgg_view_field([
58  '#type' => 'switch',
59  '#label' => elgg_echo('admin_option'),
60  'name' => 'admin',
61  'value' => elgg_extract('admin', $vars),
62 ]);
63 
65  '#type' => 'submit',
66  'text' => elgg_echo('register'),
67 ]);
68 
elgg_view_field(array $params=[])
Renders a form field, usually with a wrapper element, a label, help text, etc.
Definition: views.php:1112
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
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:256
elgg_set_form_footer(string $footer= '')
Sets form footer and defers its rendering until the form view and extensions have been rendered...
Definition: views.php:1046
elgg_import_esm(string $name)
Helper functions for external files like css/js.
$vars
Definition: theme.php:5
$footer
Definition: useradd.php:64