Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

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

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: 334 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.

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

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.

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

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.

return: array Blocks list and possible warnings
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

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

return: external_single_structure