Elgg  Version 1.11
useradd.php
Go to the documentation of this file.
1 <?php
10 if (elgg_is_sticky_form('useradd')) {
11  $values = elgg_get_sticky_values('useradd');
12  elgg_clear_sticky_form('useradd');
13 } else {
14  $values = array();
15 }
16 
18 $name = elgg_extract('name', $values);
19 $username = elgg_extract('username', $values);
20 $email = elgg_extract('email', $values);
21 $admin = elgg_extract('admin', $values);
22 if (is_array($admin)) {
23  $admin = array_shift($admin);
24 }
25 
26 ?>
27 <div>
28  <label><?php echo elgg_echo('name');?></label><br />
29  <?php
30  echo elgg_view('input/text', array(
31  'name' => 'name',
32  'value' => $name,
33  ));
34  ?>
35 </div>
36 <div>
37  <label><?php echo elgg_echo('username'); ?></label><br />
38  <?php
39  echo elgg_view('input/text', array(
40  'name' => 'username',
41  'value' => $username,
42  ));
43  ?>
44 </div>
45 <div>
46  <label><?php echo elgg_echo('email'); ?></label><br />
47  <?php
48  echo elgg_view('input/text', array(
49  'name' => 'email',
50  'value' => $email,
51  ));
52  ?>
53 </div>
54 <div>
55  <label><?php echo elgg_echo('password'); ?></label><br />
56  <?php
57  echo elgg_view('input/password', array(
58  'name' => 'password',
59  'value' => $password,
60  ));
61  ?>
62 </div>
63 <div>
64  <label><?php echo elgg_echo('passwordagain'); ?></label><br />
65  <?php
66  echo elgg_view('input/password', array(
67  'name' => 'password2',
68  'value' => $password2,
69  ));
70  ?>
71 </div>
72 <div>
73 <?php
74  echo elgg_view('input/checkboxes', array(
75  'name' => "admin",
76  'options' => array(elgg_echo('admin_option') => 1),
77  'value' => $admin,
78  ));
79 ?>
80 </div>
81 
82 <div class="elgg-foot">
83  <?php echo elgg_view('input/submit', array('value' => elgg_echo('register'))); ?>
84 </div>
elgg_is_sticky_form($form_name)
Has this form been made sticky?
Definition: input.php:131
$name
Definition: useradd.php:16
elgg_clear_sticky_form($form_name)
Clear the sticky form cache.
Definition: input.php:119
$admin
Definition: useradd.php:18
$username
Definition: useradd.php:12
elgg_extract($key, array $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1246
fieldset div
Definition: admin.php:470
$password2
Definition: useradd.php:14
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
$email
Definition: useradd.php:15
elgg echo
Translates a string.
Definition: languages.js:43
elgg_view($view, $vars=array(), $bypass=false, $ignored=false, $viewtype= '')
Return a parsed view.
Definition: views.php:354
label
Definition: admin.php:460
elgg_get_sticky_values($form_name, $filter_result=true)
Get all the values in a sticky form in an array.
Definition: input.php:162
$password
Definition: useradd.php:13