mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 20:42:22 +02:00
MDL-75571 calendar: Activity icon
* Use Activity get_icon_url helper method to fetch icon.
This commit is contained in:
parent
40a89d8a9a
commit
3d05ebca36
@ -61,11 +61,13 @@ class event_icon_exporter extends exporter {
|
||||
$iscourseevent = ($course && !empty($courseid) && $courseid != SITEID && empty($groupid));
|
||||
$isgroupevent = ($group && !empty($groupid));
|
||||
$isuserevent = ($user && !empty($userid));
|
||||
$iconurl = '';
|
||||
|
||||
if ($isactivityevent) {
|
||||
$key = 'monologo';
|
||||
$component = $coursemodule->get('modname');
|
||||
|
||||
$iconurl = get_fast_modinfo($courseid)->get_cm($coursemodule->get('id'))->get_icon_url()->out(false);
|
||||
if (get_string_manager()->string_exists($event->get_type(), $component)) {
|
||||
$alttext = get_string($event->get_type(), $component);
|
||||
} else {
|
||||
@ -118,6 +120,7 @@ class event_icon_exporter extends exporter {
|
||||
$data->key = $key;
|
||||
$data->component = $component;
|
||||
$data->alttext = $alttext;
|
||||
$data->iconurl = $iconurl;
|
||||
|
||||
parent::__construct($data, $related);
|
||||
}
|
||||
@ -132,6 +135,7 @@ class event_icon_exporter extends exporter {
|
||||
'key' => ['type' => PARAM_TEXT],
|
||||
'component' => ['type' => PARAM_TEXT],
|
||||
'alttext' => ['type' => PARAM_TEXT],
|
||||
'iconurl' => ['type' => PARAM_TEXT],
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,8 @@
|
||||
"icon": {
|
||||
"key": "i/courseevent",
|
||||
"component": "core",
|
||||
"alttext": "Some course event"
|
||||
"alttext": "Some course event",
|
||||
"iconurl": "#"
|
||||
},
|
||||
"editurl": "#",
|
||||
"url": "#"
|
||||
|
@ -45,7 +45,14 @@
|
||||
}} data-region="event-item"{{!
|
||||
}}>
|
||||
<div class="activityiconcontainer small {{{purpose}}} courseicon mr-3">
|
||||
{{#icon}}{{#pix}} {{key}}, {{component}}, {{alttext}} {{/pix}}{{/icon}}
|
||||
{{#icon}}
|
||||
{{#iconurl}}
|
||||
<img alt="{{alttext}}" title="{{alttext}}" src="{{{ iconurl }}}" class="icon ">
|
||||
{{/iconurl}}
|
||||
{{^iconurl}}
|
||||
{{#pix}} {{key}}, {{component}}, {{alttext}} {{/pix}}
|
||||
{{/iconurl}}
|
||||
{{/icon}}
|
||||
</div>
|
||||
<div class="overflow-auto">
|
||||
<h6 class="d-flex mb-1">
|
||||
|
Loading…
x
Reference in New Issue
Block a user