Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
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  'required' => true
35  ));
36  ?>
37 </div>
38 <div>
39  <label><?php echo elgg_echo('email'); ?></label><br />
40  <?php
41  echo elgg_view('input/text', array(
42  'name' => 'email',
43  'value' => $email,
44  'required' => true
45  ));
46  ?>
47 </div>
48 <div>
49  <label><?php echo elgg_echo('username'); ?></label><br />
50  <?php
51  echo elgg_view('input/text', array(
52  'name' => 'username',
53  'value' => $username,
54  'required' => true
55  ));
56  ?>
57 </div>
58 <div>
59  <label><?php echo elgg_echo('password'); ?></label><br />
60  <?php
61  echo elgg_view('input/password', array(
62  'name' => 'password',
63  'value' => $password,
64  'required' => true
65  ));
66  ?>
67 </div>
68 <div>
69  <label><?php echo elgg_echo('passwordagain'); ?></label><br />
70  <?php
71  echo elgg_view('input/password', array(
72  'name' => 'password2',
73  'value' => $password2,
74  'required' => true
75  ));
76  ?>
77 </div>
78 
79 <?php
80 // view to extend to add more fields to the registration form
81 echo elgg_view('register/extend', $vars);
82 
83 // Add captcha hook
84 echo elgg_view('input/captcha', $vars);
85 
86 echo '<div class="elgg-foot">';
87 echo elgg_view('input/hidden', array('name' => 'friend_guid', 'value' => $vars['friend_guid']));
88 echo elgg_view('input/hidden', array('name' => 'invitecode', 'value' => $vars['invitecode']));
89 echo elgg_view('input/submit', array('name' => 'submit', 'value' => elgg_echo('register')));
90 echo '</div>';
$password2
Definition: register.php:14
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
$name
Definition: register.php:16
$email
Definition: register.php:15
$vars['entity']
$password
Definition: register.php:13
get_input($variable, $default=null, $filter_result=true)
Get some input from variables passed submitted through GET or POST.
Definition: input.php:27
elgg_view($view, $vars=array(), $ignore1=false, $ignore2=false, $viewtype= '')
Return a parsed view.
Definition: views.php:342
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1310
$username
Definition: register.php:12
elgg_is_sticky_form($form_name)
Does form submission data exist for this form?
Definition: input.php:131
elgg_clear_sticky_form($form_name)
Remove form submission data from the session.
Definition: input.php:119
elgg_get_sticky_values($form_name, $filter_result=true)
Get all submission data cached for a form.
Definition: input.php:161