/** * show notes section */ function showNotesSection() { global $ilAccess, $ilSetting; $next_class = $this->ctrl->getNextClass($this); include_once "Services/Notes/classes/class.ilNoteGUI.php"; $notes_gui = new ilNoteGUI($this->gui_object->object->getId(), 0, $this->gui_object->object->getType()); // global switch if ($ilSetting->get("disable_comments")) { $notes_gui->enablePublicNotes(false); } else { $ref_id = $this->gui_object->object->getRefId(); $has_write = $ilAccess->checkAccess("write", "", $ref_id); if ($has_write && $ilSetting->get("comments_del_tutor", 1)) { $notes_gui->enablePublicNotesDeletion(true); } /* should probably be discussed further for now this will only work properly with comments settings (see ilNoteGUI constructor) */ if ($has_write || $ilAccess->checkAccess("edit_permissions", "", $ref_id)) { $notes_gui->enableCommentsSettings(); } } /* moved to action menu $notes_gui->enablePrivateNotes(); */ if ($next_class == "ilnotegui") { $html = $this->ctrl->forwardCommand($notes_gui); } else { $html = $notes_gui->getNotesHTML(); } return $html; }
function executeCommand() { global $ilCtrl; // check access for object if ($this->node_id && !$this->access_handler->checkAccess("visible", "", $this->node_id) && !$this->access_handler->checkAccess("read", "", $this->node_id)) { exit; } $next_class = $ilCtrl->getNextClass($this); $cmd = $ilCtrl->getCmd(); $ilCtrl->saveParameter($this, "cadh"); switch ($next_class) { case "ilnotegui": $obj_type = $this->obj_type; if ($this->sub_type) { $obj_type = $this->sub_type; } include_once "Services/Notes/classes/class.ilNoteGUI.php"; $note_gui = new ilNoteGUI($this->obj_id, $this->sub_id, $obj_type); $note_gui->enablePrivateNotes(true); // comments cannot be turned off globally if ($this->enable_comments_settings) { // should only be shown if active or permission to toggle if ($this->access_handler->checkAccess("write", "", $this->node_id) || $this->access_handler->checkAccess("edit_permissions", "", $this->node_id)) { $note_gui->enableCommentsSettings(); } } else { if ($this->sub_id) { $note_gui->enablePublicNotes(true); } } $ilCtrl->forwardCommand($note_gui); break; case "iltagginggui": include_once "Services/Tagging/classes/class.ilTaggingGUI.php"; $tags_gui = new ilTaggingGUI($this->node_id); $tags_gui->setObject($this->obj_id, $this->obj_type); $ilCtrl->forwardCommand($tags_gui); break; case "ilobjectactivationgui": $ilCtrl->setParameter($this, "parent_id", (int) $_REQUEST['parent_id']); include_once 'Services/Object/classes/class.ilObjectActivationGUI.php'; $act_gui = new ilObjectActivationGUI((int) $_REQUEST['parent_id'], $this->node_id); $ilCtrl->forwardCommand($act_gui); break; case "ilratinggui": include_once "./Services/Rating/classes/class.ilRatingGUI.php"; $rating_gui = new ilRatingGUI(); $rating_gui->setObject($this->obj_id, $this->obj_type, $this->sub_id, $this->sub_type); $ilCtrl->forwardCommand($rating_gui); if ($this->rating_callback) { // as rating in categories is form-based we need to redirect // somewhere after saving $ilCtrl->redirect($this->rating_callback[0], $this->rating_callback[1]); } break; default: break; } exit; }