diff --git a/admin/tool/componentlibrary/content/moodle/javascript/confirm.md b/admin/tool/componentlibrary/content/moodle/javascript/confirm.md index 091ebf5bc98..d2d4944d7b2 100644 --- a/admin/tool/componentlibrary/content/moodle/javascript/confirm.md +++ b/admin/tool/componentlibrary/content/moodle/javascript/confirm.md @@ -16,7 +16,7 @@ to the element that will trigger the confirmation modal. ## Source files -* `lib/amd/src/confirm.js` ({{< jsdoc module="core/confirm" >}}) +* `lib/amd/src/utility.js` ({{< jsdoc module="core/utility" >}}) * `lib/templates/modal.mustache` ## Usage @@ -24,7 +24,7 @@ The confirmation AMD module is loaded automatically, so the only thing you need to the target element: {{< highlight html >}} +data-confirmation-content-str='["areyousure"]' data-confirmation-yes-button-str='["delete", "core"]'>Show confirmation modal {{< /highlight >}} You can also use it on PHP, you just need to set the attributes parameter to any moodle output component that takes attributes: @@ -32,7 +32,7 @@ You can also use it on PHP, you just need to set the attributes parameter to any echo $OUTPUT->single_button('#', get_string('delete'), 'get', [ 'data-confirmation' => 'modal', 'data-confirmation-title-str' => json_encode(['delete', 'core']), - 'data-confirmation-question-str' => json_encode(['areyousure']), + 'data-confirmation-content-str' => json_encode(['areyousure']), 'data-confirmation-yes-button-str' => json_encode(['delete', 'core']) ]); {{< / php >}} @@ -56,8 +56,8 @@ echo $OUTPUT->single_button('#', get_string('delete'), 'get', [ The modal title language string identifier, must be provided in JSON encoded format. - data-confirmation-question-str - The confirmation question language string identifier, must be provided in JSON encoded format. + data-confirmation-content-str + The confirmation modal main content language string identifier, must be provided in JSON encoded format. data-confirmation-yes-button-str @@ -84,14 +84,14 @@ echo $OUTPUT->single_button('#', get_string('delete'), 'get', [ {{< example >}} +data-confirmation-content-str='["areyousure"]' data-confirmation-yes-button-str='["delete", "core"]'>Show confirmation modal {{< /example >}} ### Confirmation modal with a toast {{< example >}} {{< /example >}} @@ -99,6 +99,6 @@ data-confirmation-toast-confirmation-str='["deleteblockinprogress", "block", "On {{< example >}} {{< /example >}}