public function init() { global $PAGE; parent::init(); // Set up the page header. $PAGE->set_context(\CONTEXT_SYSTEM::instance()); $PAGE->set_title(get_string('apidiagnostics', 'mod_collaborate')); $PAGE->set_heading(get_string('apidiagnostics', 'mod_collaborate')); $PAGE->set_url('/mod/collaborate/testapi.php'); $renderer = $PAGE->get_renderer('mod_collaborate'); $this->testapiservice = new testapi_service($renderer); }
public function init() { global $PAGE, $USER; $this->set_properties(); $PAGE->set_url(new \moodle_url('/mod/collaborate/view.php', ['id' => $this->cm->id, 'action' => $this->action])); parent::init(); require_once __DIR__ . '/../../lib.php'; // Note, we pass the page object course module and context instead of using $this->cm // as the intialise function populates the PAGE object. $renderer = $PAGE->get_renderer('mod_collaborate'); $this->viewservice = new view_service($this->collaborate, $PAGE->cm, $PAGE->context, $renderer); $this->forwardservice = new forward_service($this->collaborate, $PAGE->cm, $PAGE->context, $USER); }