core/addblockmodal

Description:
  • Show an add block modal instead of doing it on a separate page.

Source:
Deprecated:
  • since Moodle 4.2 - please use core_block/add_modal instead.
License:
  • http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Show an add block modal instead of doing it on a separate page.

Methods

(inner) buildAddBlockModal() → {Promise}

Description:
  • Method that creates the 'add block' modal.

Source:
Returns:

The modal promise (modal's body will be rendered later).

Type
Promise

(inner) getAddableBlocks(pageType, pageLayout, subPage) → {Promise}

Description:
  • Method that fetches all addable blocks in a given page.

Source:
Parameters:
Name Type Description
pageType String

The type of the page

pageLayout String

The layout of the page

subPage String

The subpage identifier

Returns:
Type
Promise

(inner) init(pageType, pageLayout, addBlockUrl, subPage)

Description:
  • Set up the actions.

Source:
Parameters:
Name Type Description
pageType String

The type of the page

pageLayout String

The layout of the page

addBlockUrl String | null

The add block URL

subPage String

The subpage identifier

(inner) registerListenerEvents(pageType, pageLayout, addBlockUrl, subPage)

Description:
  • Register related event listeners.

Source:
Parameters:
Name Type Description
pageType String

The type of the page

pageLayout String

The layout of the page

addBlockUrl String | null

The add block URL

subPage String

The subpage identifier

(inner) renderBlocks(addBlockUrl, pageType, pageLayout, subPage) → {Promise}

Description:
  • Method that renders the list of available blocks.

Source:
Parameters:
Name Type Description
addBlockUrl String

The add block URL

pageType String

The type of the page

pageLayout String

The layout of the page

subPage String

The subpage identifier

Returns:
Type
Promise