Elgg  Version 1.11
register.php
Go to the documentation of this file.
1 <?php
9 if (elgg_is_sticky_form('register')) {
10  $values = elgg_get_sticky_values('register');
11 
12  // Add the sticky values to $vars so views extending
13  // register/extend also get access to them.
14  $vars = array_merge($vars, $values);
15 
16  elgg_clear_sticky_form('register');
17 } else {
18  $values = array();
19 }
20 
22 $username = elgg_extract('username', $values, get_input('u'));
23 $email = elgg_extract('email', $values, get_input('e'));
24 $name = elgg_extract('name', $values, get_input('n'));
25 
26 ?>
27 <div class="mtm">
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  'autofocus' => true,
34  ));
35  ?>
36 </div>
37 <div>
38  <label><?php echo elgg_echo('email'); ?></label><br />
39  <?php
40  echo elgg_view('input/text', array(
41  'name' => 'email',
42  'value' => $email,
43  ));
44  ?>
45 </div>
46 <div>
47  <label><?php echo elgg_echo('username'); ?></label><br />
48  <?php
49  echo elgg_view('input/text', array(
50  'name' => 'username',
51  'value' => $username,
52  ));
53  ?>
54 </div>
55 <div>
56  <label><?php echo elgg_echo('password'); ?></label><br />
57  <?php
58  echo elgg_view('input/password', array(
59  'name' => 'password',
60  'value' => $password,
61  ));
62  ?>
63 </div>
64 <div>
65  <label><?php echo elgg_echo('passwordagain'); ?></label><br />
66  <?php
67  echo elgg_view('input/password', array(
68  'name' => 'password2',
69  'value' => $password2,
70  ));
71  ?>
72 </div>
73 
74 <?php
75 // view to extend to add more fields to the registration form
76 echo elgg_view('register/extend', $vars);
77 
78 // Add captcha hook
79 echo elgg_view('input/captcha', $vars);
80 
81 echo '<div class="elgg-foot">';
82 echo elgg_view('input/hidden', array('name' => 'friend_guid', 'value' => $vars['friend_guid']));
83 echo elgg_view('input/hidden', array('name' => 'invitecode', 'value' => $vars['invitecode']));
84 echo elgg_view('input/submit', array('name' => 'submit', 'value' => elgg_echo('register')));
85 echo '</div>';
elgg_is_sticky_form($form_name)
Has this form been made sticky?
Definition: input.php:131
$password2
Definition: register.php:14
get_input($variable, $default=null, $filter_result=true)
Get some input from variables passed submitted through GET or POST.
Definition: input.php:27
elgg_clear_sticky_form($form_name)
Clear the sticky form cache.
Definition: input.php:119
$name
Definition: register.php:16
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
$email
Definition: register.php:15
fieldset div
Definition: admin.php:470
$password
Definition: register.php:13
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
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
$username
Definition: register.php:12
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
if(file_exists($welcome)) $vars
Definition: upgrade.php:93