Merge branch 'MDL-79907-main' of https://github.com/andrewgos/moodle

This commit is contained in:
Sara Arjona 2025-01-29 07:46:31 +01:00
commit e14629243e
No known key found for this signature in database
2 changed files with 22 additions and 46 deletions

View file

@ -0,0 +1,10 @@
issueNumber: MDL-79907
notes:
core_grades:
- message: >-
Final deprecation of
grade_structure::get_element_type_string(),
grade_structure::get_element_header(),
grade_structure::get_element_icon(),
grade_structure::get_activity_link()
type: removed

View file

@ -1434,69 +1434,35 @@ class grade_structure {
public $items; public $items;
/** /**
* Returns icon of element
*
* @param array &$element An array representing an element in the grade_tree
* @param bool $spacerifnone return spacer if no icon found
*
* @return string icon or spacer
* @deprecated since Moodle 4.4 - please use {@see grade_helper::get_element_icon()} * @deprecated since Moodle 4.4 - please use {@see grade_helper::get_element_icon()}
* @todo MDL-79907 This will be deleted in Moodle 4.8.
*/ */
public function get_element_icon(&$element, $spacerifnone=false) { #[\core\attribute\deprecated('grade_helper::get_element_icon', since: '4.4', mdl: 'MDL-77326', final: true)]
debugging('The function get_element_icon() is deprecated, please use grade_helper::get_element_icon() instead.', public function get_element_icon(): void {
DEBUG_DEVELOPER); \core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
return grade_helper::get_element_icon($element, $spacerifnone);
} }
/** /**
* Returns the string that describes the type of the element.
*
* @param array $element An array representing an element in the grade_tree
* @return string The string that describes the type of the grade element
* @deprecated since Moodle 4.4 - please use {@see grade_helper::get_element_type_string()} * @deprecated since Moodle 4.4 - please use {@see grade_helper::get_element_type_string()}
* @todo MDL-79907 This will be deleted in Moodle 4.8.
*/ */
public function get_element_type_string(array $element): string { #[\core\attribute\deprecated('grade_helper::get_element_type_string', since: '4.4', mdl: 'MDL-77326', final: true)]
debugging('The function get_element_type_string() is deprecated,' . public function get_element_type_string(): void {
' please use grade_helper::get_element_type_string() instead.', \core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
DEBUG_DEVELOPER);
return grade_helper::get_element_type_string($element);
} }
/** /**
* Returns name of element optionally with icon and link
*
* @param array &$element An array representing an element in the grade_tree
* @param bool $withlink Whether or not this header has a link
* @param bool $icon Whether or not to display an icon with this header
* @param bool $spacerifnone return spacer if no icon found
* @param bool $withdescription Show description if defined by this item.
* @param bool $fulltotal If the item is a category total, returns $categoryname."total"
* instead of "Category total" or "Course total"
* @param moodle_url|null $sortlink Link to sort column.
*
* @return string header
* @deprecated since Moodle 4.4 - please use {@see grade_helper::get_element_header()} * @deprecated since Moodle 4.4 - please use {@see grade_helper::get_element_header()}
* @todo MDL-79907 This will be deleted in Moodle 4.8.
*/ */
public function get_element_header(array &$element, bool $withlink = false, bool $icon = true, #[\core\attribute\deprecated('grade_helper::get_element_header', since: '4.4', mdl: 'MDL-77326', final: true)]
bool $spacerifnone = false, bool $withdescription = false, bool $fulltotal = false, public function get_element_header(): void {
?moodle_url $sortlink = null) { \core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
debugging('The function get_element_header() is deprecated, please use grade_helper::get_element_header() instead.',
DEBUG_DEVELOPER);
return grade_helper::get_element_header($element, $withlink, $icon, $spacerifnone, $withdescription,
$fulltotal, $sortlink);
} }
/** /**
* @deprecated since Moodle 4.4 - please use {@see grade_helper::get_activity_link()} * @deprecated since Moodle 4.4 - please use {@see grade_helper::get_activity_link()}
* @todo MDL-79907 This will be deleted in Moodle 4.8.
*/ */
private function get_activity_link($element) { #[\core\attribute\deprecated('grade_helper::get_activity_link', since: '4.4', mdl: 'MDL-77326', final: true)]
debugging('The function get_activity_link() is deprecated, please use grade_helper::get_activity_link() instead.', private function get_activity_link(): void {
DEBUG_DEVELOPER); \core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
return grade_helper::get_activity_link($element);
} }
/** /**