2016-09-06 20:28:41 +08:00
|
|
|
{{!
|
|
|
|
This file is part of Moodle - http://moodle.org/
|
|
|
|
|
|
|
|
Moodle is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Moodle is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
}}
|
|
|
|
{{!
|
2016-12-09 12:17:39 +00:00
|
|
|
@template core/action_menu_trigger
|
|
|
|
|
2016-09-06 20:28:41 +08:00
|
|
|
Action menu trigger.
|
2016-12-09 12:17:39 +00:00
|
|
|
|
|
|
|
Example context (json):
|
|
|
|
{
|
2023-05-26 03:50:13 +10:00
|
|
|
"actiontext": "Example link text",
|
2019-02-22 15:25:04 +08:00
|
|
|
"title": "Example link title",
|
2023-05-26 03:50:13 +10:00
|
|
|
"triggerrole": "button",
|
|
|
|
"triggerattributes": [
|
|
|
|
{"name": "data-boundary", "value": "window" }
|
|
|
|
],
|
2019-02-22 15:25:04 +08:00
|
|
|
"url": "http://example.com/link",
|
|
|
|
"classes": "icon menu-action",
|
2016-12-09 12:17:39 +00:00
|
|
|
"instance": "1",
|
2019-02-22 15:25:04 +08:00
|
|
|
"triggerextraclasses": "",
|
|
|
|
"attributes": [
|
|
|
|
{"name": "role", "value": "menuitem" },
|
|
|
|
{"name": "data-title", "value": "mymoodle,admin" }
|
|
|
|
],
|
|
|
|
"secondary": {
|
|
|
|
"classes": "menu align-tr-br",
|
2022-01-26 15:09:54 +01:00
|
|
|
"dropdownalignment": "dropdown-menu-right",
|
2019-02-22 15:25:04 +08:00
|
|
|
"attributes": [
|
|
|
|
{"name": "id", "value": "action-menu-0-menu"},
|
|
|
|
{"name": "data-rel", "value": "menu-content"},
|
|
|
|
{"name": "role", "value": "menu"},
|
|
|
|
{"name": "data-align", "value": "tr-br"}
|
|
|
|
],
|
|
|
|
"items": [
|
|
|
|
{"actionmenulink":
|
|
|
|
{
|
|
|
|
"id": "action_link59ecf8394a68078",
|
|
|
|
"disabled": false,
|
|
|
|
"text": "Dashboard",
|
|
|
|
"url": "http://example.com/link",
|
|
|
|
"icon": {
|
|
|
|
"key": "i/dashboard",
|
|
|
|
"component": null,
|
|
|
|
"title": "Dashboard"
|
|
|
|
},
|
2023-05-26 03:50:13 +10:00
|
|
|
"classes": "menu-action",
|
2019-02-22 15:25:04 +08:00
|
|
|
"attributes": [
|
|
|
|
{"name": "role", "value": "menuitem"},
|
|
|
|
{"name": "data-title", "value": "mymoodle,admin"}
|
|
|
|
],
|
|
|
|
"instance": 1,
|
|
|
|
"showtext": true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{"actionmenufiller":
|
|
|
|
{
|
|
|
|
"id": "action_link59ecf8394a68079",
|
|
|
|
"disabled": false,
|
|
|
|
"text": "",
|
|
|
|
"url": "",
|
|
|
|
"icon": null,
|
|
|
|
"classes": "",
|
|
|
|
"attributes": [
|
|
|
|
{"name": "role", "value": "menuitem"}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
2016-12-09 12:17:39 +00:00
|
|
|
}
|
2016-09-06 20:28:41 +08:00
|
|
|
}}
|
2019-09-04 08:35:11 +08:00
|
|
|
<div class="dropdown{{^secondary.items}} hidden{{/secondary.items}}">
|
2023-05-26 03:50:13 +10:00
|
|
|
<a
|
|
|
|
href="#"
|
|
|
|
tabindex="0"
|
|
|
|
class="{{triggerextraclasses}} dropdown-toggle icon-no-margin"
|
|
|
|
id="action-menu-toggle-{{instance}}"
|
|
|
|
aria-label="{{title}}"
|
|
|
|
data-toggle="dropdown"
|
|
|
|
role="{{triggerrole}}"
|
|
|
|
aria-haspopup="true"
|
|
|
|
aria-expanded="false"
|
|
|
|
aria-controls="action-menu-{{instance}}-menu"
|
|
|
|
{{#triggerattributes}}
|
|
|
|
{{name}}="{{value}}"
|
|
|
|
{{/triggerattributes}}
|
|
|
|
>
|
2019-02-22 15:25:04 +08:00
|
|
|
{{{actiontext}}}
|
|
|
|
{{{menutrigger}}}
|
|
|
|
{{#icon}}
|
|
|
|
{{#pix}}
|
|
|
|
{{key}},{{component}},{{title}}
|
|
|
|
{{/pix}}
|
|
|
|
{{/icon}}
|
|
|
|
{{#rawicon}}{{{.}}}{{/rawicon}}
|
|
|
|
{{#menutrigger}}
|
|
|
|
<b class="caret"></b>
|
|
|
|
{{/menutrigger}}
|
|
|
|
</a>
|
|
|
|
{{#secondary}}
|
2022-01-26 15:09:54 +01:00
|
|
|
<div class="dropdown-menu {{classes}} {{dropdownalignment}}"{{#attributes}} {{name}}="{{value}}"{{/attributes}}>
|
2019-02-22 15:25:04 +08:00
|
|
|
{{#items}}
|
|
|
|
{{#actionmenulink}}
|
2020-08-27 13:23:24 +08:00
|
|
|
{{< core/action_menu_link}}
|
|
|
|
{{$actionmenulinkclasses}}dropdown-item {{classes}}{{/actionmenulinkclasses}}
|
|
|
|
{{/ core/action_menu_link}}
|
2019-02-22 15:25:04 +08:00
|
|
|
{{/actionmenulink}}
|
|
|
|
{{#actionmenufiller}}
|
|
|
|
<div class="dropdown-divider" role="presentation"><span class="filler"> </span></div>
|
|
|
|
{{/actionmenufiller}}
|
2023-07-18 18:04:00 +02:00
|
|
|
{{#subpanel}}
|
|
|
|
{{> core/local/action_menu/subpanel}}
|
|
|
|
{{/subpanel}}
|
|
|
|
{{#simpleitem}}
|
|
|
|
<div class="dropdown-item">{{> core/action_menu_item }}</div>
|
|
|
|
{{/simpleitem}}
|
2019-02-22 15:25:04 +08:00
|
|
|
{{/items}}
|
|
|
|
</div>
|
|
|
|
{{/secondary}}
|
|
|
|
</div>
|