Skip to content

Commit

Permalink
MDL-78528 completion: Add a new customdata to hide Cancel button
Browse files Browse the repository at this point in the history
A new customdata setting has been added to edit_base_form to let
hide the Cancel button (and only display the "Save changes" button).
  • Loading branch information
sarjona committed Jun 28, 2023
1 parent 947d1c8 commit d34c0e1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion completion/classes/edit_base_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@ public function definition() {
$mform->addElement('static', 'qwerty', '', get_string('hiddenrules', 'completion', join(', ', $conflicts)));
}

$this->add_action_buttons();
// Whether to show the cancel button or not in the form.
$displaycancel = $this->_customdata['displaycancel'] ?? true;
$this->add_action_buttons($displaycancel);
}

/**
Expand Down

0 comments on commit d34c0e1

Please sign in to comment.