Skip to content

Commit

Permalink
Move Delete Custom Field button to form footer
Browse files Browse the repository at this point in the history
Using the HTML5 button's `formaction` property we can get rid of the
separate form that caused the button to be displayed below the Edit box,
and put the Delete button in the main form's footer

Fixes #27274
  • Loading branch information
dregad authored and CasN committed Aug 29, 2022
1 parent 4ecce1e commit 37cb16b
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions manage_custom_field_edit_page.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,29 +372,19 @@ class="ace" value="1"
</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_custom_field_button' ) ?>"
/>
<button class="btn btn-primary btn-white btn-round">
<?php echo lang_get( 'update_custom_field_button' ) ?>
</button>
<button class="btn btn-primary btn-white btn-round"
formaction="manage_custom_field_delete.php">
<?php echo lang_get( 'delete_custom_field_button' ) ?>
</button>
</div>
</div>
</form>
</div>
</div>

<div class="col-md-12 col-xs-12">
<div class="space-10"></div>
<form method="post" action="manage_custom_field_delete.php" class="pull-right">
<fieldset>
<?php echo form_security_field( 'manage_custom_field_delete' ); ?>
<input type="hidden" name="field_id" value="<?php echo $f_field_id ?>" />
<input type="hidden" name="return" value="<?php echo string_attribute( $f_return ) ?>" />
<input type="submit" class="btn btn-primary btn-sm btn-white btn-round"
value="<?php echo lang_get( 'delete_custom_field_button' ) ?>"
/>
</fieldset>
</form>
</div>

<?php /** @todo There is access checking in the ADD action page and at the top of this file.
* We may need to add extra checks to exclude projects from the list that the user
* can't link/unlink fields from/to. */
Expand Down

0 comments on commit 37cb16b

Please sign in to comment.