MDL-78324 badges: Remove unnecessary Modal

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.
This commit is contained in:
Andrew Nicols 2023-05-23 21:42:43 +08:00
parent 96e32d6f90
commit adce2874b0
No known key found for this signature in database
GPG Key ID: 6D1E3157C8CFBF14
2 changed files with 10 additions and 3 deletions

View File

@ -64,8 +64,6 @@ class external_backpacks_page implements \renderable {
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);

View File

@ -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}}