Skip to content

Commit

Permalink
MDL-78324 badges: Remove unnecessary Modal
Browse files Browse the repository at this point in the history
The core/utility confirmation modal can be used in this case to confirm
backpack actions. It is not necessary to have a custom module for this
purpose.
  • Loading branch information
andrewnicols committed Sep 8, 2023
1 parent 96e32d6 commit adce287
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 0 additions & 2 deletions badges/classes/output/external_backpacks_page.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ public function __construct(\moodle_url $url) {
public function export_for_template(\renderer_base $output) {
global $PAGE;

$PAGE->requires->js_call_amd('core_badges/backpackactions', 'init');

$rownumber = 0;
$rowcount = count($this->backpacks);

Expand Down
11 changes: 10 additions & 1 deletion badges/templates/external_backpacks_page.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,16 @@
<td>
<a href="{{baseurl}}?id={{id}}&action=edit">{{#pix}}t/edit, core,{{#str}}editsettings{{/str}}{{/pix}}</a>
{{^sitebackpack}}
<a href="{{baseurl}}?id={{id}}&action=delete" role="button" data-action="deletebackpack">
<a {{!
}} href="{{baseurl}}?id={{id}}&action=delete" {{!
}} role="button" {{!
}} data-modal="confirmation" {{!
}} data-modal-type="delete" {{!
}} data-modal-content-str='["delexternalbackpackconfirm", "core_badges", {{#quote}}{{backpackweburl}}{{/quote}}]' {{!
}} data-modal-title-str='["delexternalbackpack", "core_badges"]' {{!
}} data-modal-yes-button-str='["delete", "core"]' {{!
}} data-modal-destination="{{baseurl}}?id={{id}}&action=delete&sesskey={{sesskey}}&confirm=1" {{!
}}>
{{#pix}}t/delete, core,{{#str}}delete{{/str}}{{/pix}}
</a>
{{/sitebackpack}}
Expand Down

0 comments on commit adce287

Please sign in to comment.