From c56f7361ef949d7a00e159231f51fd7b427d0d52 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Tue, 12 Sep 2023 13:20:55 +0800 Subject: [PATCH] [docs] Remove registration changes We were able to deprecate the modal_factory entirely in 4.3, so for new code aimed at 4.3 onwards, there is no need to register. The new registration process is only available for 4.3 onwards, so it no longer makes sense to document this. Code aimed at versions including 4.2 and older will still need to register using the previous mechanism. --- docs/devupdate.md | 62 ----------------------------------------------- 1 file changed, 62 deletions(-) diff --git a/docs/devupdate.md b/docs/devupdate.md index 00f2345120..3efca17ad9 100644 --- a/docs/devupdate.md +++ b/docs/devupdate.md @@ -353,68 +353,6 @@ MyModal.create({ -### Registration helper - - - -Moodle 4.3 introduces a new `registerModalType` method on the Modal class to aid in registering a modal. - -:::note Compatibility with Moodle 4.2 and older - -If your code is intended to work with Moodle 4.2 and older, then you must continue to use the old method of registration. This legacy method will be maintained until Moodle 4.6. - -::: - - - - - - -The legacy registration will continue to work and should be used if your plugin will be used in Moodle 4.2, or earlier. - -```js -var MyModal = function(root) { - Modal.call(this, root); -}; - -MyModal.TYPE = 'mod_example/myModal'; -MyModal.prototype = Object.create(Modal.prototype); -MyModal.prototype.constructor = MyModal; - -let registered = false; -if (!registered) { - ModalRegistry.register(MyModal.TYPE, MyModal, 'mod_example/my_modal'); - registered = true; -} - -return MyModal; -``` - - - - - - - -The shortcut helper for Modal registration is suitable for Moodle 4.3 onwards. - -```js -export default class MyModal extends Modal { - static TYPE = 'mod_example/myModal'; - static TEMPLATE = 'mod_example/my_modal'; -} - -MyModal.registerModalType(); -``` - - - - - ## Forms API ### add_sticky_action_buttons