mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-59388 core_calendar: convert manage subscription button
This commit is contained in:
parent
bd33760372
commit
1a1e8ab029
@ -90,14 +90,13 @@ class footer_options_exporter extends exporter {
|
||||
/**
|
||||
* Get manage subscription button.
|
||||
*
|
||||
* @param renderer_base $output
|
||||
* @return string The manage subscription button html.
|
||||
*/
|
||||
protected function get_manage_subscriptions_button(renderer_base $output) {
|
||||
protected function get_manage_subscriptions_button() {
|
||||
if (calendar_user_can_add_event($this->calendar->course)) {
|
||||
$managesubscriptionurl = new moodle_url('/calendar/managesubscriptions.php',
|
||||
['course' => $this->calendar->course->id]);
|
||||
return $output->single_button($managesubscriptionurl->out(false),
|
||||
return new \single_button($managesubscriptionurl,
|
||||
get_string('managesubscriptions', 'calendar'));
|
||||
}
|
||||
}
|
||||
@ -115,8 +114,9 @@ class footer_options_exporter extends exporter {
|
||||
|
||||
if (!empty($CFG->enablecalendarexport)) {
|
||||
$exportbutton = $this->get_export_calendar_button();
|
||||
$managesubscriptionbutton = $this->get_manage_subscriptions_button();
|
||||
$values->exportcalendarbutton = $exportbutton->export_for_template($output);
|
||||
$values->managesubscriptionbutton = $this->get_manage_subscriptions_button($output);
|
||||
$values->managesubscriptionbutton = $managesubscriptionbutton->export_for_template($output);
|
||||
$values->icalurl = $this->get_ical_url()->out(false);
|
||||
}
|
||||
|
||||
|
@ -30,6 +30,8 @@
|
||||
{{#exportcalendarbutton}}
|
||||
{{> core/single_button }}
|
||||
{{/exportcalendarbutton}}
|
||||
{{{managesubscriptionbutton}}}
|
||||
{{#managesubscriptionbutton}}
|
||||
{{> core/single_button }}
|
||||
{{/managesubscriptionbutton}}
|
||||
<a href="{{icalurl}}" title="{{#str}} quickdownloadcalendar, calendar {{/str}}" class="ical-link m-l-1">iCal</a>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user