Skip to content

Commit

Permalink
Merge branch 'MDL-80676-main' of https://github.com/junpataleta/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
HuongNV13 committed Jan 25, 2024
2 parents 59cac76 + beadadd commit 854ba5d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/outputcomponents.php
Expand Up @@ -4957,6 +4957,8 @@ class action_menu_link extends action_link implements renderable {

/**
* The number of instances of this action menu link (and its subclasses).
*
* @deprecated since Moodle 4.4.
* @var int
*/
protected static $instance = 1;
Expand Down Expand Up @@ -4985,7 +4987,6 @@ public function __construct(moodle_url $url, ?pix_icon $icon, $text, $primary =
*/
public function export_for_template(renderer_base $output) {
$data = parent::export_for_template($output);
$data->instance = self::$instance++;

// Ignore what the parent did with the attributes, except for ID and class.
$data->attributes = [];
Expand Down
4 changes: 2 additions & 2 deletions lib/templates/action_menu_link.mustache
Expand Up @@ -27,12 +27,12 @@
}
}}
{{^disabled}}
<a href="{{url}}" class="{{$actionmenulinkclasses}}aabtn {{classes}}{{/actionmenulinkclasses}}" {{#attributes}}{{name}}="{{value}}" {{/attributes}}{{#showtext}}aria-labelledby="actionmenuaction-{{instance}}"{{/showtext}}>
<a href="{{url}}" class="{{$actionmenulinkclasses}}aabtn {{classes}}{{/actionmenulinkclasses}}" {{#attributes}}{{name}}="{{value}}" {{/attributes}}>
{{#icon}}
{{#pix}}{{key}}, {{component}}, {{title}}{{/pix}}
{{/icon}}
{{#showtext}}
<span class="menu-action-text" id="actionmenuaction-{{instance}}">{{{text}}}</span>
<span class="menu-action-text">{{{text}}}</span>
{{/showtext}}
</a>
{{/disabled}}
Expand Down
1 change: 1 addition & 0 deletions lib/upgrade.txt
Expand Up @@ -38,6 +38,7 @@ information provided here is intended especially for developers.
- `\core\deprecation::emit_deprecation_if_present([self::class, 'some_method']);`
* Added missing deprecation for PARAM_CLEANFILE which was deprecated in Moodle 2.0.
* Login can now utilise new param 'loginredirect' to indicate when to use value set for $CFG->alternateloginurl.
* \action_menu_link::$instance has been deprecated as it is no longer used.

=== 4.3 ===

Expand Down

0 comments on commit 854ba5d

Please sign in to comment.