Merge branch 'MDL-69262-master-2' of git://github.com/junpataleta/moodle into master

This commit is contained in:
Eloy Lafuente (stronk7) 2020-09-07 23:42:45 +02:00
commit afb05bf276
3 changed files with 18 additions and 14 deletions

View File

@ -4682,6 +4682,12 @@ class action_menu_link extends action_link implements renderable {
*/
public $actionmenu = null;
/**
* The number of instances of this action menu link (and its subclasses).
* @var int
*/
protected static $instance = 1;
/**
* Constructs the object.
*
@ -4705,10 +4711,8 @@ class action_menu_link extends action_link implements renderable {
* @return stdClass
*/
public function export_for_template(renderer_base $output) {
static $instance = 1;
$data = parent::export_for_template($output);
$data->instance = $instance++;
$data->instance = self::$instance++;
// Ignore what the parent did with the attributes, except for ID and class.
$data->attributes = [];

View File

@ -27,7 +27,14 @@
}
}}
{{^disabled}}
<a href="{{url}}" class="aabtn {{classes}}" {{#attributes}}{{name}}={{#quote}}{{value}}{{/quote}} {{/attributes}}{{#showtext}}aria-labelledby="actionmenuaction-{{instance}}"{{/showtext}}>{{#icon}}{{#pix}}{{key}}, {{component}}, {{title}}{{/pix}}{{/icon}}{{#showtext}}<span class="menu-action-text" id="actionmenuaction-{{instance}}">{{{text}}}</span>{{/showtext}}</a>
<a href="{{url}}" class="{{$actionmenulinkclasses}}aabtn {{classes}}{{/actionmenulinkclasses}}" {{#attributes}}{{name}}={{#quote}}{{value}}{{/quote}} {{/attributes}}{{#showtext}}aria-labelledby="actionmenuaction-{{instance}}"{{/showtext}}>
{{#icon}}
{{#pix}}{{key}}, {{component}}, {{title}}{{/pix}}
{{/icon}}
{{#showtext}}
<span class="menu-action-text" id="actionmenuaction-{{instance}}">{{{text}}}</span>
{{/showtext}}
</a>
{{/disabled}}
{{#disabled}}
<span class="currentlink" role="menuitem">{{#icon}}{{#pix}}{{key}},{{component}},{{title}}{{/pix}}{{/icon}}{{{text}}}</span>

View File

@ -95,16 +95,9 @@
<div class="dropdown-menu dropdown-menu-right {{classes}}"{{#attributes}} {{name}}="{{value}}"{{/attributes}}>
{{#items}}
{{#actionmenulink}}
<a href="{{url}}" class="dropdown-item {{classes}}" {{#attributes}}{{name}}={{#quote}}{{value}}{{/quote}} {{/attributes}}{{#showtext}}aria-labelledby="actionmenuaction-{{instance}}"{{/showtext}}>
{{#icon}}
{{#pix}}{{key}},{{component}},{{title}}{{/pix}}
{{/icon}}
{{#showtext}}
<span class="menu-action-text" id="actionmenuaction-{{instance}}">
{{{text}}}
</span>
{{/showtext}}
</a>
{{< core/action_menu_link}}
{{$actionmenulinkclasses}}dropdown-item {{classes}}{{/actionmenulinkclasses}}
{{/ core/action_menu_link}}
{{/actionmenulink}}
{{#actionmenufiller}}
<div class="dropdown-divider" role="presentation"><span class="filler">&nbsp;</span></div>