diff --git a/lib/outputcomponents.php b/lib/outputcomponents.php index 08e691c6530..bc1f002af48 100644 --- a/lib/outputcomponents.php +++ b/lib/outputcomponents.php @@ -4679,6 +4679,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. * @@ -4702,10 +4708,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 = []; diff --git a/lib/templates/action_menu_link.mustache b/lib/templates/action_menu_link.mustache index 0e9f42af6cd..67affd7429f 100644 --- a/lib/templates/action_menu_link.mustache +++ b/lib/templates/action_menu_link.mustache @@ -27,7 +27,14 @@ } }} {{^disabled}} - {{#icon}}{{#pix}}{{key}}, {{component}}, {{title}}{{/pix}}{{/icon}}{{#showtext}}{{{text}}}{{/showtext}} + + {{#icon}} + {{#pix}}{{key}}, {{component}}, {{title}}{{/pix}} + {{/icon}} + {{#showtext}} + {{{text}}} + {{/showtext}} + {{/disabled}} {{#disabled}} {{#icon}}{{#pix}}{{key}},{{component}},{{title}}{{/pix}}{{/icon}}{{{text}}} diff --git a/lib/templates/action_menu_trigger.mustache b/lib/templates/action_menu_trigger.mustache index cf34a04a6f6..93f483fcde7 100644 --- a/lib/templates/action_menu_trigger.mustache +++ b/lib/templates/action_menu_trigger.mustache @@ -95,16 +95,9 @@