wwwroot.'/file.php'; parent::__construct($browser, $context, $storedfile, $urlbase, 'Course files', false, true, true); // TODO: localise } public function get_url($forcedownload=false, $https=false) { global $CFG; if (!$this->is_readable()) { return null; } if ($this->lf->is_directory()) { return null; } $filepath = $this->lf->get_filepath(); $filename = $this->lf->get_filename(); $courseid = $this->context->instanceid; $path = '/'.$courseid.$filepath.$filename; return $this->browser->encodepath($this->urlbase, $path, $forcedownload, $https); } public function get_children() { if (!$this->lf->is_directory()) { return array(); } return $this->browser->build_coursefile_children($this->context, $this->lf->get_filepath()); } }