Skip to content

Commit

Permalink
Fix markup in account_prefs_inc.php
Browse files Browse the repository at this point in the history
The sequence of wrapping divs was different from the usual layout,
causing inconsistent spacing when the account preferences section
was displayed on manage_user_edit_page.php.

edit_account_prefs() no longer prints the outer div, letting the parent
page take care of it.

Fixes #27574
  • Loading branch information
dregad committed Nov 21, 2020
1 parent ac22c04 commit f65b0ca
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 29 deletions.
56 changes: 30 additions & 26 deletions account_prefs_inc.php
Expand Up @@ -93,17 +93,8 @@ function edit_account_prefs( $p_user_id = null, $p_error_if_protected = true, $p
}
?>

<div class="col-md-12 col-xs-12">
<div class="space-10"></div>

<div id="account-prefs-update-div" class="form-container">
<form id="account-prefs-update-form" method="post" action="account_prefs_update.php" class="form-inline">
<fieldset>
<?php echo form_security_field( 'account_prefs_update' ) ?>
<input type="hidden" name="user_id" value="<?php echo $p_user_id ?>" />
<input type="hidden" name="redirect_url" value="<?php echo $t_redirect_url ?>" />

<div class="widget-box widget-color-blue2">
<div class="widget-box widget-color-blue2">
<div class="widget-header widget-header-small">
<h4 class="widget-title lighter">
<i class="ace-icon fa fa-sliders"></i>
Expand All @@ -112,8 +103,15 @@ function edit_account_prefs( $p_user_id = null, $p_error_if_protected = true, $p
</div>

<div class="widget-body">
<div class="widget-main no-padding">
<div class="table-responsive">
<div class="widget-main no-padding">
<div id="account-prefs-update-div" class="form-container">
<form id="account-prefs-update-form" method="post" action="account_prefs_update.php" class="form-inline">
<fieldset>
<?php echo form_security_field( 'account_prefs_update' ) ?>
<input type="hidden" name="user_id" value="<?php echo $p_user_id ?>" />
<input type="hidden" name="redirect_url" value="<?php echo $t_redirect_url ?>" />

<div class="table-responsive">
<table class="table table-bordered table-condensed table-striped">

<tr>
Expand Down Expand Up @@ -395,22 +393,28 @@ function edit_account_prefs( $p_user_id = null, $p_error_if_protected = true, $p
</tr>
<?php event_signal( 'EVENT_ACCOUNT_PREF_UPDATE_FORM', array( $p_user_id ) ); ?>
</table>
</div>
</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' ) ?>" />
</div>
</fieldset>
</form>
</div>
</div>
<div class="widget-toolbox padding-8 clearfix">
<button form="account-prefs-update-form"
class="btn btn-primary btn-white btn-round">
<?php echo lang_get( 'update_prefs_button' ) ?>
</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>
</div>
<?php
print_form_button(
'account_prefs_reset.php',
lang_get( 'reset_prefs_button' ),
array( 'user_id' => $p_user_id, 'redirect_url' => $t_redirect_url ),
null,
'btn btn-primary btn-white btn-round'
);
?>
</div>
</div>
</fieldset>
</form>
</div>

</div>

<?php
Expand Down
9 changes: 8 additions & 1 deletion account_prefs_page.php
Expand Up @@ -66,7 +66,14 @@
layout_page_header( lang_get( 'change_preferences_link' ) );

layout_page_begin();
?>

edit_account_prefs();
<div class="col-md-12 col-xs-12">
<div class="space-10"></div>

<?php edit_account_prefs(); ?>

</div>

<?php
layout_page_end();
15 changes: 13 additions & 2 deletions manage_user_edit_page.php
Expand Up @@ -367,10 +367,21 @@

<?php
} # End of PROJECT ACCESS conditional section
echo '</div>';
?>

<!-- ACCOUNT PREFERENCES -->
<?php
define( 'ACCOUNT_PREFS_INC_ALLOW', true );
include( dirname( __FILE__ ) . '/account_prefs_inc.php' );
edit_account_prefs( $t_user['id'], false, false, 'manage_user_edit_page.php?user_id=' . $t_user_id );
edit_account_prefs(
$t_user['id'],
false,
false,
'manage_user_edit_page.php?user_id=' . $t_user_id
);
?>

</div>

<?php
layout_page_end();

0 comments on commit f65b0ca

Please sign in to comment.