Merge branch 'MDL-82488-403' of https://github.com/paulholden/moodle into MOODLE_403_STABLE
This commit is contained in:
@@ -255,11 +255,15 @@ abstract class field_controller {
|
||||
/**
|
||||
* Returns the field name formatted according to configuration context.
|
||||
*
|
||||
* @param bool $escape
|
||||
* @return string
|
||||
*/
|
||||
public function get_formatted_name() : string {
|
||||
public function get_formatted_name(bool $escape = true): string {
|
||||
$context = $this->get_handler()->get_configuration_context();
|
||||
return format_string($this->get('name'), true, ['context' => $context]);
|
||||
return format_string($this->get('name'), true, [
|
||||
'context' => $context,
|
||||
'escape' => $escape,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
This files describes API changes in /customfield/*,
|
||||
Information provided here is intended especially for developers.
|
||||
|
||||
=== 4.4.6 ===
|
||||
=== 4.3.8 ===
|
||||
* The field controller `get_formatted_name()` method now accepts an optional `$escape` parameter to define whether to
|
||||
escape the returned name
|
||||
|
||||
=== 4.3.6 ===
|
||||
* The customfield_select field controller `get_options` method now returns each option pre-formatted
|
||||
|
||||
=== 4.3 ===
|
||||
|
||||
@@ -172,7 +172,7 @@ class custom_fields {
|
||||
|
||||
$columns[] = (new column(
|
||||
'customfield_' . $field->get('shortname'),
|
||||
new lang_string('customfieldcolumn', 'core_reportbuilder', $field->get_formatted_name()),
|
||||
new lang_string('customfieldcolumn', 'core_reportbuilder', $field->get_formatted_name(false)),
|
||||
$this->entityname
|
||||
))
|
||||
->add_joins($this->get_joins())
|
||||
@@ -261,7 +261,7 @@ class custom_fields {
|
||||
$filter = (new filter(
|
||||
$typeclass,
|
||||
'customfield_' . $field->get('shortname'),
|
||||
new lang_string('customfieldcolumn', 'core_reportbuilder', $field->get_formatted_name()),
|
||||
new lang_string('customfieldcolumn', 'core_reportbuilder', $field->get_formatted_name(false)),
|
||||
$this->entityname,
|
||||
$datafieldsql
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user