6 include_once(
"Services/Notes/classes/class.ilNote.php");
41 $ilHelp->setScreenIdComponent(
"note");
53 $ilUser->writePref(
"pd_notes_mode", $mode);
54 $ilUser->writePref(
"pd_notes_rel_obj".$mode,
$_GET[
"rel_obj"]);
60 $mode = ($note->getType() ==
IL_NOTE_PRIVATE) ? self::PRIVATE_NOTES : self::PUBLIC_COMMENTS;
61 $obj = $note->getObject();
62 $ilUser->writePref(
"pd_notes_mode", $mode);
63 $ilUser->writePref(
"pd_notes_rel_obj".$mode, $obj[
"rep_obj_id"]);
72 $next_class = $this->ctrl->getNextClass();
88 $cmd = $this->ctrl->getCmd(
"view");
93 $this->tpl->show(
true);
102 $this->tpl->setTitle($this->lng->txt(
"notes"));
118 include_once(
"Services/Notes/classes/class.ilNoteGUI.php");
121 include_once(
"Services/Notes/classes/class.ilNote.php");
129 $rel_objs = array_merge(array(0), $rel_objs);
135 $lng->loadLanguageModule(
"notes");
141 foreach ($rel_objs as $r)
145 $this->current_rel_obj = $r[
"rep_obj_id"];
146 $current_ref_ids = $r[
"ref_ids"];
148 if ($r[
"rep_obj_id"] == $ilUser->getPref(
"pd_notes_rel_obj".$this->getMode()))
150 $this->current_rel_obj = $r[
"rep_obj_id"];
151 $current_ref_ids = $r[
"ref_ids"];
155 if ($this->current_rel_obj > 0)
157 $notes_gui =
new ilNoteGUI($this->current_rel_obj, 0,
162 $notes_gui =
new ilNoteGUI(0, $ilUser->getId(),
"pd");
168 $notes_gui->enablePublicNotes(
false);
172 $notes_gui->enablePrivateNotes(
false);
173 $notes_gui->enablePublicNotes(
true);
176 if ($this->current_rel_obj > 0 &&
177 sizeof($current_ref_ids) &&
178 $ilSetting->get(
"comments_del_tutor", 1))
180 foreach($current_ref_ids as
$ref_id)
182 if($ilAccess->checkAccess(
"write",
"", $ref_id))
184 $notes_gui->enablePublicNotesDeletion(
true);
190 $notes_gui->enableHiding(
false);
191 $notes_gui->enableTargets(
true);
192 $notes_gui->enableMultiSelection(
true);
193 $notes_gui->enableAnchorJump(
false);
195 $next_class = $this->ctrl->getNextClass($this);
197 if ($next_class ==
"ilnotegui")
199 $html = $this->ctrl->forwardCommand($notes_gui);
205 $html = $notes_gui->getOnlyNotesHTML();
209 $html = $notes_gui->getOnlyCommentsHTML();
213 if (count($rel_objs) > 1 ||
214 ($rel_objs[0][
"rep_obj_id"] > 0))
216 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
218 foreach($rel_objs as $obj)
220 if ($obj[
"rep_obj_id"] > 0)
223 $type_str = (in_array($type, array(
"lm",
"htlm",
"sahs",
"dbk")))
224 ? $lng->txt(
"learning_resource")
225 : $lng->txt(
"obj_".$type);
230 $caption = $lng->txt(
"personal_desktop");
233 $options[$obj[
"rep_obj_id"]] = $caption;
236 include_once
"Services/Form/classes/class.ilSelectInputGUI.php";
239 $rel->setValue($this->current_rel_obj);
240 $ilToolbar->addInputItem($rel);
242 $ilToolbar->addFormButton($lng->txt(
"change"),
"changeRelatedObject");
245 $this->tpl->setContent($html);
255 $ilUser->writePref(
"pd_notes_rel_obj".$this->
getMode(),
$_POST[
"rel_obj"]);
256 $this->ctrl->redirect($this);
267 $ilTabs->addTarget(
"private_notes",
268 $ilCtrl->getLinkTarget($this,
"showPrivateNotes"),
"",
"",
"",
270 if(!$ilSetting->get(
"disable_comments"))
272 $ilTabs->addTarget(
"notes_public_comments",
273 $ilCtrl->getLinkTarget($this,
"showPublicComments"),
"",
"",
"",
286 $ilCtrl->redirect($this,
"");
296 if($ilSetting->get(
"disable_comments"))
298 $ilCtrl->redirect($this,
"showPrivateNotes");
302 $ilCtrl->redirect($this,
"");
313 !$ilSetting->get(
"disable_comments"))