Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 310 and 402] [Versions 311 and 402] [Versions 39 and 402] [Versions 400 and 402] [Versions 401 and 402]

Blocks external API

Copyright: 2017 Juan Leyva <juan@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 314 lines (13 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: core_block_external  - X-Ref

Blocks external functions

get_block_structure()   X-Ref
Returns a block structure.

return: external_single_structure a block single structure.

get_all_current_page_blocks($includeinvisible = false, $returncontents = false)   X-Ref
Convenience function for getting all the blocks of the current $PAGE.

param: bool $includeinvisible Whether to include not visible blocks or not
param: bool $returncontents Whether to return the block contents
return: array Block information

get_course_blocks_parameters()   X-Ref
Returns description of get_course_blocks parameters.

return: external_function_parameters

get_course_blocks($courseid, $returncontents = false)   X-Ref
Returns blocks information for a course.

param: int $courseid The course id
param: bool $returncontents Whether to return the block contents
return: array Blocks list and possible warnings

get_course_blocks_returns()   X-Ref
Returns description of get_course_blocks result values.

return: external_single_structure

get_dashboard_blocks_parameters()   X-Ref
Returns description of get_dashboard_blocks parameters.

return: external_function_parameters

get_dashboard_blocks($userid = 0, $returncontents = false, $mypage = MY_PAGE_DEFAULT)   X-Ref
Returns blocks information for the given user dashboard.

param: int $userid The user id to retrieve the blocks from, optional, default is to current user.
param: bool $returncontents Whether to return the block contents
param: string $mypage The page to get blocks of within my
return: array Blocks list and possible warnings

get_dashboard_blocks_returns()   X-Ref
Returns description of get_dashboard_blocks result values.

return: external_single_structure