/** * Constructor * * @access public */ function ilPDNotesGUI() { global $ilias, $tpl, $lng, $ilCtrl, $ilUser, $ilTabs, $ilHelp; $ilHelp->setScreenIdComponent("note"); // initiate variables $this->ilias =& $ilias; $this->tpl =& $tpl; $this->lng =& $lng; $this->ctrl =& $ilCtrl; // link from ilPDNotesBlockGUI if ($_GET["rel_obj"]) { $mode = $_GET["note_type"] == IL_NOTE_PRIVATE ? self::PRIVATE_NOTES : self::PUBLIC_COMMENTS; $ilUser->writePref("pd_notes_mode", $mode); $ilUser->writePref("pd_notes_rel_obj" . $mode, $_GET["rel_obj"]); } else { if ($_REQUEST["note_id"]) { $note = new ilNote($_REQUEST["note_id"]); $mode = $note->getType() == IL_NOTE_PRIVATE ? self::PRIVATE_NOTES : self::PUBLIC_COMMENTS; $obj = $note->getObject(); $ilUser->writePref("pd_notes_mode", $mode); $ilUser->writePref("pd_notes_rel_obj" . $mode, $obj["rep_obj_id"]); } } }
/** * Notify observers on update/create * * @param string $a_action * @param ilNote $a_note */ protected function notifyObserver($a_action, $a_note) { if (sizeof($this->observer)) { foreach ($this->observer as $item) { $param = $a_note->getObject(); $param["action"] = $a_action; $param["note_id"] = $a_note->getId(); call_user_func_array($item, $param); } } }