bos =& $Dippler->backoffice; if ($id) { $this->id = $id; } } public function add() { return $this->bos->addFacilitator($this->dataXML()); } public function remove() { return $this->bos->removeFacilitator($this->idXML()); } public function load($loader = false) { if (!$loader) $loader = $this->bos->loadFacilitator($this->idXML()); if ($loader) { $this->type = 'facilitator'; $this->id = $loader->id[0][0]; $this->course = $loader->course[0][0]; $this->email = $loader->email[0][0]; $this->firstname = $loader->firstname[0][0]; $this->lastname = $loader->lastname[0][0]; $this->status = $loader->status[0][0]; $this->user_id = $loader->{'user_id'}[0][0]; } } public function getURL() { return $this->getProfileURL(); } // TODO This is probably not needed public function getPortfolioURL() { return WWW_ROOT."course/participants/{$this->course}/portfolio/{$this->id}"; } public function getProfileURL() { return WWW_ROOT."profile/view/{$this->user_id}"; } public function getType() { return $this->type; } public function canEdit() { if (is_admin()) { return 1; } return 0; } public function getCourse() { return $this->course; } public function getEmail() { return $this->email; } public function getFirstname() { return $this->firstname; } public function getLastname() { return $this->lastname; } public function getFullname() { return $this->firstname." ".$this->lastname; } public function getStatus() { return $this->status; } public function isEnrolled() { if ($this->getStatus() > 0) { return true; } return false; } function idXML() { $data = ""; $data .= ""; $data .= "{$this->id}"; $data .= ""; return $data; } function dataXML() { $data = ""; $data .= ""; $data .= "".$this->id.""; $data .= "".$this->course.""; $data .= "email."]]>"; $data .= "{$this->user_id}"; //$data .= "firstname."]]>"; //$data .= "lastname."]]>"; $data .= "".$this->status.""; $data .= ""; return $data; } } ?>