6 include_once (
"Services/Notes/classes/class.ilNote.php");
32 function __construct($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)
457 include_once
"Services/ContainerReference/classes/class.ilContainerReference.php";
474 $title .=
" - ".$sub_title;
478 $tpl->setCurrentBlock(
"title");
480 $tpl->parseCurrentBlock();
483 if ($this->delete_note)
489 $tpl->setVariable(
"TXT_NOTES", $lng->txt(
"private_notes").$cnt_str);
490 $ilCtrl->setParameterByClass(
"ilnotegui",
"note_type",
IL_NOTE_PRIVATE);
494 $tpl->setVariable(
"TXT_NOTES", $lng->txt(
"notes_public_comments").$cnt_str);
495 $ilCtrl->setParameterByClass(
"ilnotegui",
"note_type",
IL_NOTE_PUBLIC);
497 $anch = $this->anchor_jump
500 $tpl->setVariable(
"FORMACTION", $ilCtrl->getFormAction($this,
"getNotesHTML", $anch));
503 $os =
"onsubmit = \"ilNotes.cmdAjaxForm(event, '".
504 $ilCtrl->getFormActionByClass(
"ilnotegui",
"",
"",
true).
505 "'); return false;\"";
506 $tpl->setVariable(
"ON_SUBMIT_FORM", $os);
507 $tpl->setVariable(
"FORM_ID",
"Ajax");
510 if ($this->export_html || $this->print)
512 $tpl->touchBlock(
"print_style");
516 if (!$this->add_note_form && !$this->edit_note_form && !$this->delete_note &&
517 !$this->export_html && !$this->print && $ilUser->getId() != ANONYMOUS_USER_ID)
523 $tpl->setCurrentBlock(
"add_note_btn");
526 $tpl->setVariable(
"TXT_ADD_NOTE", $lng->txt(
"notes_add_comment"));
530 $tpl->setVariable(
"TXT_ADD_NOTE", $lng->txt(
"add_note"));
532 $tpl->setVariable(
"LINK_ADD_NOTE", $ilCtrl->getLinkTargetByClass(
"ilnotegui",
"addNoteForm").
534 $tpl->parseCurrentBlock();
540 if (count($all_notes) > 0 && $this->enable_hiding && !$this->delete_note
541 && !$this->export_html && !$this->print && !$this->edit_note_form
542 && !$this->add_note_form)
544 if ($user_setting_notes_by_type ==
"n")
548 $txt = $lng->txt(
"notes_show_comments");
552 $txt = $lng->txt(
"show_".$suffix.
"_notes");
559 if (($ilUser->getId() != ANONYMOUS_USER_ID))
563 $txt = $lng->txt(
"notes_hide_comments");
567 $txt = $lng->txt(
"hide_".$suffix.
"_notes");
574 if ($user_setting_notes_public_all ==
"n")
576 $this->
renderLink(
$tpl,
"all_pub_notes", $lng->txt(
"notes_all_comments"),
577 "showAllPublicNotes",
"notes_top");
581 $this->
renderLink(
$tpl,
"my_pub_notes", $lng->txt(
"notes_my_comments"),
582 "showMyPublicNotes",
"notes_top");
590 if (!$this->edit_note_form && $user_setting_notes_by_type !=
"n" &&
591 !$this->delete_note && $ilUser->getId() != ANONYMOUS_USER_ID)
598 $tpl->setCurrentBlock(
"edit_note_form");
600 $tpl->setVariable(
"EDIT_FORM", $this->form_tpl->get());
601 $tpl->parseCurrentBlock();
603 $tpl->parseCurrentBlock();
604 $tpl->setCurrentBlock(
"note_row");
605 $tpl->parseCurrentBlock();
609 if ($user_setting_notes_by_type !=
"n" || !$this->enable_hiding)
616 if((
int)$_SESSION[
"comments_sort_asc"] == 1)
618 $sort_txt = $lng->txt(
"notes_sort_desc");
619 $sort_cmd =
"listSortDesc";
623 $sort_txt = $lng->txt(
"notes_sort_asc");
624 $sort_cmd =
"listSortAsc";
626 $this->
renderLink(
$tpl,
"sort_list", $sort_txt, $sort_cmd, $anch);
629 $notes_given =
false;
630 foreach($notes as $note)
632 if ($this->edit_note_form && ($note->getId() ==
$_GET[
"note_id"])
639 $tpl->setCurrentBlock(
"edit_note_form");
641 $tpl->setVariable(
"EDIT_FORM", $this->form_tpl->get());
642 $tpl->parseCurrentBlock();
650 && !$this->delete_note
651 && !$this->export_html && !$this->print
652 && !$this->edit_note_form && !$this->add_note_form)
654 $ilCtrl->setParameterByClass(
"ilnotegui",
"note_id", $note->getId());
656 "deleteNote",
"note_".$note->getId());
660 if ($this->multi_selection && !$this->delete_note)
662 $tpl->setCurrentBlock(
"checkbox_col");
663 $tpl->setVariable(
"CHK_NOTE",
"note[]");
664 $tpl->setVariable(
"CHK_NOTE_ID", $note->getId());
665 $tpl->parseCurrentBlock();
673 if (!$this->delete_note && !$this->export_html && !$this->print
674 && !$this->edit_note_form && !$this->add_note_form)
676 $ilCtrl->setParameterByClass(
"ilnotegui",
"note_id", $note->getId());
678 "editNoteForm",
"note_edit");
682 $tpl->setVariable(
"CNT_COL", $cnt_col);
690 $tpl->setCurrentBlock(
"user_img");
691 $tpl->setVariable(
"USR_IMG",
693 $tpl->setVariable(
"USR_ALT", $lng->txt(
"user_image").
": ".
695 $tpl->parseCurrentBlock();
696 $tpl->setVariable(
"TXT_USR",
701 if ($note->getUpdateDate() != null)
703 $tpl->setVariable(
"TXT_LAST_EDIT", $lng->txt(
"last_edited_on"));
704 $tpl->setVariable(
"DATE_LAST_EDIT",
709 $tpl->setVariable(
"VAL_DATE",
714 if ($this->delete_note)
716 $tpl->setCurrentBlock(
"delete_ids");
717 $tpl->setVariable(
"HID_NOTE",
"note[]");
718 $tpl->setVariable(
"HID_NOTE_ID", $note->getId());
719 $tpl->parseCurrentBlock();
727 $rowclass = ($rowclass !=
"tblrow1")
730 if (!$this->export_html && !$this->print)
732 $tpl->setCurrentBlock(
"note_img");
735 $tpl->setVariable(
"IMG_NOTE", $this->comment_img[$note->getLabel()][
"img"]);
736 $tpl->setVariable(
"ALT_NOTE", $this->comment_img[$note->getLabel()][
"alt"]);
740 $tpl->setVariable(
"IMG_NOTE", $this->note_img[$note->getLabel()][
"img"]);
741 $tpl->setVariable(
"ALT_NOTE", $this->note_img[$note->getLabel()][
"alt"]);
743 $tpl->parseCurrentBlock();
747 switch ($note->getLabel())
750 $tpl->setVariable(
"EXP_ICON",
"[ ]");
754 $tpl->setVariable(
"EXP_ICON",
"[!]");
758 $tpl->setVariable(
"EXP_ICON",
"[?]");
762 $tpl->setVariable(
"EXP_ICON",
"[+]");
766 $tpl->setVariable(
"EXP_ICON",
"[-]");
770 $tpl->setCurrentBlock(
"note");
771 $tpl->setVariable(
"ROWCLASS", $rowclass);
772 $text = (trim($note->getText()) !=
"")
773 ? nl2br($note->getText())
774 :
"<p class='subtitle'>".$lng->txt(
"note_content_removed").
"</p>";
776 $tpl->setVariable(
"VAL_SUBJECT", $note->getSubject());
777 $tpl->setVariable(
"NOTE_ID", $note->getId());
781 $tpl->parseCurrentBlock();
783 $tpl->setCurrentBlock(
"note_row");
784 $tpl->parseCurrentBlock();
790 $tpl->setCurrentBlock(
"no_notes");
793 $tpl->setVariable(
"NO_NOTES", $lng->txt(
"notes_no_comments"));
799 $tpl->parseCurrentBlock();
805 if ($this->multi_selection && !$this->delete_note && !$this->edit_note_form
806 && count($notes) > 0)
810 $tpl->setCurrentBlock(
"delete_cmd");
811 $tpl->setVariable(
"TXT_DELETE_NOTES", $this->lng->txt(
"delete"));
812 $tpl->parseCurrentBlock();
815 $tpl->setCurrentBlock(
"multiple_commands");
816 $tpl->setVariable(
"TXT_SELECT_ALL", $this->lng->txt(
"select_all"));
818 $tpl->setVariable(
"ALT_ARROW", $this->lng->txt(
"actions"));
819 $tpl->setVariable(
"TXT_PRINT_NOTES", $this->lng->txt(
"print"));
820 $tpl->setVariable(
"TXT_EXPORT_NOTES", $this->lng->txt(
"exp_html"));
821 $tpl->parseCurrentBlock();
825 if ($this->delete_note)
827 $tpl->setCurrentBlock(
"delete_cancel");
828 $tpl->setVariable(
"TXT_DEL_NOTES", $this->lng->txt(
"delete"));
829 $tpl->setVariable(
"TXT_CANCEL_DEL_NOTES", $this->lng->txt(
"cancel"));
830 $tpl->parseCurrentBlock();
836 $tpl->touchBlock(
"print_js");
837 $tpl->setCurrentBlock(
"print_back");
838 $tpl->setVariable(
"LINK_BACK", $this->ctrl->getLinkTarget($this,
"showNotes"));
839 $tpl->setVariable(
"TXT_BACK", $this->lng->txt(
"back"));
840 $tpl->parseCurrentBlock();
845 switch(
$_GET[
"note_mess"] !=
"" ?
$_GET[
"note_mess"] : $this->note_mess)
849 $mtxt = $lng->txt(
"msg_obj_modified");
855 ? $lng->txt(
"notes_notes_deleted")
856 : $lng->txt(
"notes_comments_deleted");
862 ? $lng->txt(
"notes_note_deleted")
863 : $lng->txt(
"notes_comment_deleted");
868 $mtxt = $lng->txt(
"form_input_not_valid");
873 $mtxt = $lng->txt(
"info_delete_sure");
878 $mtxt = $lng->txt(
"no_checkbox");
883 $tpl->setVariable(
"MESS",
$tpl->getMessageHTML($mtxt, $mtype));
887 $tpl->setVariable(
"MESS",
"");
892 if ($this->delete_note && count($notes) == 0)
911 global $objDefinition,
$ilCtrl;
914 $parent_class =
"ilObj".$objDefinition->getClassName($parent_type).
"GUI";
915 $parent_path = $ilCtrl->lookupClassPath($parent_class);
916 include_once $parent_path;
917 if(method_exists($parent_class,
"lookupSubObjectTitle"))
919 return call_user_func_array(
array($parent_class,
"lookupSubObjectTitle"),
array($parent_obj_id, $sub_obj_id));
930 if ($ilUser->getId() == ANONYMOUS_USER_ID)
935 $is_author = ($a_note->getAuthor() == $ilUser->getId());
947 if ($a_note->getType() ==
IL_NOTE_PUBLIC && $is_author && $ilSetting->get(
"comments_del_user", 0))
962 if ($a_note->getAuthor() == $ilUser->getId()
963 && ($ilUser->getId() != ANONYMOUS_USER_ID))
980 $this->form_tpl =
new ilTemplate(
"tpl.notes_edit.html",
true,
true,
"Services/Notes");
984 $this->form_tpl->setVariable(
"NOTE_ID", $a_note->getId());
987 if ($a_mode ==
"create")
990 ? $lng->txt(
"note_add_comment")
991 : $lng->txt(
"note_add_note"));
992 $this->form_tpl->setVariable(
"CMD",
"addNote");
997 ? $lng->txt(
"note_update_comment")
998 : $lng->txt(
"note_update_note"));
999 $this->form_tpl->setVariable(
"CMD",
"updateNote");
1003 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1005 $this->form->setOpenTag(
false);
1006 $this->form->setCloseTag(
false);
1007 $this->form->setDisableStandardMessage(
true);
1029 $ta->setValue($a_note->getText());
1031 $this->form->addItem($ta);
1053 $hi->setValue(
$_GET[
"note_id"]);
1054 $this->form->addItem($hi);
1058 if ($a_mode ==
"create")
1060 $this->form->addCommandButton(
"addNote", $lng->txt(
"save"));
1068 $this->form->addCommandButton(
"updateNote", $lng->txt(
"save"));
1075 $ilCtrl->setParameter($this,
"note_type",
$a_type);
1076 $this->form->setFormAction($this->ctrl->getFormAction($this));
1087 $tpl =
new ilTemplate(
"tpl.pd_note.html",
true,
true,
"Services/Notes");
1088 $note =
new ilNote($note_id);
1091 if ($note->getAuthor() != $ilUser->getId())
1096 $tpl->setCurrentBlock(
"edit_note");
1097 $ilCtrl->setParameterByClass(
"ilnotegui",
"rel_obj",
$target[
"rep_obj_id"]);
1098 $ilCtrl->setParameterByClass(
"ilnotegui",
"note_id", $note_id);
1099 $ilCtrl->setParameterByClass(
"ilnotegui",
"note_type", $note->getType());
1100 $tpl->setVariable(
"LINK_EDIT_NOTE",
1101 $ilCtrl->getLinkTargetByClass(
array(
"ilpersonaldesktopgui",
"ilpdnotesgui",
"ilnotegui"),
1103 $tpl->setVariable(
"TXT_EDIT_NOTE", $lng->txt(
"edit"));
1104 $tpl->parseCurrentBlock();
1105 $ilCtrl->clearParametersByClass(
"ilnotegui");
1107 $tpl->setCurrentBlock(
"note_img");
1108 $tpl->setVariable(
"IMG_NOTE", $this->note_img[$note->getLabel()][
"img"]);
1109 $tpl->setVariable(
"ALT_NOTE", $this->note_img[$note->getLabel()][
"alt"]);
1110 $tpl->parseCurrentBlock();
1113 if ($note->getUpdateDate() != null)
1115 $tpl->setVariable(
"TXT_LAST_EDIT", $lng->txt(
"last_edited_on"));
1116 $tpl->setVariable(
"DATE_LAST_EDIT",
1122 $tpl->setVariable(
"VAL_DATE",
1126 $tpl->setVariable(
"VAL_SUBJECT", $note->getSubject());
1127 $text = (trim($note->getText()) !=
"")
1128 ? nl2br($note->getText())
1129 :
"<p class='subtitle'>".$lng->txt(
"note_content_removed").
"</p>";
1140 global $tree, $ilAccess, $objDefinition,
$ilUser;
1142 if ($this->targets_enabled)
1144 if ($a_rep_obj_id > 0)
1152 $vis_ref_ids =
array();
1155 if ($ilAccess->checkAccess(
"visible",
"", $ref_id))
1162 if (count($vis_ref_ids) > 0)
1164 foreach($vis_ref_ids as $vis_ref_id)
1167 $sub_link = $sub_title =
"";
1168 if ($type ==
"sahs")
1170 $link =
"goto.php?target=sahs_".$vis_ref_id;
1172 if ($a_obj_type ==
"sco" || $a_obj_type ==
"seqc" || $a_obj_type ==
"chap" || $a_obj_type ==
"pg")
1174 $sub_link =
"goto.php?target=sahs_".$vis_ref_id.
"_".$a_obj_id;
1175 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004Node.php");
1180 else if ($type ==
"poll")
1182 include_once
"Services/Link/classes/class.ilLink.php";
1186 else if ($a_obj_type !=
"pg")
1188 if (!is_object($this->item_list_gui[$type]))
1190 $class = $objDefinition->getClassName($type);
1191 $location = $objDefinition->getLocation($type);
1192 $full_class =
"ilObj".$class.
"ListGUI";
1193 include_once(
$location.
"/class.".$full_class.
".php");
1194 $this->item_list_gui[$type] =
new $full_class();
1199 if($a_obj_type ==
"crsr" || $a_obj_type ==
"catr" || $a_obj_type ==
"grpr")
1201 include_once
"Services/ContainerReference/classes/class.ilContainerReference.php";
1209 $this->item_list_gui[$type]->initItem($vis_ref_id, $a_rep_obj_id,
$title);
1210 $link = $this->item_list_gui[$type]->getCommandLink(
"infoScreen");
1215 $link = $this->item_list_gui[$type]->appendRepositoryFrameParameter($link).
"#note_".$a_note_id;
1220 $link =
"goto.php?target=pg_".$a_obj_id.
"_".$vis_ref_id;
1223 $par_id = $tree->getParentId($vis_ref_id);
1226 if ($sub_link !=
"")
1228 if ($this->export_html || $this->print)
1230 $tpl->setCurrentBlock(
"exp_target_sub_object");
1234 $tpl->setCurrentBlock(
"target_sub_object");
1235 $tpl->setVariable(
"LINK_SUB_TARGET", $sub_link);
1237 $tpl->setVariable(
"TXT_SUB_TARGET", $sub_title);
1238 $tpl->setVariable(
"IMG_SUB_TARGET", $sub_icon);
1239 $tpl->parseCurrentBlock();
1243 if ($this->export_html || $this->print)
1245 $tpl->setCurrentBlock(
"exp_target_object");
1249 $tpl->setCurrentBlock(
"target_object");
1250 $tpl->setVariable(
"LINK_TARGET", $link);
1252 $tpl->setVariable(
"TXT_CONTAINER",
1255 $tpl->setVariable(
"IMG_CONTAINER",
1259 $tpl->setVariable(
"IMG_TARGET",
1262 $tpl->parseCurrentBlock();
1264 $tpl->touchBlock(
"target_objects");
1271 if(!$this->wsp_tree)
1273 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
1274 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
1278 $node_id = $this->wsp_tree->lookupNodeId($a_rep_obj_id);
1279 if($this->wsp_access_handler->checkAccess(
"visible",
"", $node_id))
1281 $path = $this->wsp_tree->getPathFull($node_id);
1284 $item = array_pop(
$path);
1285 $parent = array_pop(
$path);
1287 if(!$parent[
"title"])
1289 $parent[
"title"] = $this->lng->txt(
"wsp_personal_workspace");
1299 $item[
"title"] .=
" (".$sub_title.
")";
1310 $parent[
"title"] = $this->lng->txt(
"wsp_tab_shared").
1311 " (".ilObject::_lookupOwnerName($owner).
")";
1313 $link =
"ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&dsh=".
1318 if ($this->export_html || $this->print)
1320 $tpl->setCurrentBlock(
"exp_target_object");
1324 $tpl->setCurrentBlock(
"target_object");
1325 $tpl->setVariable(
"LINK_TARGET", $link);
1331 $tpl->setVariable(
"TXT_CONTAINER", $parent[
"title"]);
1332 $tpl->setVariable(
"IMG_CONTAINER",
1335 $tpl->setVariable(
"TXT_TARGET", $item[
"title"]);
1336 $tpl->setVariable(
"IMG_TARGET",
1339 $tpl->parseCurrentBlock();
1356 $ilUser->setPref(
"notes_".$suffix,
"y");
1358 $this->add_note_form =
true;
1388 if (
$_POST[
"note"] !=
"")
1391 $note->setObject($this->obj_type, $this->rep_obj_id, $this->obj_id);
1392 $note->setInRepository($this->repository_mode);
1393 $note->setType(
$_GET[
"note_type"]);
1394 $note->setAuthor($ilUser->getId());
1395 $note->setText(ilUtil::stripslashes(
$_POST[
"note"]));
1402 $ilCtrl->setParameter($this,
"note_mess",
"mod");
1405 $ilCtrl->redirect($this,
"showNotes",
"notes_top", $this->ajax);
1434 $ilCtrl->setParameter($this,
"note_mess",
"mod");
1436 $ilCtrl->redirect($this,
"showNotes",
"notes_top", $this->ajax);
1438 $ilCtrl->redirect($this,
"showNotes",
"notes_top", $this->ajax);
1439 $this->note_mess =
"frmfld";
1440 $this->form->setValuesByPost();
1441 $_GET[
"note_id"] = $note->getId();
1442 $_GET[
"note_type"] = $note->getType();
1451 $this->edit_note_form =
true;
1461 $this->delete_note =
true;
1462 $this->note_mess =
"qdel";
1475 $this->note_mess =
"noc";
1479 $this->delete_note =
true;
1480 $this->note_mess =
"qdel";
1502 foreach(
$_POST[
"note"] as $id)
1513 $ilCtrl->setParameter($this,
"note_mess",
"ntsdel");
1517 $ilCtrl->setParameter($this,
"note_mess",
"ntdel");
1519 $ilCtrl->redirect($this,
"showNotes",
"notes_top", $this->ajax);
1529 $this->export_html =
true;
1530 $this->multi_selection =
false;
1542 $this->print =
true;
1543 $this->multi_selection =
false;
1558 $ilUser->writePref(
"notes_".$suffix,
"y");
1573 $ilUser->writePref(
"notes_".$suffix,
"n");
1585 $ilUser->writePref(
"notes_pub_all",
"y");
1597 $ilUser->writePref(
"notes_pub_all",
"n");
1609 $lng->loadLanguageModule(
"notes");
1611 include_once(
"./Services/UIComponent/Modal/classes/class.ilModalGUI.php");
1614 $lng->toJs(
array(
"private_notes",
"notes_public_comments"));
1616 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
1618 include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
1620 $tpl->addJavascript(
"./Services/Notes/js/ilNotes.js");
1622 $tpl->addOnLoadCode(
"ilNotes.setAjaxUrl('".$a_ajax_url.
"');");
1634 if ($a_update_code === null)
1636 $a_update_code =
"null";
1640 $a_update_code =
"'".$a_update_code.
"'";
1643 return "ilNotes.listNotes(event, '".$a_hash.
"', ".$a_update_code.
");";
1655 if ($a_update_code === null)
1657 $a_update_code =
"null";
1661 $a_update_code =
"'".$a_update_code.
"'";
1664 return "ilNotes.listComments(event, '".$a_hash.
"', ".$a_update_code.
");";
1676 protected static function buildAjaxHash($a_node_type, $a_node_id, $a_sub_id, $a_sub_type)
1678 return $a_node_type.
";".$a_node_id.
";".$a_sub_id.
";".$a_sub_type;
1684 function renderLink($a_tpl, $a_var, $a_txt, $a_cmd, $a_anchor =
"")
1688 $low_var = strtolower($a_var);
1689 $up_var = strtoupper($a_var);
1693 $a_tpl->setVariable(
"LINK_".$up_var,
"#");
1694 $oc =
"onclick = \"ilNotes.cmdAjaxLink(event, '".
1695 $ilCtrl->getLinkTargetByClass(
"ilnotegui", $a_cmd,
"",
true).
1697 $a_tpl->setVariable(
"ON_CLICK_".$up_var, $oc);
1701 $a_tpl->setVariable(
"LINK_".$up_var,
1702 $ilCtrl->getLinkTargetByClass(
"ilnotegui", $a_cmd, $a_anchor));
1705 $a_tpl->setCurrentBlock($low_var);
1706 $a_tpl->setVariable(
"TXT_".$up_var, $a_txt);
1707 $a_tpl->parseCurrentBlock();
1717 $this->observer[] = $a_callback;
1728 if(
sizeof($this->observer))
1730 foreach($this->observer as $item)
1732 $param = $a_note->getObject();
1733 $param[
"action"] = $a_action;
1734 $param[
"note_id"] = $a_note->getId();
1736 call_user_func_array($item, $param);
1744 return $this->getNotesHtml();
1750 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
initNoteForm($a_mode="edit", $a_type, $a_note=null)
Init note form.
setRepositoryMode($a_value)
Set repository mode.
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.
executeCommand()
execute command
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
static getListNotesJSCall($a_hash, $a_update_code=null)
Get list notes js call.
Tree handler for personal workspace.
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 initJavascript($a_ajax_url, $a_type=IL_NOTE_PRIVATE)
Init javascript.
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
showAllPublicNotes()
show all public notes to user
addObserver($a_callback)
Add observer.
cancelUpdateNote()
cancel edit note
static formatDate(ilDateTime $date)
Format a date public.
static _lookupOwner($a_id)
lookup object owner
static _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 stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
cancelDelete()
cancel deletion of note
static getListCommentsJSCall($a_hash, $a_update_code=null)
Get list comments js call.
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.
__construct($a_rep_obj_id="", $a_obj_id="", $a_obj_type="", $a_include_subobjects=false)
constructor, specifies notes set
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="")