$subscription = \tool_monitor\subscription_manager::get_subscription($subscriptionid); echo $OUTPUT->header(); echo $OUTPUT->confirm(get_string('subareyousure', 'tool_monitor', $subscription->get_name($coursecontext)), $confirmurl, $cancelurl); echo $OUTPUT->footer(); exit; } break; default: } } else { echo $OUTPUT->header(); } $renderer = $PAGE->get_renderer('tool_monitor', 'managesubs'); // Render the course selector. $totalrules = \tool_monitor\rule_manager::count_rules_by_courseid($courseid); $rules = new \tool_monitor\output\managesubs\rules('toolmonitorrules', $indexurl, $courseid); $usercourses = $rules->get_user_courses_select(); if (!empty($usercourses)) { echo $renderer->render($usercourses); } else { // Nothing to show at all. Show a notification. echo $OUTPUT->notification(get_string('rulenopermission', 'tool_monitor'), 'notifyproblem'); } // Render the current subscriptions list. $totalsubs = \tool_monitor\subscription_manager::count_user_subscriptions(); if (!empty($totalsubs)) { // Show the subscriptions section only if there are subscriptions. $subs = new \tool_monitor\output\managesubs\subs('toolmonitorsubs', $indexurl, $courseid); echo $OUTPUT->heading(get_string('currentsubscriptions', 'tool_monitor'), 3); echo $renderer->render($subs); }