$xmlrpcclient = new webservice_xmlrpc_client($serverurl, $registeredhub->token); $result = $xmlrpcclient->call($function, $params); //delete the publication from the database $publicationmanager->delete_publication($publicationid); //display confirmation message $confirmmessage = $OUTPUT->notification(get_string('courseunpublished', 'hub', $publication), 'notifysuccess'); } else { //display confirmation page for unpublishing echo $OUTPUT->header(); echo $OUTPUT->heading(get_string('unpublishcourse', 'hub', $course->shortname), 3, 'main'); echo $renderer->confirmunpublishing($publication); echo $OUTPUT->footer(); die; } } //check if a course was published if (optional_param('published', 0, PARAM_TEXT)) { $confirmmessage = $OUTPUT->notification(get_string('coursepublished', 'hub', empty($hubname) ? $huburl : $hubname), 'notifysuccess'); } /// OUTPUT echo $OUTPUT->header(); echo $confirmmessage; echo $OUTPUT->heading(get_string('publishcourse', 'hub', $course->shortname), 3, 'main'); echo $renderer->publicationselector($course->id); $publications = $publicationmanager->get_course_publications($course->id); if (!empty($publications)) { echo $OUTPUT->heading(get_string('publishedon', 'hub'), 3, 'main'); echo $renderer->registeredonhublisting($course->id, $publications); } echo $OUTPUT->footer(); }