diff --git a/lib/upgrade.txt b/lib/upgrade.txt index 07ad74ea2fc..b1690b06dfd 100644 --- a/lib/upgrade.txt +++ b/lib/upgrade.txt @@ -22,6 +22,8 @@ information provided here is intended especially for developers. * Google APIs Client Library (lib/google/) has been upgraded to 1.0.5-beta and API has changed dramatically without backward compatibility. Any code accessing it must be amended. It does not apply to lib/googleapi.php. See MDL-47297 +* Added an extra parameter to the function get_formatted_help_string() (default null) which is used to specify + additional string parameters. DEPRECATIONS: * completion_info->get_incomplete_criteria() is deprecated and will be removed in Moodle 3.0. diff --git a/lib/weblib.php b/lib/weblib.php index 7e56c1b1075..63e9b8cb500 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -3487,6 +3487,8 @@ function print_password_policy() { * @param boolean $ajax Whether this help is called from an AJAX script. * This is used to influence text formatting and determines * which format to output the doclink in. + * @param string|object|array $a An object, string or number that can be used + * within translation strings * @return Object An object containing: * - heading: Any heading that there may be for this help string. * - text: The wiki-formatted help string. @@ -3494,7 +3496,7 @@ function print_password_policy() { * CSS classes to apply to that link. Only present if $ajax = false. * - completedoclink: A text representation of the doclink. Only present if $ajax = true. */ -function get_formatted_help_string($identifier, $component, $ajax = false) { +function get_formatted_help_string($identifier, $component, $ajax = false, $a = null) { global $CFG, $OUTPUT; $sm = get_string_manager(); @@ -3521,7 +3523,7 @@ function get_formatted_help_string($identifier, $component, $ajax = false) { $options->overflowdiv = !$ajax; // Should be simple wiki only MDL-21695. - $data->text = format_text(get_string($identifier.'_help', $component), FORMAT_MARKDOWN, $options); + $data->text = format_text(get_string($identifier.'_help', $component, $a), FORMAT_MARKDOWN, $options); $helplink = $identifier . '_link'; if ($sm->string_exists($helplink, $component)) { // Link to further info in Moodle docs.