diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-04-02 01:30:30 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-04-02 01:30:30 +0000 |
commit | a112284bc2420bb8cfb336857ad3d772cd0f3ed3 (patch) | |
tree | 9e207db209b4f5fec0e9edc6d58f4ed490b4278f /views | |
parent | 656bcd37c35b4a330394cdd2d9f9b84c8d9541bc (diff) | |
download | elgg-a112284bc2420bb8cfb336857ad3d772cd0f3ed3.tar.gz elgg-a112284bc2420bb8cfb336857ad3d772cd0f3ed3.tar.bz2 |
Fixes #3233 useradd form is now sticky
git-svn-id: http://code.elgg.org/elgg/trunk@8901 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views')
-rw-r--r-- | views/default/forms/useradd.php | 53 |
1 files changed, 46 insertions, 7 deletions
diff --git a/views/default/forms/useradd.php b/views/default/forms/useradd.php index e2152e654..fcb93a6c6 100644 --- a/views/default/forms/useradd.php +++ b/views/default/forms/useradd.php @@ -7,6 +7,16 @@ * */ +$name = $username = $email = $password = $password2 = $admin = ''; + +if (elgg_is_sticky_form('useradd')) { + extract(elgg_get_sticky_values('useradd')); + elgg_clear_sticky_form('useradd'); + if (is_array($admin)) { + $admin = $admin[0]; + } +} + $admin_option = false; if ((elgg_get_logged_in_user_entity()->isAdmin()) && ($vars['show_admin'])) { $admin_option = true; @@ -14,33 +24,62 @@ if ((elgg_get_logged_in_user_entity()->isAdmin()) && ($vars['show_admin'])) { ?> <div> <label><?php echo elgg_echo('name');?></label><br /> - <?php echo elgg_view('input/text' , array('name' => 'name')); ?> + <?php + echo elgg_view('input/text', array( + 'name' => 'name', + 'value' => $name, + )); + ?> </div> <div> <label><?php echo elgg_echo('username'); ?></label><br /> - <?php echo elgg_view('input/text' , array('name' => 'username')); ?> + <?php + echo elgg_view('input/text', array( + 'name' => 'username', + 'value' => $username, + )); + ?> </div> <div> <label><?php echo elgg_echo('email'); ?></label><br /> - <?php echo elgg_view('input/text' , array('name' => 'email')); ?> + <?php + echo elgg_view('input/text', array( + 'name' => 'email', + 'value' => $email, + )); + ?> </div> <div> <label><?php echo elgg_echo('password'); ?></label><br /> - <?php echo elgg_view('input/password' , array('name' => 'password')); ?> + <?php + echo elgg_view('input/password', array( + 'name' => 'password', + 'value' => $password, + )); + ?> </div> <div> <label><?php echo elgg_echo('passwordagain'); ?></label><br /> - <?php echo elgg_view('input/password' , array('name' => 'password2')); ?> + <?php + echo elgg_view('input/password', array( + 'name' => 'password2', + 'value' => $password2, + )); + ?> </div> <?php if ($admin_option) { echo "<div>"; - echo elgg_view('input/checkboxes', array('name' => "admin", 'options' => array(elgg_echo('admin_option')))); + echo elgg_view('input/checkboxes', array( + 'name' => "admin", + 'options' => array(elgg_echo('admin_option') => 1), + 'value' => $admin, + )); echo "</div>"; } ?> <div> - <?php echo elgg_view('input/submit', array('name' => 'submit', 'value' => elgg_echo('register'))); ?> + <?php echo elgg_view('input/submit', array('value' => elgg_echo('register'))); ?> </div>
\ No newline at end of file |