Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401] [Versions 401 and 402] [Versions 401 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.

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