Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 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: 297 lines (12 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)   X-Ref
Returns blocks information for the given user dashboard.

param: int $userid The user id to retrive the blocks from, optional, default is to current user.
param: bool $returncontents Whether to return the block contents
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