25 include_once(
"Services/Notes/classes/class.ilNote.php");
72 $ilUser->writePref(
"pd_notes_mode", $mode);
73 $ilUser->writePref(
"pd_notes_rel_obj".$mode,
$_GET[
"rel_obj"]);
79 $mode = ($note->getType() ==
IL_NOTE_PRIVATE) ? self::PRIVATE_NOTES : self::PUBLIC_COMMENTS;
80 $obj = $note->getObject();
81 $ilUser->writePref(
"pd_notes_mode", $mode);
82 $ilUser->writePref(
"pd_notes_rel_obj".$mode, $obj[
"rep_obj_id"]);
91 $next_class = $this->ctrl->getNextClass();
107 $cmd = $this->ctrl->getCmd(
"view");
112 $this->tpl->show(
true);
125 $this->tpl->setTitle($this->lng->txt(
"notes"));
138 global $ilUser,
$lng;
141 include_once(
"Services/Notes/classes/class.ilNoteGUI.php");
144 include_once(
"Services/Notes/classes/class.ilNote.php");
150 $rel_objs = array_merge(array(0), $rel_objs);
156 $lng->loadLanguageModule(
"notes");
162 foreach ($rel_objs as $r)
166 $this->current_rel_obj = $r[
"rep_obj_id"];
168 if ($r[
"rep_obj_id"] == $ilUser->getPref(
"pd_notes_rel_obj".$this->getMode()))
170 $this->current_rel_obj = $r[
"rep_obj_id"];
174 if ($this->current_rel_obj > 0)
176 $notes_gui =
new ilNoteGUI($this->current_rel_obj, 0,
181 $notes_gui =
new ilNoteGUI(0, $ilUser->getId(),
"pd");
187 $notes_gui->enablePublicNotes(
false);
191 $notes_gui->enablePrivateNotes(
false);
192 $notes_gui->enablePublicNotes(
true);
194 $notes_gui->enableHiding(
false);
195 $notes_gui->enableTargets(
true);
196 $notes_gui->enableMultiSelection(
true);
197 $notes_gui->enableAnchorJump(
false);
199 $next_class = $this->ctrl->getNextClass($this);
201 if ($next_class ==
"ilnotegui")
203 $html = $this->ctrl->forwardCommand($notes_gui);
207 $html = $notes_gui->getNotesHTML();
210 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.pd_notes.html",
"Services/Notes");
212 if (count($rel_objs) > 1 ||
213 ($rel_objs[0][
"rep_obj_id"] > 0))
215 foreach($rel_objs as $obj)
217 $this->tpl->setCurrentBlock(
"related_option");
218 $this->tpl->setVariable(
"VAL_RELATED",
221 if ($obj[
"rep_obj_id"] > 0)
224 $type_str = (in_array($type, array(
"lm",
"htlm",
"sahs",
"dbk")))
225 ? $lng->txt(
"learning_resource")
226 : $lng->txt(
"obj_".$type);
227 $this->tpl->setVariable(
"TXT_RELATED", $type_str.
": ".
232 $this->tpl->setVariable(
"TXT_RELATED",
233 $lng->txt(
"personal_desktop"));
235 if ($obj[
"rep_obj_id"] == $this->current_rel_obj)
237 $this->tpl->setVariable(
"SEL",
'selected="selected"');
239 $this->tpl->parseCurrentBlock();
242 $this->tpl->setCurrentBlock(
"related_selection");
243 $this->tpl->setVariable(
"TXT_CHANGE", $lng->txt(
"change"));
244 $this->tpl->setVariable(
"TXT_RELATED_TO", $lng->txt(
"related_to"));
245 $this->tpl->setVariable(
"TXT_FILTER", $lng->txt(
"filter"));
246 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
247 $this->tpl->parseCurrentBlock();
250 $this->tpl->setCurrentBlock(
"adm_content");
252 $this->tpl->setVariable(
"NOTES", $html);
253 $this->tpl->parseCurrentBlock();
264 $ilUser->writePref(
"pd_notes_rel_obj".$this->
getMode(),
$_POST[
"rel_obj"]);
265 $this->ctrl->redirect($this);
276 $ilTabs->addTarget(
"private_notes",
277 $ilCtrl->getLinkTarget($this,
"showPrivateNotes"),
"",
"",
"",
279 if(!$ilSetting->get(
"disable_comments"))
281 $ilTabs->addTarget(
"notes_public_comments",
282 $ilCtrl->getLinkTarget($this,
"showPublicComments"),
"",
"",
"",
295 $ilCtrl->redirect($this,
"");
305 if($ilSetting->get(
"disable_comments"))
307 $ilCtrl->redirect($this,
"showPrivateNotes");
311 $ilCtrl->redirect($this,
"");
322 !$ilSetting->get(
"disable_comments"))