diff --git a/lib/upgrade.txt b/lib/upgrade.txt index 60b2b8c2708..c76c1720919 100644 --- a/lib/upgrade.txt +++ b/lib/upgrade.txt @@ -1,6 +1,10 @@ This files describes API changes in core libraries and APIs, information provided here is intended especially for developers. +=== 4.0 === +* New optional parameter $extracontent for print_collapsible_region_start(). This allows developers to add interactive HTML elements + (e.g. a help icon) after the collapsible region's toggle link. + === 3.10 === * PHPUnit has been upgraded to 8.5. That comes with a few changes: - Breaking change: All the "template methods" (setUp(), tearDown()...) now require to return void. This implies diff --git a/lib/weblib.php b/lib/weblib.php index 42518461eb6..a2ba0c34d91 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -2441,9 +2441,11 @@ function print_collapsible_region($contents, $classes, $id, $caption, $userpref * (May be blank if you do not wish the state to be persisted. * @param boolean $default Initial collapsed state to use if the user_preference it not set. * @param boolean $return if true, return the HTML as a string, rather than printing it. + * @param string $extracontent the extra content will show next to caption, eg.Help icon. * @return string|void if $return is false, returns nothing, otherwise returns a string of HTML. */ -function print_collapsible_region_start($classes, $id, $caption, $userpref = '', $default = false, $return = false) { +function print_collapsible_region_start($classes, $id, $caption, $userpref = '', $default = false, $return = false, + $extracontent = null) { global $PAGE; // Work out the initial state. @@ -2463,8 +2465,11 @@ function print_collapsible_region_start($classes, $id, $caption, $userpref = '', $output .= '