Skip to content

Commit

Permalink
Move "Reset Prefs" button to footer
Browse files Browse the repository at this point in the history
Thanks to the 'formaction' attribute, there is no need for a separate
HTML form, so we can reuse the existing hidden inputs to submit to
account_prefs_reset.php.

Fixes #23267
  • Loading branch information
dregad committed Sep 4, 2017
1 parent 9eabe60 commit c2b21b8
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions account_prefs_inc.php
Expand Up @@ -391,24 +391,16 @@ function edit_account_prefs( $p_user_id = null, $p_error_if_protected = true, $p
</div>
<div class="widget-toolbox padding-8 clearfix">
<input type="submit" class="btn btn-primary btn-white btn-round" value="<?php echo lang_get( 'update_prefs_button' ) ?>" />

<?php echo form_security_field( 'account_prefs_reset' ) ?>
<input type="submit" class="btn btn-primary btn-white btn-round"
formaction="account_prefs_reset.php"
value="<?php echo lang_get( 'reset_prefs_button' ) ?>" />
</div>
</form>
</div>
</div>
</div>

<div class="space-10"></div>

<div id="account-prefs-reset-div" class="form-container">
<form id="account-prefs-reset-form" method="post" action="account_prefs_reset.php">
<fieldset>
<?php echo form_security_field( 'account_prefs_reset' ) ?>
<input type="hidden" name="user_id" value="<?php echo $p_user_id ?>" />
<input type="hidden" name="redirect_url" value="<?php echo $t_redirect_url ?>" />
<input type="submit" class="btn btn-primary btn-white btn-round" value="<?php echo lang_get( 'reset_prefs_button' ) ?>" />
</fieldset>
</form>
</div>
</div>

<?php
Expand Down

0 comments on commit c2b21b8

Please sign in to comment.