6 include_once (
"Services/Notes/classes/class.ilNote.php");
31 function ilNoteGUI($a_rep_obj_id =
"", $a_obj_id =
"", $a_obj_type =
"", $a_include_subobjects =
false)
35 $lng->loadLanguageModule(
"notes");
37 $ilCtrl->saveParameter($this,
"notes_only");
38 $this->only =
$_GET[
"notes_only"];
40 $this->rep_obj_id = $a_rep_obj_id;
41 $this->obj_id = $a_obj_id;
42 $this->obj_type = $a_obj_type;
43 $this->inc_sub = $a_include_subobjects;
46 if(!$this->obj_type && $a_rep_obj_id)
51 $this->ajax = $ilCtrl->isAsynch();
56 $this->anchor_jump =
true;
57 $this->add_note_form =
false;
58 $this->edit_note_form =
false;
59 $this->private_enabled =
false;
61 $id = $this->rep_obj_id.
"_".$this->obj_id.
"_".$this->obj_type;
65 $this->public_enabled =
true;
69 $this->public_enabled =
false;
71 $this->enable_hiding =
false;
72 $this->targets_enabled =
false;
73 $this->multi_selection =
false;
74 $this->export_html =
false;
76 $this->comments_settings =
false;
78 $this->note_img = array(
81 "alt" => $lng->txt(
"note")),
84 "alt" => $lng->txt(
"note").
", ".$lng->txt(
"important")),
87 "alt" => $lng->txt(
"note").
", ".$lng->txt(
"question")),
90 "alt" => $lng->txt(
"note").
", ".$lng->txt(
"pro")),
93 "alt" => $lng->txt(
"note").
", ".$lng->txt(
"contra"))
96 $this->comment_img = array(
99 "alt" => $lng->txt(
"notes_comment")),
102 "alt" => $lng->txt(
"notes_comment").
", ".$lng->txt(
"important")),
105 "alt" => $lng->txt(
"notes_comment").
", ".$lng->txt(
"question")),
108 "alt" => $lng->txt(
"notes_comment").
", ".$lng->txt(
"pro")),
111 "alt" => $lng->txt(
"notes_comment").
", ".$lng->txt(
"contra"))
123 $cmd = $this->ctrl->getCmd(
"getNotesHTML");
124 $next_class = $this->ctrl->getNextClass($this);
129 return $this->
$cmd();
139 $this->private_enabled = $a_enable;
147 $this->public_enabled = $a_enable;
155 $this->comments_settings = $a_enable;
163 $this->public_deletion_enabled = $a_enable;
171 $this->enable_hiding = $a_enable;
179 $this->targets_enabled = $a_enable;
187 $this->multi_selection = $a_enable;
195 $this->anchor_jump = $a_enable;
205 $this->repository_mode = (bool)$a_value;
218 $ilCtrl->setParameter($this,
"notes_only",
"notes");
219 $this->only =
"notes";
232 $ilCtrl->setParameter($this,
"notes_only",
"comments");
233 $this->only =
"comments";
245 $lng->loadLanguageModule(
"notes");
247 $ntpl =
new ilTemplate(
"tpl.notes_and_comments.html",
true,
true,
251 $hide_comments = ($this->only ==
"notes");
252 $hide_notes = ($this->only ==
"comments");
253 switch($ilCtrl->getCmd())
261 $hide_comments =
true;
272 if ($this->private_enabled && $this->public_enabled
273 && $this->only !=
"notes")
275 $this->private_enabled =
false;
279 if ($this->private_enabled && ($ilUser->getId() != ANONYMOUS_USER_ID)
282 $ntpl->setCurrentBlock(
"notes_col");
284 $ntpl->parseCurrentBlock();
289 $comments_col =
false;
290 if ($this->public_enabled && (!$this->delete_note || $this->public_deletion_enabled || $ilSetting->get(
"comments_del_user", 0))
294 $comments_col =
true;
298 if ($this->comments_settings && !$hide_comments && !$this->delete_note
299 && !$this->edit_note_form && !$this->add_note_form && $ilUser->getId() != ANONYMOUS_USER_ID)
301 $notes_settings =
new ilSetting(
"notes");
302 $id = $this->rep_obj_id.
"_".$this->obj_id.
"_".$this->obj_type;
308 $this->
renderLink($ntpl,
"comments_settings", $lng->txt(
"notes_deactivate_comments"),
309 "deactivateComments",
"notes_top");
310 $ntpl->setCurrentBlock(
"comments_settings2");
314 $this->
renderLink($ntpl,
"comments_settings", $lng->txt(
"notes_activate_comments"),
315 "activateComments",
"notes_top");
316 $ntpl->setCurrentBlock(
"comments_settings2");
318 if ($this->ajax && !$comments_col)
320 $ntpl->setVariable(
"COMMENTS_MESS",
321 $ntpl->getMessageHTML($lng->txt(
"comments_feature_currently_not_activated_for_object"),
"info"));
324 $ntpl->parseCurrentBlock();
328 $ntpl->setVariable(
"COMMENTS",
"");
331 $comments_col =
true;
336 $ntpl->setCurrentBlock(
"comments_col");
341 $ntpl->parseCurrentBlock();
360 $notes_settings =
new ilSetting(
"notes");
362 if ($this->comments_settings)
364 $id = $this->rep_obj_id.
"_".$this->obj_id.
"_".$this->obj_type;
369 $ilCtrl->redirectByClass(
"ilnotegui",
"showNotes",
"", $this->ajax);
380 $notes_settings =
new ilSetting(
"notes");
382 if ($this->comments_settings)
384 $id = $this->rep_obj_id.
"_".$this->obj_id.
"_".$this->obj_type;
389 $ilCtrl->redirectByClass(
"ilnotegui",
"showNotes",
"", $this->ajax);
400 include_once(
"./Services/User/classes/class.ilUserUtil.php");
410 $user_setting_notes_public_all =
"y";
411 $user_setting_notes_by_type =
"y";
413 if ($this->delete_note || $this->export_html || $this->print)
415 if (
$_GET[
"note_id"] !=
"")
417 $filter =
$_GET[
"note_id"];
426 $this->obj_type, $a_type, $this->inc_sub, $filter,
427 $user_setting_notes_public_all, $this->repository_mode, (
bool)
$_SESSION[
"comments_sort_asc"]);
430 $this->obj_type, $a_type, $this->inc_sub, $filter,
431 "", $this->repository_mode);
433 $tpl =
new ilTemplate(
"tpl.notes_list.html",
true,
true,
"Services/Notes");
437 include_once(
"./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
438 $tpl->setCurrentBlock(
"close_img");
440 $tpl->parseCurrentBlock();
444 $cnt_str = (count($all_notes) > 0)
445 ?
" (".count($all_notes).
")"
451 switch($this->obj_type)
455 include_once
"Services/ContainerReference/classes/class.ilContainerReference.php";
472 $title .=
" - ".$sub_title;
476 $tpl->setCurrentBlock(
"title");
477 $tpl->setVariable(
"TITLE",
$img.
" ".$title);
478 $tpl->parseCurrentBlock();
481 if ($this->delete_note)
487 $tpl->setVariable(
"TXT_NOTES", $lng->txt(
"private_notes").$cnt_str);
488 $ilCtrl->setParameterByClass(
"ilnotegui",
"note_type",
IL_NOTE_PRIVATE);
492 $tpl->setVariable(
"TXT_NOTES", $lng->txt(
"notes_public_comments").$cnt_str);
493 $ilCtrl->setParameterByClass(
"ilnotegui",
"note_type",
IL_NOTE_PUBLIC);
495 $anch = $this->anchor_jump
498 $tpl->setVariable(
"FORMACTION", $ilCtrl->getFormAction($this,
"getNotesHTML", $anch));
501 $os =
"onsubmit = \"ilNotes.cmdAjaxForm(event, '".
502 $ilCtrl->getFormActionByClass(
"ilnotegui",
"",
"",
true).
503 "'); return false;\"";
504 $tpl->setVariable(
"ON_SUBMIT_FORM", $os);
505 $tpl->setVariable(
"FORM_ID",
"Ajax");
508 if ($this->export_html || $this->print)
510 $tpl->touchBlock(
"print_style");
514 if (!$this->add_note_form && !$this->edit_note_form && !$this->delete_note &&
515 !$this->export_html && !$this->print && $ilUser->getId() != ANONYMOUS_USER_ID)
521 $tpl->setCurrentBlock(
"add_note_btn");
524 $tpl->setVariable(
"TXT_ADD_NOTE", $lng->txt(
"notes_add_comment"));
528 $tpl->setVariable(
"TXT_ADD_NOTE", $lng->txt(
"add_note"));
530 $tpl->setVariable(
"LINK_ADD_NOTE", $ilCtrl->getLinkTargetByClass(
"ilnotegui",
"addNoteForm").
532 $tpl->parseCurrentBlock();
538 if (count($all_notes) > 0 && $this->enable_hiding && !$this->delete_note
539 && !$this->export_html && !$this->print && !$this->edit_note_form
540 && !$this->add_note_form)
542 if ($user_setting_notes_by_type ==
"n")
546 $txt = $lng->txt(
"notes_show_comments");
550 $txt = $lng->txt(
"show_".$suffix.
"_notes");
557 if (($ilUser->getId() != ANONYMOUS_USER_ID))
561 $txt = $lng->txt(
"notes_hide_comments");
565 $txt = $lng->txt(
"hide_".$suffix.
"_notes");
572 if ($user_setting_notes_public_all ==
"n")
574 $this->
renderLink(
$tpl,
"all_pub_notes", $lng->txt(
"notes_all_comments"),
575 "showAllPublicNotes",
"notes_top");
579 $this->
renderLink(
$tpl,
"my_pub_notes", $lng->txt(
"notes_my_comments"),
580 "showMyPublicNotes",
"notes_top");
588 if (!$this->edit_note_form && $user_setting_notes_by_type !=
"n" &&
589 !$this->delete_note && $ilUser->getId() != ANONYMOUS_USER_ID)
596 $tpl->setCurrentBlock(
"edit_note_form");
598 $tpl->setVariable(
"EDIT_FORM", $this->form_tpl->get());
599 $tpl->parseCurrentBlock();
601 $tpl->parseCurrentBlock();
602 $tpl->setCurrentBlock(
"note_row");
603 $tpl->parseCurrentBlock();
607 if ($user_setting_notes_by_type !=
"n" || !$this->enable_hiding)
614 if((
int)$_SESSION[
"comments_sort_asc"] == 1)
616 $sort_txt = $lng->txt(
"notes_sort_desc");
617 $sort_cmd =
"listSortDesc";
621 $sort_txt = $lng->txt(
"notes_sort_asc");
622 $sort_cmd =
"listSortAsc";
624 $this->
renderLink(
$tpl,
"sort_list", $sort_txt, $sort_cmd, $anch);
627 $notes_given =
false;
628 foreach($notes as $note)
630 if ($this->edit_note_form && ($note->getId() ==
$_GET[
"note_id"])
631 && $a_type ==
$_GET[
"note_type"])
637 $tpl->setCurrentBlock(
"edit_note_form");
639 $tpl->setVariable(
"EDIT_FORM", $this->form_tpl->get());
640 $tpl->parseCurrentBlock();
648 && !$this->delete_note
649 && !$this->export_html && !$this->print
650 && !$this->edit_note_form && !$this->add_note_form)
652 $ilCtrl->setParameterByClass(
"ilnotegui",
"note_id", $note->getId());
654 "deleteNote",
"note_".$note->getId());
658 if ($this->multi_selection && !$this->delete_note)
660 $tpl->setCurrentBlock(
"checkbox_col");
661 $tpl->setVariable(
"CHK_NOTE",
"note[]");
662 $tpl->setVariable(
"CHK_NOTE_ID", $note->getId());
663 $tpl->parseCurrentBlock();
671 if (!$this->delete_note && !$this->export_html && !$this->print
672 && !$this->edit_note_form && !$this->add_note_form)
674 $ilCtrl->setParameterByClass(
"ilnotegui",
"note_id", $note->getId());
676 "editNoteForm",
"note_edit");
680 $tpl->setVariable(
"CNT_COL", $cnt_col);
688 $tpl->setCurrentBlock(
"user_img");
689 $tpl->setVariable(
"USR_IMG",
691 $tpl->setVariable(
"USR_ALT", $lng->txt(
"user_image").
": ".
693 $tpl->parseCurrentBlock();
694 $tpl->setVariable(
"TXT_USR",
699 if ($note->getUpdateDate() != null)
701 $tpl->setVariable(
"TXT_LAST_EDIT", $lng->txt(
"last_edited_on"));
702 $tpl->setVariable(
"DATE_LAST_EDIT",
707 $tpl->setVariable(
"VAL_DATE",
712 if ($this->delete_note)
714 $tpl->setCurrentBlock(
"delete_ids");
715 $tpl->setVariable(
"HID_NOTE",
"note[]");
716 $tpl->setVariable(
"HID_NOTE_ID", $note->getId());
717 $tpl->parseCurrentBlock();
719 $target = $note->getObject();
723 $target[
"obj_type"], $target[
"obj_id"]);
725 $rowclass = ($rowclass !=
"tblrow1")
728 if (!$this->export_html && !$this->print)
730 $tpl->setCurrentBlock(
"note_img");
733 $tpl->setVariable(
"IMG_NOTE", $this->comment_img[$note->getLabel()][
"img"]);
734 $tpl->setVariable(
"ALT_NOTE", $this->comment_img[$note->getLabel()][
"alt"]);
738 $tpl->setVariable(
"IMG_NOTE", $this->note_img[$note->getLabel()][
"img"]);
739 $tpl->setVariable(
"ALT_NOTE", $this->note_img[$note->getLabel()][
"alt"]);
741 $tpl->parseCurrentBlock();
745 switch ($note->getLabel())
748 $tpl->setVariable(
"EXP_ICON",
"[ ]");
752 $tpl->setVariable(
"EXP_ICON",
"[!]");
756 $tpl->setVariable(
"EXP_ICON",
"[?]");
760 $tpl->setVariable(
"EXP_ICON",
"[+]");
764 $tpl->setVariable(
"EXP_ICON",
"[-]");
768 $tpl->setCurrentBlock(
"note");
769 $tpl->setVariable(
"ROWCLASS", $rowclass);
770 $text = (trim($note->getText()) !=
"")
771 ? nl2br($note->getText())
772 :
"<p class='subtitle'>".$lng->txt(
"note_content_removed").
"</p>";
773 $tpl->setVariable(
"NOTE_TEXT", $text);
774 $tpl->setVariable(
"VAL_SUBJECT", $note->getSubject());
775 $tpl->setVariable(
"NOTE_ID", $note->getId());
779 $tpl->parseCurrentBlock();
781 $tpl->setCurrentBlock(
"note_row");
782 $tpl->parseCurrentBlock();
788 $tpl->setCurrentBlock(
"no_notes");
791 $tpl->setVariable(
"NO_NOTES", $lng->txt(
"notes_no_comments"));
797 $tpl->parseCurrentBlock();
803 if ($this->multi_selection && !$this->delete_note && !$this->edit_note_form
804 && count($notes) > 0)
808 $tpl->setCurrentBlock(
"delete_cmd");
809 $tpl->setVariable(
"TXT_DELETE_NOTES", $this->lng->txt(
"delete"));
810 $tpl->parseCurrentBlock();
813 $tpl->setCurrentBlock(
"multiple_commands");
814 $tpl->setVariable(
"TXT_SELECT_ALL", $this->lng->txt(
"select_all"));
816 $tpl->setVariable(
"ALT_ARROW", $this->lng->txt(
"actions"));
817 $tpl->setVariable(
"TXT_PRINT_NOTES", $this->lng->txt(
"print"));
818 $tpl->setVariable(
"TXT_EXPORT_NOTES", $this->lng->txt(
"exp_html"));
819 $tpl->parseCurrentBlock();
823 if ($this->delete_note)
825 $tpl->setCurrentBlock(
"delete_cancel");
826 $tpl->setVariable(
"TXT_DEL_NOTES", $this->lng->txt(
"delete"));
827 $tpl->setVariable(
"TXT_CANCEL_DEL_NOTES", $this->lng->txt(
"cancel"));
828 $tpl->parseCurrentBlock();
834 $tpl->touchBlock(
"print_js");
835 $tpl->setCurrentBlock(
"print_back");
836 $tpl->setVariable(
"LINK_BACK", $this->ctrl->getLinkTarget($this,
"showNotes"));
837 $tpl->setVariable(
"TXT_BACK", $this->lng->txt(
"back"));
838 $tpl->parseCurrentBlock();
843 switch(
$_GET[
"note_mess"] !=
"" ?
$_GET[
"note_mess"] : $this->note_mess)
847 $mtxt = $lng->txt(
"msg_obj_modified");
853 ? $lng->txt(
"notes_notes_deleted")
854 : $lng->txt(
"notes_comments_deleted");
860 ? $lng->txt(
"notes_note_deleted")
861 : $lng->txt(
"notes_comment_deleted");
866 $mtxt = $lng->txt(
"form_input_not_valid");
871 $mtxt = $lng->txt(
"info_delete_sure");
876 $mtxt = $lng->txt(
"no_checkbox");
881 $tpl->setVariable(
"MESS",
$tpl->getMessageHTML($mtxt, $mtype));
885 $tpl->setVariable(
"MESS",
"");
890 if ($this->delete_note && count($notes) == 0)
909 global $objDefinition,
$ilCtrl;
912 $parent_class =
"ilObj".$objDefinition->getClassName($parent_type).
"GUI";
913 $parent_path = $ilCtrl->lookupClassPath($parent_class);
914 include_once $parent_path;
915 if(method_exists($parent_class,
"lookupSubObjectTitle"))
917 return call_user_func_array(array($parent_class,
"lookupSubObjectTitle"), array($parent_obj_id, $sub_obj_id));
928 if ($ilUser->getId() == ANONYMOUS_USER_ID)
933 $is_author = ($a_note->getAuthor() == $ilUser->getId());
945 if ($a_note->getType() ==
IL_NOTE_PUBLIC && $is_author && $ilSetting->get(
"comments_del_user", 0))
960 if ($a_note->getAuthor() == $ilUser->getId()
961 && ($ilUser->getId() != ANONYMOUS_USER_ID))
974 public function initNoteForm($a_mode =
"edit", $a_type, $a_note = null)
978 $this->form_tpl =
new ilTemplate(
"tpl.notes_edit.html",
true,
true,
"Services/Notes");
982 $this->form_tpl->setVariable(
"NOTE_ID", $a_note->getId());
985 if ($a_mode ==
"create")
987 $this->form_tpl->setVariable(
"TXT_CMD", ($a_type ==
IL_NOTE_PUBLIC)
988 ? $lng->txt(
"note_add_comment")
989 : $lng->txt(
"note_add_note"));
990 $this->form_tpl->setVariable(
"CMD",
"addNote");
994 $this->form_tpl->setVariable(
"TXT_CMD", ($a_type ==
IL_NOTE_PUBLIC)
995 ? $lng->txt(
"note_update_comment")
996 : $lng->txt(
"note_update_note"));
997 $this->form_tpl->setVariable(
"CMD",
"updateNote");
1001 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1003 $this->form->setOpenTag(
false);
1004 $this->form->setCloseTag(
false);
1005 $this->form->setDisableStandardMessage(
true);
1027 $ta->setValue($a_note->getText());
1029 $this->form->addItem($ta);
1051 $hi->setValue(
$_GET[
"note_id"]);
1052 $this->form->addItem($hi);
1056 if ($a_mode ==
"create")
1058 $this->form->addCommandButton(
"addNote", $lng->txt(
"save"));
1066 $this->form->addCommandButton(
"updateNote", $lng->txt(
"save"));
1073 $ilCtrl->setParameter($this,
"note_type", $a_type);
1074 $this->form->setFormAction($this->ctrl->getFormAction($this));
1085 $tpl =
new ilTemplate(
"tpl.pd_note.html",
true,
true,
"Services/Notes");
1086 $note =
new ilNote($note_id);
1087 $target = $note->getObject();
1089 if ($note->getAuthor() != $ilUser->getId())
1094 $tpl->setCurrentBlock(
"edit_note");
1095 $ilCtrl->setParameterByClass(
"ilnotegui",
"rel_obj", $target[
"rep_obj_id"]);
1096 $ilCtrl->setParameterByClass(
"ilnotegui",
"note_id", $note_id);
1097 $ilCtrl->setParameterByClass(
"ilnotegui",
"note_type", $note->getType());
1098 $tpl->setVariable(
"LINK_EDIT_NOTE",
1099 $ilCtrl->getLinkTargetByClass(array(
"ilpersonaldesktopgui",
"ilpdnotesgui",
"ilnotegui"),
1101 $tpl->setVariable(
"TXT_EDIT_NOTE", $lng->txt(
"edit"));
1102 $tpl->parseCurrentBlock();
1103 $ilCtrl->clearParametersByClass(
"ilnotegui");
1105 $tpl->setCurrentBlock(
"note_img");
1106 $tpl->setVariable(
"IMG_NOTE", $this->note_img[$note->getLabel()][
"img"]);
1107 $tpl->setVariable(
"ALT_NOTE", $this->note_img[$note->getLabel()][
"alt"]);
1108 $tpl->parseCurrentBlock();
1111 if ($note->getUpdateDate() != null)
1113 $tpl->setVariable(
"TXT_LAST_EDIT", $lng->txt(
"last_edited_on"));
1114 $tpl->setVariable(
"DATE_LAST_EDIT",
1120 $tpl->setVariable(
"VAL_DATE",
1124 $tpl->setVariable(
"VAL_SUBJECT", $note->getSubject());
1125 $text = (trim($note->getText()) !=
"")
1126 ? nl2br($note->getText())
1127 :
"<p class='subtitle'>".$lng->txt(
"note_content_removed").
"</p>";
1128 $tpl->setVariable(
"NOTE_TEXT", $text);
1129 $this->
showTargets(
$tpl, $target[
"rep_obj_id"], $note_id, $target[
"obj_type"], $target[
"obj_id"]);
1138 global $tree, $ilAccess, $objDefinition,
$ilUser;
1140 if ($this->targets_enabled)
1142 if ($a_rep_obj_id > 0)
1150 $vis_ref_ids = array();
1153 if ($ilAccess->checkAccess(
"visible",
"", $ref_id))
1160 if (count($vis_ref_ids) > 0)
1162 foreach($vis_ref_ids as $vis_ref_id)
1165 $sub_link = $sub_title =
"";
1166 if ($type ==
"sahs")
1168 $link =
"goto.php?target=sahs_".$vis_ref_id;
1170 if ($a_obj_type ==
"sco" || $a_obj_type ==
"seqc" || $a_obj_type ==
"chap" || $a_obj_type ==
"pg")
1172 $sub_link =
"goto.php?target=sahs_".$vis_ref_id.
"_".$a_obj_id;
1173 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004Node.php");
1178 else if ($type ==
"poll")
1180 include_once
"Services/Link/classes/class.ilLink.php";
1184 else if ($a_obj_type !=
"pg")
1186 if (!is_object($this->item_list_gui[$type]))
1188 $class = $objDefinition->getClassName($type);
1189 $location = $objDefinition->getLocation($type);
1190 $full_class =
"ilObj".$class.
"ListGUI";
1191 include_once(
$location.
"/class.".$full_class.
".php");
1192 $this->item_list_gui[$type] =
new $full_class();
1197 if($a_obj_type ==
"crsr" || $a_obj_type ==
"catr")
1199 include_once
"Services/ContainerReference/classes/class.ilContainerReference.php";
1207 $this->item_list_gui[$type]->initItem($vis_ref_id, $a_rep_obj_id, $title);
1208 $link = $this->item_list_gui[$type]->getCommandLink(
"infoScreen");
1213 $link = $this->item_list_gui[$type]->appendRepositoryFrameParameter($link).
"#note_".$a_note_id;
1218 $link =
"goto.php?target=pg_".$a_obj_id.
"_".$vis_ref_id;
1221 $par_id = $tree->getParentId($vis_ref_id);
1224 if ($sub_link !=
"")
1226 if ($this->export_html || $this->print)
1228 $tpl->setCurrentBlock(
"exp_target_sub_object");
1232 $tpl->setCurrentBlock(
"target_sub_object");
1233 $tpl->setVariable(
"LINK_SUB_TARGET", $sub_link);
1235 $tpl->setVariable(
"TXT_SUB_TARGET", $sub_title);
1236 $tpl->setVariable(
"IMG_SUB_TARGET", $sub_icon);
1237 $tpl->parseCurrentBlock();
1241 if ($this->export_html || $this->print)
1243 $tpl->setCurrentBlock(
"exp_target_object");
1247 $tpl->setCurrentBlock(
"target_object");
1248 $tpl->setVariable(
"LINK_TARGET", $link);
1250 $tpl->setVariable(
"TXT_CONTAINER",
1253 $tpl->setVariable(
"IMG_CONTAINER",
1256 $tpl->setVariable(
"TXT_TARGET", $title);
1257 $tpl->setVariable(
"IMG_TARGET",
1260 $tpl->parseCurrentBlock();
1262 $tpl->touchBlock(
"target_objects");
1269 if(!$this->wsp_tree)
1271 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
1272 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
1276 $node_id = $this->wsp_tree->lookupNodeId($a_rep_obj_id);
1277 if($this->wsp_access_handler->checkAccess(
"visible",
"", $node_id))
1279 $path = $this->wsp_tree->getPathFull($node_id);
1282 $item = array_pop(
$path);
1283 $parent = array_pop(
$path);
1285 if(!$parent[
"title"])
1287 $parent[
"title"] = $this->lng->txt(
"wsp_personal_workspace");
1297 $item[
"title"] .=
" (".$sub_title.
")";
1308 $parent[
"title"] = $this->lng->txt(
"wsp_tab_shared").
1309 " (".ilObject::_lookupOwnerName($owner).
")";
1311 $link =
"ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&dsh=".
1316 if ($this->export_html || $this->print)
1318 $tpl->setCurrentBlock(
"exp_target_object");
1322 $tpl->setCurrentBlock(
"target_object");
1323 $tpl->setVariable(
"LINK_TARGET", $link);
1329 $tpl->setVariable(
"TXT_CONTAINER", $parent[
"title"]);
1330 $tpl->setVariable(
"IMG_CONTAINER",
1333 $tpl->setVariable(
"TXT_TARGET", $item[
"title"]);
1334 $tpl->setVariable(
"IMG_TARGET",
1337 $tpl->parseCurrentBlock();
1354 $ilUser->setPref(
"notes_".$suffix,
"y");
1356 $this->add_note_form =
true;
1386 if (
$_POST[
"note"] !=
"")
1389 $note->setObject($this->obj_type, $this->rep_obj_id, $this->obj_id);
1390 $note->setInRepository($this->repository_mode);
1391 $note->setType(
$_GET[
"note_type"]);
1392 $note->setAuthor($ilUser->getId());
1393 $note->setText(ilUtil::stripslashes(
$_POST[
"note"]));
1400 $ilCtrl->setParameter($this,
"note_mess",
"mod");
1403 $ilCtrl->redirect($this,
"showNotes",
"notes_top", $this->ajax);
1432 $ilCtrl->setParameter($this,
"note_mess",
"mod");
1434 $ilCtrl->redirect($this,
"showNotes",
"notes_top", $this->ajax);
1436 $ilCtrl->redirect($this,
"showNotes",
"notes_top", $this->ajax);
1437 $this->note_mess =
"frmfld";
1438 $this->form->setValuesByPost();
1439 $_GET[
"note_id"] = $note->getId();
1440 $_GET[
"note_type"] = $note->getType();
1449 $this->edit_note_form =
true;
1459 $this->delete_note =
true;
1460 $this->note_mess =
"qdel";
1473 $this->note_mess =
"noc";
1477 $this->delete_note =
true;
1478 $this->note_mess =
"qdel";
1500 foreach(
$_POST[
"note"] as $id)
1511 $ilCtrl->setParameter($this,
"note_mess",
"ntsdel");
1515 $ilCtrl->setParameter($this,
"note_mess",
"ntdel");
1517 $ilCtrl->redirect($this,
"showNotes",
"notes_top", $this->ajax);
1527 $this->export_html =
true;
1528 $this->multi_selection =
false;
1540 $this->print =
true;
1541 $this->multi_selection =
false;
1556 $ilUser->writePref(
"notes_".$suffix,
"y");
1571 $ilUser->writePref(
"notes_".$suffix,
"n");
1583 $ilUser->writePref(
"notes_pub_all",
"y");
1595 $ilUser->writePref(
"notes_pub_all",
"n");
1607 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
1609 include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
1611 $tpl->addJavascript(
"./Services/Notes/js/ilNotes.js");
1613 $tpl->addOnLoadCode(
"ilNotes.setAjaxUrl('".$a_ajax_url.
"');");
1625 if ($a_update_code === null)
1627 $a_update_code =
"null";
1631 $a_update_code =
"'".$a_update_code.
"'";
1634 return "ilNotes.listNotes(event, '".$a_hash.
"', ".$a_update_code.
");";
1646 if ($a_update_code === null)
1648 $a_update_code =
"null";
1652 $a_update_code =
"'".$a_update_code.
"'";
1655 return "ilNotes.listComments(event, '".$a_hash.
"', ".$a_update_code.
");";
1667 protected static function buildAjaxHash($a_node_type, $a_node_id, $a_sub_id, $a_sub_type)
1669 return $a_node_type.
";".$a_node_id.
";".$a_sub_id.
";".$a_sub_type;
1675 function renderLink($a_tpl, $a_var, $a_txt, $a_cmd, $a_anchor =
"")
1679 $low_var = strtolower($a_var);
1680 $up_var = strtoupper($a_var);
1684 $a_tpl->setVariable(
"LINK_".$up_var,
"#");
1685 $oc =
"onclick = \"ilNotes.cmdAjaxLink(event, '".
1686 $ilCtrl->getLinkTargetByClass(
"ilnotegui", $a_cmd,
"",
true).
1688 $a_tpl->setVariable(
"ON_CLICK_".$up_var, $oc);
1692 $a_tpl->setVariable(
"LINK_".$up_var,
1693 $ilCtrl->getLinkTargetByClass(
"ilnotegui", $a_cmd, $a_anchor));
1696 $a_tpl->setCurrentBlock($low_var);
1697 $a_tpl->setVariable(
"TXT_".$up_var, $a_txt);
1698 $a_tpl->parseCurrentBlock();
1708 $this->observer[] = $a_callback;
1719 if(
sizeof($this->observer))
1721 foreach($this->observer as $item)
1723 $param = $a_note->getObject();
1724 $param[
"action"] = $a_action;
1725 $param[
"note_id"] = $a_note->getId();
1727 call_user_func_array($item, $param);
1735 return $this->getNotesHtml();
1741 return $this->getNotesHtml();