6 include_once (
"Services/Notes/classes/class.ilNote.php");
32 function ilNoteGUI($a_rep_obj_id =
"", $a_obj_id =
"", $a_obj_type =
"", $a_include_subobjects =
false)
36 $lng->loadLanguageModule(
"notes");
38 $ilCtrl->saveParameter($this,
"notes_only");
39 $this->only =
$_GET[
"notes_only"];
41 $this->rep_obj_id = $a_rep_obj_id;
42 $this->obj_id = $a_obj_id;
43 $this->obj_type = $a_obj_type;
44 $this->inc_sub = $a_include_subobjects;
47 if(!$this->obj_type && $a_rep_obj_id)
52 $this->ajax = $ilCtrl->isAsynch();
57 $this->anchor_jump =
true;
58 $this->add_note_form =
false;
59 $this->edit_note_form =
false;
60 $this->private_enabled =
false;
62 $id = $this->rep_obj_id.
"_".$this->obj_id.
"_".$this->obj_type;
66 $this->public_enabled =
true;
70 $this->public_enabled =
false;
72 $this->enable_hiding =
false;
73 $this->targets_enabled =
false;
74 $this->multi_selection =
false;
75 $this->export_html =
false;
77 $this->comments_settings =
false;
79 $this->note_img = array(
82 "alt" => $lng->txt(
"note")),
85 "alt" => $lng->txt(
"note").
", ".$lng->txt(
"important")),
88 "alt" => $lng->txt(
"note").
", ".$lng->txt(
"question")),
91 "alt" => $lng->txt(
"note").
", ".$lng->txt(
"pro")),
94 "alt" => $lng->txt(
"note").
", ".$lng->txt(
"contra"))
97 $this->comment_img = array(
100 "alt" => $lng->txt(
"notes_comment")),
103 "alt" => $lng->txt(
"notes_comment").
", ".$lng->txt(
"important")),
106 "alt" => $lng->txt(
"notes_comment").
", ".$lng->txt(
"question")),
109 "alt" => $lng->txt(
"notes_comment").
", ".$lng->txt(
"pro")),
112 "alt" => $lng->txt(
"notes_comment").
", ".$lng->txt(
"contra"))
124 $cmd = $this->ctrl->getCmd(
"getNotesHTML");
125 $next_class = $this->ctrl->getNextClass($this);
130 return $this->
$cmd();
140 $this->private_enabled = $a_enable;
148 $this->public_enabled = $a_enable;
156 $this->comments_settings = $a_enable;
164 $this->public_deletion_enabled = $a_enable;
172 $this->enable_hiding = $a_enable;
180 $this->targets_enabled = $a_enable;
188 $this->multi_selection = $a_enable;
196 $this->anchor_jump = $a_enable;
206 $this->repository_mode = (bool)$a_value;
219 $ilCtrl->setParameter($this,
"notes_only",
"notes");
220 $this->only =
"notes";
233 $ilCtrl->setParameter($this,
"notes_only",
"comments");
234 $this->only =
"comments";
246 $lng->loadLanguageModule(
"notes");
248 $ntpl =
new ilTemplate(
"tpl.notes_and_comments.html",
true,
true,
252 $hide_comments = ($this->only ==
"notes");
253 $hide_notes = ($this->only ==
"comments");
254 switch($ilCtrl->getCmd())
262 $hide_comments =
true;
273 if ($this->private_enabled && $this->public_enabled
274 && $this->only !=
"notes")
276 $this->private_enabled =
false;
280 if ($this->private_enabled && ($ilUser->getId() != ANONYMOUS_USER_ID)
283 $ntpl->setCurrentBlock(
"notes_col");
285 $ntpl->parseCurrentBlock();
290 $comments_col =
false;
291 if ($this->public_enabled && (!$this->delete_note || $this->public_deletion_enabled || $ilSetting->get(
"comments_del_user", 0))
295 $comments_col =
true;
299 if ($this->comments_settings && !$hide_comments && !$this->delete_note
300 && !$this->edit_note_form && !$this->add_note_form && $ilUser->getId() != ANONYMOUS_USER_ID)
302 $notes_settings =
new ilSetting(
"notes");
303 $id = $this->rep_obj_id.
"_".$this->obj_id.
"_".$this->obj_type;
309 $this->
renderLink($ntpl,
"comments_settings", $lng->txt(
"notes_deactivate_comments"),
310 "deactivateComments",
"notes_top");
311 $ntpl->setCurrentBlock(
"comments_settings2");
315 $this->
renderLink($ntpl,
"comments_settings", $lng->txt(
"notes_activate_comments"),
316 "activateComments",
"notes_top");
317 $ntpl->setCurrentBlock(
"comments_settings2");
319 if ($this->ajax && !$comments_col)
321 $ntpl->setVariable(
"COMMENTS_MESS",
322 $ntpl->getMessageHTML($lng->txt(
"comments_feature_currently_not_activated_for_object"),
"info"));
325 $ntpl->parseCurrentBlock();
329 $ntpl->setVariable(
"COMMENTS",
"");
332 $comments_col =
true;
337 $ntpl->setCurrentBlock(
"comments_col");
342 $ntpl->parseCurrentBlock();
361 $notes_settings =
new ilSetting(
"notes");
363 if ($this->comments_settings)
365 $id = $this->rep_obj_id.
"_".$this->obj_id.
"_".$this->obj_type;
370 $ilCtrl->redirectByClass(
"ilnotegui",
"showNotes",
"", $this->ajax);
381 $notes_settings =
new ilSetting(
"notes");
383 if ($this->comments_settings)
385 $id = $this->rep_obj_id.
"_".$this->obj_id.
"_".$this->obj_type;
390 $ilCtrl->redirectByClass(
"ilnotegui",
"showNotes",
"", $this->ajax);
401 include_once(
"./Services/User/classes/class.ilUserUtil.php");
411 $user_setting_notes_public_all =
"y";
412 $user_setting_notes_by_type =
"y";
414 if ($this->delete_note || $this->export_html || $this->print)
416 if (
$_GET[
"note_id"] !=
"")
418 $filter =
$_GET[
"note_id"];
427 $this->obj_type, $a_type, $this->inc_sub, $filter,
428 $user_setting_notes_public_all, $this->repository_mode, (
bool)
$_SESSION[
"comments_sort_asc"]);
431 $this->obj_type, $a_type, $this->inc_sub, $filter,
432 "", $this->repository_mode);
434 $tpl =
new ilTemplate(
"tpl.notes_list.html",
true,
true,
"Services/Notes");
438 include_once(
"./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
439 $tpl->setCurrentBlock(
"close_img");
441 $tpl->parseCurrentBlock();
445 $cnt_str = (count($all_notes) > 0)
446 ?
" (".count($all_notes).
")" 452 switch($this->obj_type)
456 include_once
"Services/ContainerReference/classes/class.ilContainerReference.php";
473 $title .=
" - ".$sub_title;
477 $tpl->setCurrentBlock(
"title");
478 $tpl->setVariable(
"TITLE",
$img.
" ".$title);
479 $tpl->parseCurrentBlock();
482 if ($this->delete_note)
488 $tpl->setVariable(
"TXT_NOTES", $lng->txt(
"private_notes").$cnt_str);
489 $ilCtrl->setParameterByClass(
"ilnotegui",
"note_type",
IL_NOTE_PRIVATE);
493 $tpl->setVariable(
"TXT_NOTES", $lng->txt(
"notes_public_comments").$cnt_str);
494 $ilCtrl->setParameterByClass(
"ilnotegui",
"note_type",
IL_NOTE_PUBLIC);
496 $anch = $this->anchor_jump
499 $tpl->setVariable(
"FORMACTION", $ilCtrl->getFormAction($this,
"getNotesHTML", $anch));
502 $os =
"onsubmit = \"ilNotes.cmdAjaxForm(event, '".
503 $ilCtrl->getFormActionByClass(
"ilnotegui",
"",
"",
true).
504 "'); return false;\"";
505 $tpl->setVariable(
"ON_SUBMIT_FORM", $os);
506 $tpl->setVariable(
"FORM_ID",
"Ajax");
509 if ($this->export_html || $this->print)
511 $tpl->touchBlock(
"print_style");
515 if (!$this->add_note_form && !$this->edit_note_form && !$this->delete_note &&
516 !$this->export_html && !$this->print && $ilUser->getId() != ANONYMOUS_USER_ID)
522 $tpl->setCurrentBlock(
"add_note_btn");
525 $tpl->setVariable(
"TXT_ADD_NOTE", $lng->txt(
"notes_add_comment"));
529 $tpl->setVariable(
"TXT_ADD_NOTE", $lng->txt(
"add_note"));
531 $tpl->setVariable(
"LINK_ADD_NOTE", $ilCtrl->getLinkTargetByClass(
"ilnotegui",
"addNoteForm").
533 $tpl->parseCurrentBlock();
539 if (count($all_notes) > 0 && $this->enable_hiding && !$this->delete_note
540 && !$this->export_html && !$this->print && !$this->edit_note_form
541 && !$this->add_note_form)
543 if ($user_setting_notes_by_type ==
"n")
547 $txt = $lng->txt(
"notes_show_comments");
551 $txt = $lng->txt(
"show_".$suffix.
"_notes");
558 if (($ilUser->getId() != ANONYMOUS_USER_ID))
562 $txt = $lng->txt(
"notes_hide_comments");
566 $txt = $lng->txt(
"hide_".$suffix.
"_notes");
573 if ($user_setting_notes_public_all ==
"n")
575 $this->
renderLink(
$tpl,
"all_pub_notes", $lng->txt(
"notes_all_comments"),
576 "showAllPublicNotes",
"notes_top");
580 $this->
renderLink(
$tpl,
"my_pub_notes", $lng->txt(
"notes_my_comments"),
581 "showMyPublicNotes",
"notes_top");
589 if (!$this->edit_note_form && $user_setting_notes_by_type !=
"n" &&
590 !$this->delete_note && $ilUser->getId() != ANONYMOUS_USER_ID)
597 $tpl->setCurrentBlock(
"edit_note_form");
599 $tpl->setVariable(
"EDIT_FORM", $this->form_tpl->get());
600 $tpl->parseCurrentBlock();
602 $tpl->parseCurrentBlock();
603 $tpl->setCurrentBlock(
"note_row");
604 $tpl->parseCurrentBlock();
608 if ($user_setting_notes_by_type !=
"n" || !$this->enable_hiding)
615 if((
int)$_SESSION[
"comments_sort_asc"] == 1)
617 $sort_txt = $lng->txt(
"notes_sort_desc");
618 $sort_cmd =
"listSortDesc";
622 $sort_txt = $lng->txt(
"notes_sort_asc");
623 $sort_cmd =
"listSortAsc";
625 $this->
renderLink(
$tpl,
"sort_list", $sort_txt, $sort_cmd, $anch);
628 $notes_given =
false;
629 foreach($notes as $note)
631 if ($this->edit_note_form && ($note->getId() ==
$_GET[
"note_id"])
632 && $a_type ==
$_GET[
"note_type"])
638 $tpl->setCurrentBlock(
"edit_note_form");
640 $tpl->setVariable(
"EDIT_FORM", $this->form_tpl->get());
641 $tpl->parseCurrentBlock();
649 && !$this->delete_note
650 && !$this->export_html && !$this->print
651 && !$this->edit_note_form && !$this->add_note_form)
653 $ilCtrl->setParameterByClass(
"ilnotegui",
"note_id", $note->getId());
655 "deleteNote",
"note_".$note->getId());
659 if ($this->multi_selection && !$this->delete_note)
661 $tpl->setCurrentBlock(
"checkbox_col");
662 $tpl->setVariable(
"CHK_NOTE",
"note[]");
663 $tpl->setVariable(
"CHK_NOTE_ID", $note->getId());
664 $tpl->parseCurrentBlock();
672 if (!$this->delete_note && !$this->export_html && !$this->print
673 && !$this->edit_note_form && !$this->add_note_form)
675 $ilCtrl->setParameterByClass(
"ilnotegui",
"note_id", $note->getId());
677 "editNoteForm",
"note_edit");
681 $tpl->setVariable(
"CNT_COL", $cnt_col);
689 $tpl->setCurrentBlock(
"user_img");
690 $tpl->setVariable(
"USR_IMG",
692 $tpl->setVariable(
"USR_ALT", $lng->txt(
"user_image").
": ".
694 $tpl->parseCurrentBlock();
695 $tpl->setVariable(
"TXT_USR",
700 if ($note->getUpdateDate() != null)
702 $tpl->setVariable(
"TXT_LAST_EDIT", $lng->txt(
"last_edited_on"));
703 $tpl->setVariable(
"DATE_LAST_EDIT",
708 $tpl->setVariable(
"VAL_DATE",
713 if ($this->delete_note)
715 $tpl->setCurrentBlock(
"delete_ids");
716 $tpl->setVariable(
"HID_NOTE",
"note[]");
717 $tpl->setVariable(
"HID_NOTE_ID", $note->getId());
718 $tpl->parseCurrentBlock();
720 $target = $note->getObject();
724 $target[
"obj_type"], $target[
"obj_id"]);
726 $rowclass = ($rowclass !=
"tblrow1")
729 if (!$this->export_html && !$this->print)
731 $tpl->setCurrentBlock(
"note_img");
734 $tpl->setVariable(
"IMG_NOTE", $this->comment_img[$note->getLabel()][
"img"]);
735 $tpl->setVariable(
"ALT_NOTE", $this->comment_img[$note->getLabel()][
"alt"]);
739 $tpl->setVariable(
"IMG_NOTE", $this->note_img[$note->getLabel()][
"img"]);
740 $tpl->setVariable(
"ALT_NOTE", $this->note_img[$note->getLabel()][
"alt"]);
742 $tpl->parseCurrentBlock();
746 switch ($note->getLabel())
749 $tpl->setVariable(
"EXP_ICON",
"[ ]");
753 $tpl->setVariable(
"EXP_ICON",
"[!]");
757 $tpl->setVariable(
"EXP_ICON",
"[?]");
761 $tpl->setVariable(
"EXP_ICON",
"[+]");
765 $tpl->setVariable(
"EXP_ICON",
"[-]");
769 $tpl->setCurrentBlock(
"note");
770 $tpl->setVariable(
"ROWCLASS", $rowclass);
771 $text = (trim($note->getText()) !=
"")
772 ? nl2br($note->getText())
773 :
"<p class='subtitle'>".$lng->txt(
"note_content_removed").
"</p>";
775 $tpl->setVariable(
"VAL_SUBJECT", $note->getSubject());
776 $tpl->setVariable(
"NOTE_ID", $note->getId());
780 $tpl->parseCurrentBlock();
782 $tpl->setCurrentBlock(
"note_row");
783 $tpl->parseCurrentBlock();
789 $tpl->setCurrentBlock(
"no_notes");
792 $tpl->setVariable(
"NO_NOTES", $lng->txt(
"notes_no_comments"));
798 $tpl->parseCurrentBlock();
804 if ($this->multi_selection && !$this->delete_note && !$this->edit_note_form
805 && count($notes) > 0)
809 $tpl->setCurrentBlock(
"delete_cmd");
810 $tpl->setVariable(
"TXT_DELETE_NOTES", $this->lng->txt(
"delete"));
811 $tpl->parseCurrentBlock();
814 $tpl->setCurrentBlock(
"multiple_commands");
815 $tpl->setVariable(
"TXT_SELECT_ALL", $this->lng->txt(
"select_all"));
817 $tpl->setVariable(
"ALT_ARROW", $this->lng->txt(
"actions"));
818 $tpl->setVariable(
"TXT_PRINT_NOTES", $this->lng->txt(
"print"));
819 $tpl->setVariable(
"TXT_EXPORT_NOTES", $this->lng->txt(
"exp_html"));
820 $tpl->parseCurrentBlock();
824 if ($this->delete_note)
826 $tpl->setCurrentBlock(
"delete_cancel");
827 $tpl->setVariable(
"TXT_DEL_NOTES", $this->lng->txt(
"delete"));
828 $tpl->setVariable(
"TXT_CANCEL_DEL_NOTES", $this->lng->txt(
"cancel"));
829 $tpl->parseCurrentBlock();
835 $tpl->touchBlock(
"print_js");
836 $tpl->setCurrentBlock(
"print_back");
837 $tpl->setVariable(
"LINK_BACK", $this->ctrl->getLinkTarget($this,
"showNotes"));
838 $tpl->setVariable(
"TXT_BACK", $this->lng->txt(
"back"));
839 $tpl->parseCurrentBlock();
844 switch(
$_GET[
"note_mess"] !=
"" ?
$_GET[
"note_mess"] : $this->note_mess)
848 $mtxt = $lng->txt(
"msg_obj_modified");
854 ? $lng->txt(
"notes_notes_deleted")
855 : $lng->txt(
"notes_comments_deleted");
861 ? $lng->txt(
"notes_note_deleted")
862 : $lng->txt(
"notes_comment_deleted");
867 $mtxt = $lng->txt(
"form_input_not_valid");
872 $mtxt = $lng->txt(
"info_delete_sure");
877 $mtxt = $lng->txt(
"no_checkbox");
882 $tpl->setVariable(
"MESS",
$tpl->getMessageHTML($mtxt, $mtype));
886 $tpl->setVariable(
"MESS",
"");
891 if ($this->delete_note && count($notes) == 0)
910 global $objDefinition,
$ilCtrl;
913 $parent_class =
"ilObj".$objDefinition->getClassName($parent_type).
"GUI";
914 $parent_path = $ilCtrl->lookupClassPath($parent_class);
915 include_once $parent_path;
916 if(method_exists($parent_class,
"lookupSubObjectTitle"))
918 return call_user_func_array(array($parent_class,
"lookupSubObjectTitle"), array($parent_obj_id, $sub_obj_id));
929 if ($ilUser->getId() == ANONYMOUS_USER_ID)
934 $is_author = ($a_note->getAuthor() == $ilUser->getId());
946 if ($a_note->getType() ==
IL_NOTE_PUBLIC && $is_author && $ilSetting->get(
"comments_del_user", 0))
961 if ($a_note->getAuthor() == $ilUser->getId()
962 && ($ilUser->getId() != ANONYMOUS_USER_ID))
975 public function initNoteForm($a_mode =
"edit", $a_type, $a_note = null)
979 $this->form_tpl =
new ilTemplate(
"tpl.notes_edit.html",
true,
true,
"Services/Notes");
983 $this->form_tpl->setVariable(
"NOTE_ID", $a_note->getId());
986 if ($a_mode ==
"create")
988 $this->form_tpl->setVariable(
"TXT_CMD", ($a_type ==
IL_NOTE_PUBLIC)
989 ? $lng->txt(
"note_add_comment")
990 : $lng->txt(
"note_add_note"));
991 $this->form_tpl->setVariable(
"CMD",
"addNote");
995 $this->form_tpl->setVariable(
"TXT_CMD", ($a_type ==
IL_NOTE_PUBLIC)
996 ? $lng->txt(
"note_update_comment")
997 : $lng->txt(
"note_update_note"));
998 $this->form_tpl->setVariable(
"CMD",
"updateNote");
1002 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1004 $this->form->setOpenTag(
false);
1005 $this->form->setCloseTag(
false);
1006 $this->form->setDisableStandardMessage(
true);
1028 $ta->setValue($a_note->getText());
1030 $this->form->addItem($ta);
1052 $hi->setValue(
$_GET[
"note_id"]);
1053 $this->form->addItem($hi);
1057 if ($a_mode ==
"create")
1059 $this->form->addCommandButton(
"addNote", $lng->txt(
"save"));
1067 $this->form->addCommandButton(
"updateNote", $lng->txt(
"save"));
1074 $ilCtrl->setParameter($this,
"note_type", $a_type);
1075 $this->form->setFormAction($this->ctrl->getFormAction($this));
1086 $tpl =
new ilTemplate(
"tpl.pd_note.html",
true,
true,
"Services/Notes");
1087 $note =
new ilNote($note_id);
1088 $target = $note->getObject();
1090 if ($note->getAuthor() != $ilUser->getId())
1095 $tpl->setCurrentBlock(
"edit_note");
1096 $ilCtrl->setParameterByClass(
"ilnotegui",
"rel_obj", $target[
"rep_obj_id"]);
1097 $ilCtrl->setParameterByClass(
"ilnotegui",
"note_id", $note_id);
1098 $ilCtrl->setParameterByClass(
"ilnotegui",
"note_type", $note->getType());
1099 $tpl->setVariable(
"LINK_EDIT_NOTE",
1100 $ilCtrl->getLinkTargetByClass(array(
"ilpersonaldesktopgui",
"ilpdnotesgui",
"ilnotegui"),
1102 $tpl->setVariable(
"TXT_EDIT_NOTE", $lng->txt(
"edit"));
1103 $tpl->parseCurrentBlock();
1104 $ilCtrl->clearParametersByClass(
"ilnotegui");
1106 $tpl->setCurrentBlock(
"note_img");
1107 $tpl->setVariable(
"IMG_NOTE", $this->note_img[$note->getLabel()][
"img"]);
1108 $tpl->setVariable(
"ALT_NOTE", $this->note_img[$note->getLabel()][
"alt"]);
1109 $tpl->parseCurrentBlock();
1112 if ($note->getUpdateDate() != null)
1114 $tpl->setVariable(
"TXT_LAST_EDIT", $lng->txt(
"last_edited_on"));
1115 $tpl->setVariable(
"DATE_LAST_EDIT",
1121 $tpl->setVariable(
"VAL_DATE",
1125 $tpl->setVariable(
"VAL_SUBJECT", $note->getSubject());
1126 $text = (trim($note->getText()) !=
"")
1127 ? nl2br($note->getText())
1128 :
"<p class='subtitle'>".$lng->txt(
"note_content_removed").
"</p>";
1130 $this->
showTargets(
$tpl, $target[
"rep_obj_id"], $note_id, $target[
"obj_type"], $target[
"obj_id"]);
1139 global $tree, $ilAccess, $objDefinition,
$ilUser;
1141 if ($this->targets_enabled)
1143 if ($a_rep_obj_id > 0)
1151 $vis_ref_ids = array();
1154 if ($ilAccess->checkAccess(
"visible",
"", $ref_id))
1161 if (count($vis_ref_ids) > 0)
1163 foreach($vis_ref_ids as $vis_ref_id)
1166 $sub_link = $sub_title =
"";
1167 if ($type ==
"sahs")
1169 $link =
"goto.php?target=sahs_".$vis_ref_id;
1171 if ($a_obj_type ==
"sco" || $a_obj_type ==
"seqc" || $a_obj_type ==
"chap" || $a_obj_type ==
"pg")
1173 $sub_link =
"goto.php?target=sahs_".$vis_ref_id.
"_".$a_obj_id;
1174 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004Node.php");
1179 else if ($type ==
"poll")
1181 include_once
"Services/Link/classes/class.ilLink.php";
1185 else if ($a_obj_type !=
"pg")
1187 if (!is_object($this->item_list_gui[$type]))
1189 $class = $objDefinition->getClassName($type);
1190 $location = $objDefinition->getLocation($type);
1191 $full_class =
"ilObj".$class.
"ListGUI";
1192 include_once(
$location.
"/class.".$full_class.
".php");
1193 $this->item_list_gui[$type] =
new $full_class();
1198 if($a_obj_type ==
"crsr" || $a_obj_type ==
"catr")
1200 include_once
"Services/ContainerReference/classes/class.ilContainerReference.php";
1208 $this->item_list_gui[$type]->initItem($vis_ref_id, $a_rep_obj_id, $title);
1209 $link = $this->item_list_gui[$type]->getCommandLink(
"infoScreen");
1214 $link = $this->item_list_gui[$type]->appendRepositoryFrameParameter($link).
"#note_".$a_note_id;
1219 $link =
"goto.php?target=pg_".$a_obj_id.
"_".$vis_ref_id;
1222 $par_id = $tree->getParentId($vis_ref_id);
1225 if ($sub_link !=
"")
1227 if ($this->export_html || $this->print)
1229 $tpl->setCurrentBlock(
"exp_target_sub_object");
1233 $tpl->setCurrentBlock(
"target_sub_object");
1234 $tpl->setVariable(
"LINK_SUB_TARGET", $sub_link);
1236 $tpl->setVariable(
"TXT_SUB_TARGET", $sub_title);
1237 $tpl->setVariable(
"IMG_SUB_TARGET", $sub_icon);
1238 $tpl->parseCurrentBlock();
1242 if ($this->export_html || $this->print)
1244 $tpl->setCurrentBlock(
"exp_target_object");
1248 $tpl->setCurrentBlock(
"target_object");
1249 $tpl->setVariable(
"LINK_TARGET", $link);
1251 $tpl->setVariable(
"TXT_CONTAINER",
1254 $tpl->setVariable(
"IMG_CONTAINER",
1257 $tpl->setVariable(
"TXT_TARGET", $title);
1258 $tpl->setVariable(
"IMG_TARGET",
1261 $tpl->parseCurrentBlock();
1263 $tpl->touchBlock(
"target_objects");
1270 if(!$this->wsp_tree)
1272 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
1273 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
1277 $node_id = $this->wsp_tree->lookupNodeId($a_rep_obj_id);
1278 if($this->wsp_access_handler->checkAccess(
"visible",
"", $node_id))
1280 $path = $this->wsp_tree->getPathFull($node_id);
1283 $item = array_pop(
$path);
1284 $parent = array_pop(
$path);
1286 if(!$parent[
"title"])
1288 $parent[
"title"] = $this->lng->txt(
"wsp_personal_workspace");
1298 $item[
"title"] .=
" (".$sub_title.
")";
1309 $parent[
"title"] = $this->lng->txt(
"wsp_tab_shared").
1310 " (".ilObject::_lookupOwnerName($owner).
")";
1312 $link =
"ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&dsh=".
1317 if ($this->export_html || $this->print)
1319 $tpl->setCurrentBlock(
"exp_target_object");
1323 $tpl->setCurrentBlock(
"target_object");
1324 $tpl->setVariable(
"LINK_TARGET", $link);
1330 $tpl->setVariable(
"TXT_CONTAINER", $parent[
"title"]);
1331 $tpl->setVariable(
"IMG_CONTAINER",
1334 $tpl->setVariable(
"TXT_TARGET", $item[
"title"]);
1335 $tpl->setVariable(
"IMG_TARGET",
1338 $tpl->parseCurrentBlock();
1355 $ilUser->setPref(
"notes_".$suffix,
"y");
1357 $this->add_note_form =
true;
1387 if (
$_POST[
"note"] !=
"")
1390 $note->setObject($this->obj_type, $this->rep_obj_id, $this->obj_id);
1391 $note->setInRepository($this->repository_mode);
1392 $note->setType(
$_GET[
"note_type"]);
1393 $note->setAuthor($ilUser->getId());
1394 $note->setText(ilUtil::stripslashes(
$_POST[
"note"]));
1401 $ilCtrl->setParameter($this,
"note_mess",
"mod");
1404 $ilCtrl->redirect($this,
"showNotes",
"notes_top", $this->ajax);
1433 $ilCtrl->setParameter($this,
"note_mess",
"mod");
1435 $ilCtrl->redirect($this,
"showNotes",
"notes_top", $this->ajax);
1437 $ilCtrl->redirect($this,
"showNotes",
"notes_top", $this->ajax);
1438 $this->note_mess =
"frmfld";
1439 $this->form->setValuesByPost();
1440 $_GET[
"note_id"] = $note->getId();
1441 $_GET[
"note_type"] = $note->getType();
1450 $this->edit_note_form =
true;
1460 $this->delete_note =
true;
1461 $this->note_mess =
"qdel";
1474 $this->note_mess =
"noc";
1478 $this->delete_note =
true;
1479 $this->note_mess =
"qdel";
1501 foreach(
$_POST[
"note"] as $id)
1512 $ilCtrl->setParameter($this,
"note_mess",
"ntsdel");
1516 $ilCtrl->setParameter($this,
"note_mess",
"ntdel");
1518 $ilCtrl->redirect($this,
"showNotes",
"notes_top", $this->ajax);
1528 $this->export_html =
true;
1529 $this->multi_selection =
false;
1541 $this->print =
true;
1542 $this->multi_selection =
false;
1557 $ilUser->writePref(
"notes_".$suffix,
"y");
1572 $ilUser->writePref(
"notes_".$suffix,
"n");
1584 $ilUser->writePref(
"notes_pub_all",
"y");
1596 $ilUser->writePref(
"notes_pub_all",
"n");
1608 $lng->loadLanguageModule(
"notes");
1610 include_once(
"./Services/UIComponent/Modal/classes/class.ilModalGUI.php");
1613 $lng->toJs(array(
"private_notes",
"notes_public_comments"));
1615 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
1617 include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
1619 $tpl->addJavascript(
"./Services/Notes/js/ilNotes.js");
1621 $tpl->addOnLoadCode(
"ilNotes.setAjaxUrl('".$a_ajax_url.
"');");
1633 if ($a_update_code === null)
1635 $a_update_code =
"null";
1639 $a_update_code =
"'".$a_update_code.
"'";
1642 return "ilNotes.listNotes(event, '".$a_hash.
"', ".$a_update_code.
");";
1654 if ($a_update_code === null)
1656 $a_update_code =
"null";
1660 $a_update_code =
"'".$a_update_code.
"'";
1663 return "ilNotes.listComments(event, '".$a_hash.
"', ".$a_update_code.
");";
1675 protected static function buildAjaxHash($a_node_type, $a_node_id, $a_sub_id, $a_sub_type)
1677 return $a_node_type.
";".$a_node_id.
";".$a_sub_id.
";".$a_sub_type;
1683 function renderLink($a_tpl, $a_var, $a_txt, $a_cmd, $a_anchor =
"")
1687 $low_var = strtolower($a_var);
1688 $up_var = strtoupper($a_var);
1692 $a_tpl->setVariable(
"LINK_".$up_var,
"#");
1693 $oc =
"onclick = \"ilNotes.cmdAjaxLink(event, '".
1694 $ilCtrl->getLinkTargetByClass(
"ilnotegui", $a_cmd,
"",
true).
1696 $a_tpl->setVariable(
"ON_CLICK_".$up_var, $oc);
1700 $a_tpl->setVariable(
"LINK_".$up_var,
1701 $ilCtrl->getLinkTargetByClass(
"ilnotegui", $a_cmd, $a_anchor));
1704 $a_tpl->setCurrentBlock($low_var);
1705 $a_tpl->setVariable(
"TXT_".$up_var, $a_txt);
1706 $a_tpl->parseCurrentBlock();
1716 $this->observer[] = $a_callback;
1727 if(
sizeof($this->observer))
1729 foreach($this->observer as $item)
1731 $param = $a_note->getObject();
1732 $param[
"action"] = $a_action;
1733 $param[
"note_id"] = $a_note->getId();
1735 call_user_func_array($item, $param);
1743 return $this->getNotesHtml();
1749 return $this->getNotesHtml();
static _lookupLogin($a_user_id)
lookup login
checkDeletion($a_note)
Check whether deletion is allowed.
getOnlyCommentsHTML()
Get only comments html.
static _lookupTitle($a_obj_id)
Lookup Title.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
getNotesHTML($a_init_form=true)
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
enableCommentsSettings($a_enable=true)
enable private notes
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
getNoteListHTML($a_type=IL_NOTE_PRIVATE, $a_init_form=true)
get notes/comments list as html code
getListCommentsJSCall($a_hash, $a_update_code=null)
Get list comments js call.
initNoteForm($a_mode="edit", $a_type, $a_note=null)
Init note form.
setRepositoryMode($a_value)
Set repository mode.
_lookupOwner($a_id)
lookup object owner
enableMultiSelection($a_enable=true)
enable multi selection (checkboxes and commands)
enableAnchorJump($a_enable=true)
enable anchor for form jump
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
getPDNoteHTML($note_id)
Note display for personal desktop.
getOnlyNotesHTML()
Get only notes html.
static get($a_glyph, $a_text="")
Get glyph html.
Access handler for personal workspace.
renderLink($a_tpl, $a_var, $a_txt, $a_cmd, $a_anchor="")
Render a link.
static setUseRelativeDates($a_status)
set use relative dates
static _lookupTitle($a_id)
lookup object title
deactivateComments()
Deactivate Comments.
checkEdit($a_note)
Check edit.
enablePublicNotes($a_enable=true)
enable public notes
editNoteForm($a_init_form=true)
get notes list including add note area
activateComments()
Activate Comments.
enableTargets($a_enable=true)
enable target objects
static _getAllReferences($a_id)
get all reference ids of object
Tree handler for personal workspace.
_getNotesOfObject($a_rep_obj_id, $a_obj_id, $a_obj_type, $a_type=IL_NOTE_PRIVATE, $a_incl_sub=false, $a_filter="", $a_all_public="y", $a_repository_mode=true, $a_sort_ascending=false)
get all notes related to a specific object
static useRelativeDates()
check if relative dates are used
static initJS()
Init javascript.
getSubObjectTitle($parent_obj_id, $sub_obj_id)
Get sub object title if available with callback.
exportNotesHTML()
export selected notes to html
static getNamePresentation($a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false)
Default behaviour is:
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
deleteNote()
delete note confirmation
static _lookupTitle($a_obj_id)
Overwitten from base class.
static getGotoLink($a_node_id, $a_obj_id, $a_additional=null)
enableHiding($a_enable=true)
enable hiding
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
initJavascript($a_ajax_url, $a_type=IL_NOTE_PRIVATE)
Init javascript.
showAllPublicNotes()
show all public notes to user
addObserver($a_callback)
Add observer.
cancelUpdateNote()
cancel edit note
static formatDate(ilDateTime $date)
Format a date public.
ilNoteGUI($a_rep_obj_id="", $a_obj_id="", $a_obj_type="", $a_include_subobjects=false)
constructor, specifies notes set
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static _lookupType($a_id, $a_reference=false)
lookup object type
cancelDelete()
cancel deletion of note
notifyObserver($a_action, $a_note)
Notify observers on update/create.
static initPanel($a_resize=false)
Init yui panel.
showMyPublicNotes()
show only public notes of user
printNotes()
notes print view screen
showTargets(&$tpl, $a_rep_obj_id, $a_note_id, $a_obj_type, $a_obj_id)
show related objects as links
static commentsActivated($a_rep_obj_id, $a_obj_id, $a_obj_type)
Are comments activated for object?
enablePublicNotesDeletion($a_enable=true)
enable public notes
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
confirmDelete()
cancel deletion of note
static activateComments($a_rep_obj_id, $a_obj_id, $a_obj_type, $a_activate=true)
Activate notes feature.
This class represents a text area property in a property form.
static _getPersonalPicturePath($a_usr_id, $a_size="small", $a_force_pic=false, $a_prevent_no_photo_image=false)
Get path to personal picture.
static initjQuery($a_tpl=null)
Init jQuery.
addNoteForm($a_init_form=true)
get notes list including add note area
enablePrivateNotes($a_enable=true)
enable private notes
static buildAjaxHash($a_node_type, $a_node_id, $a_sub_id, $a_sub_type)
Combine properties to hash.
deleteNotes()
delete notes confirmation
cancelAddNote()
cancel add note
static _lookupTargetId($a_obj_id)
lookup target id
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
getListNotesJSCall($a_hash, $a_update_code=null)
Get list notes js call.
& executeCommand()
execute command