6include_once(
"Services/Notes/classes/class.ilNote.php");
 
   66    public function __construct($a_rep_obj_id = 
"", $a_obj_id = 
"", $a_obj_type = 
"", $a_include_subobjects = 
false)
 
   70        $this->
user = $DIC->user();
 
   72        $this->obj_definition = 
$DIC[
"objDefinition"];
 
   73        $this->tree = 
$DIC->repositoryTree();
 
   74        $this->access = 
$DIC->access();
 
   78        $lng->loadLanguageModule(
"notes");
 
   80        $ilCtrl->saveParameter($this, 
"notes_only");
 
   81        $this->only = 
$_GET[
"notes_only"];
 
   83        $this->rep_obj_id = $a_rep_obj_id;
 
   84        $this->obj_id = $a_obj_id;
 
   85        $this->obj_type = $a_obj_type;
 
   86        $this->inc_sub = $a_include_subobjects;
 
   89        if (!$this->obj_type && $a_rep_obj_id) {
 
   93        $this->ajax = 
$ilCtrl->isAsynch();
 
   98        $this->anchor_jump = 
true;
 
   99        $this->add_note_form = 
false;
 
  100        $this->edit_note_form = 
false;
 
  101        $this->private_enabled = 
false;
 
  102        $notes_settings = 
new ilSetting(
"notes");
 
  103        $id = $this->rep_obj_id . 
"_" . $this->obj_id . 
"_" . $this->obj_type;
 
  106            $this->public_enabled = 
true;
 
  108            $this->public_enabled = 
false;
 
  110        $this->enable_hiding = 
false;
 
  111        $this->targets_enabled = 
false;
 
  112        $this->multi_selection = 
false;
 
  113        $this->export_html = 
false;
 
  114        $this->
print = 
false;
 
  115        $this->comments_settings = 
false;
 
  117        $this->note_img = array(
 
  120                "alt" => 
$lng->txt(
"note")),
 
  123                "alt" => 
$lng->txt(
"note") . 
", " . 
$lng->txt(
"important")),
 
  126                "alt" => 
$lng->txt(
"note") . 
", " . 
$lng->txt(
"question")),
 
  129                "alt" => 
$lng->txt(
"note") . 
", " . 
$lng->txt(
"pro")),
 
  132                "alt" => 
$lng->txt(
"note") . 
", " . 
$lng->txt(
"contra"))
 
  135        $this->comment_img = array(
 
  138                "alt" => 
$lng->txt(
"notes_comment")),
 
  141                "alt" => 
$lng->txt(
"notes_comment") . 
", " . 
$lng->txt(
"important")),
 
  144                "alt" => 
$lng->txt(
"notes_comment") . 
", " . 
$lng->txt(
"question")),
 
  147                "alt" => 
$lng->txt(
"notes_comment") . 
", " . 
$lng->txt(
"pro")),
 
  150                "alt" => 
$lng->txt(
"notes_comment") . 
", " . 
$lng->txt(
"contra"))
 
  162        $cmd = $this->ctrl->getCmd(
"getNotesHTML");
 
  163        $next_class = $this->ctrl->getNextClass($this);
 
  165        switch ($next_class) {
 
  167                return $this->$cmd();
 
  177        $this->private_enabled = $a_enable;
 
  185        $this->public_enabled =  $a_enable;
 
  193        $this->comments_settings = $a_enable;
 
  201        $this->public_deletion_enabled =  $a_enable;
 
  209        $this->enable_hiding = $a_enable;
 
  217        $this->targets_enabled = $a_enable;
 
  225        $this->multi_selection = $a_enable;
 
  233        $this->anchor_jump = $a_enable;
 
  243        $this->repository_mode = (bool) $a_value;
 
  256        $ilCtrl->setParameter($this, 
"notes_only", 
"notes");
 
  257        $this->only = 
"notes";
 
  270        $ilCtrl->setParameter($this, 
"notes_only", 
"comments");
 
  271        $this->only = 
"comments";
 
  286        $lng->loadLanguageModule(
"notes");
 
  289            "tpl.notes_and_comments.html",
 
  296        $hide_comments = ($this->only == 
"notes");
 
  297        $hide_notes = ($this->only == 
"comments");
 
  304                    $hide_comments = 
true;
 
  314        if ($this->private_enabled && $this->public_enabled
 
  315    && $this->only != 
"notes") {
 
  316            $this->private_enabled = 
false;
 
  320        if ($this->private_enabled && (
$ilUser->getId() != ANONYMOUS_USER_ID)
 
  322            $ntpl->setCurrentBlock(
"notes_col");
 
  324            $ntpl->parseCurrentBlock();
 
  329        $comments_col = 
false;
 
  330        if ($this->public_enabled && (!$this->delete_note || $this->public_deletion_enabled || 
$ilSetting->get(
"comments_del_user", 0))
 
  331            && !$hide_comments ) {
 
  333            $comments_col = 
true;
 
  337        if ($this->comments_settings && !$hide_comments && !$this->delete_note
 
  338            && !$this->edit_note_form && !$this->add_note_form && 
$ilUser->getId() != ANONYMOUS_USER_ID) {
 
  339            $notes_settings = 
new ilSetting(
"notes");
 
  340            $id = $this->rep_obj_id . 
"_" . $this->obj_id . 
"_" . $this->obj_type;
 
  348                    $lng->txt(
"notes_deactivate_comments"),
 
  349                    "deactivateComments",
 
  352                $ntpl->setCurrentBlock(
"comments_settings2");
 
  357                    $lng->txt(
"notes_activate_comments"),
 
  361                $ntpl->setCurrentBlock(
"comments_settings2");
 
  363                if ($this->ajax && !$comments_col) {
 
  366                        $ntpl->getMessageHTML(
$lng->txt(
"comments_feature_currently_not_activated_for_object"), 
"info")
 
  370            $ntpl->parseCurrentBlock();
 
  372            if (!$comments_col) {
 
  373                $ntpl->setVariable(
"COMMENTS", 
"");
 
  376            $comments_col = 
true;
 
  380            $ntpl->setCurrentBlock(
"comments_col");
 
  384            $ntpl->parseCurrentBlock();
 
  402        $notes_settings = 
new ilSetting(
"notes");
 
  404        if ($this->comments_settings) {
 
  405            $id = $this->rep_obj_id . 
"_" . $this->obj_id . 
"_" . $this->obj_type;
 
  410        $ilCtrl->redirectByClass(
"ilnotegui", 
"showNotes", 
"", $this->ajax);
 
  421        $notes_settings = 
new ilSetting(
"notes");
 
  423        if ($this->comments_settings) {
 
  424            $id = $this->rep_obj_id . 
"_" . $this->obj_id . 
"_" . $this->obj_type;
 
  429        $ilCtrl->redirectByClass(
"ilnotegui", 
"showNotes", 
"", $this->ajax);
 
  442        include_once(
"./Services/User/classes/class.ilUserUtil.php");
 
  452        $user_setting_notes_public_all = 
"y";
 
  453        $user_setting_notes_by_type = 
"y";
 
  455        if ($this->delete_note || $this->export_html || $this->
print) {
 
  456            if (
$_GET[
"note_id"] != 
"") {
 
  457                $filter = 
$_GET[
"note_id"];
 
  470            $user_setting_notes_public_all,
 
  471            $this->repository_mode,
 
  483            $this->repository_mode
 
  486        $tpl = 
new ilTemplate(
"tpl.notes_list.html", 
true, 
true, 
"Services/Notes");
 
  489            include_once(
"./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
 
  490            $tpl->setCurrentBlock(
"close_img");
 
  492            $tpl->parseCurrentBlock();
 
  496        $cnt_str = (count($all_notes) > 0)
 
  497            ? 
" (" . count($all_notes) . 
")" 
  502            switch ($this->obj_type) {
 
  506                    include_once 
"Services/ContainerReference/classes/class.ilContainerReference.php";
 
  521                    $title .= 
" - " . $sub_title;
 
  525            $tpl->setCurrentBlock(
"title");
 
  527            $tpl->parseCurrentBlock();
 
  530        if ($this->delete_note) {
 
  534            $tpl->setVariable(
"TXT_NOTES", 
$lng->txt(
"private_notes") . $cnt_str);
 
  537            $tpl->setVariable(
"TXT_NOTES", 
$lng->txt(
"notes_public_comments") . $cnt_str);
 
  540        $anch = $this->anchor_jump
 
  543        $tpl->setVariable(
"FORMACTION", 
$ilCtrl->getFormAction($this, 
"getNotesHTML", $anch));
 
  545            $os = 
"onsubmit = \"ilNotes.cmdAjaxForm(event, '" .
 
  546                $ilCtrl->getFormActionByClass(
"ilnotegui", 
"", 
"", 
true) .
 
  547                "'); return false;\"";
 
  548            $tpl->setVariable(
"ON_SUBMIT_FORM", $os);
 
  549            $tpl->setVariable(
"FORM_ID", 
"Ajax");
 
  552        if ($this->export_html || $this->
print) {
 
  553            $tpl->touchBlock(
"print_style");
 
  557        if (!$this->add_note_form && !$this->edit_note_form && !$this->delete_note &&
 
  558            !$this->export_html && !$this->
print &&     
$ilUser->getId() != ANONYMOUS_USER_ID) {
 
  559            if (!$this->inc_sub) {      
 
  562                    $tpl->setCurrentBlock(
"add_note_btn");
 
  564                        $tpl->setVariable(
"TXT_ADD_NOTE", 
$lng->txt(
"notes_add_comment"));
 
  566                        $tpl->setVariable(
"TXT_ADD_NOTE", 
$lng->txt(
"add_note"));
 
  568                    $tpl->setVariable(
"LINK_ADD_NOTE", 
$ilCtrl->getLinkTargetByClass(
"ilnotegui", 
"addNoteForm") .
 
  570                    $tpl->parseCurrentBlock();
 
  576        if (count($all_notes) > 0 && $this->enable_hiding && !$this->delete_note
 
  577            && !$this->export_html && !$this->
print && !$this->edit_note_form
 
  578            && !$this->add_note_form) {
 
  579            if ($user_setting_notes_by_type == 
"n") {
 
  581                    $txt = 
$lng->txt(
"notes_show_comments");
 
  583                    $txt = 
$lng->txt(
"show_" . $suffix . 
"_notes");
 
  588                if ((
$ilUser->getId() != ANONYMOUS_USER_ID)) {
 
  590                        $txt = 
$lng->txt(
"notes_hide_comments");
 
  592                        $txt = 
$lng->txt(
"hide_" . $suffix . 
"_notes");
 
  598                        if ($user_setting_notes_public_all == 
"n") {
 
  602                                $lng->txt(
"notes_all_comments"),
 
  603                                "showAllPublicNotes",
 
  610                                $lng->txt(
"notes_my_comments"),
 
  621        if (!$this->edit_note_form && $user_setting_notes_by_type != 
"n" &&
 
  622            !$this->delete_note && 
$ilUser->getId() != ANONYMOUS_USER_ID) {
 
  627            $tpl->setCurrentBlock(
"edit_note_form");
 
  629            $tpl->setVariable(
"EDIT_FORM", $this->form_tpl->get());
 
  630            $tpl->parseCurrentBlock();
 
  632            $tpl->parseCurrentBlock();
 
  633            $tpl->setCurrentBlock(
"note_row");
 
  634            $tpl->parseCurrentBlock();
 
  638        if ($user_setting_notes_by_type != 
"n" || !$this->enable_hiding) {
 
  642            if (
sizeof($notes)) {
 
  643                if ((
int) 
$_SESSION[
"comments_sort_asc"] == 1) {
 
  644                    $sort_txt = 
$lng->txt(
"notes_sort_desc");
 
  645                    $sort_cmd = 
"listSortDesc";
 
  647                    $sort_txt = 
$lng->txt(
"notes_sort_asc");
 
  648                    $sort_cmd = 
"listSortAsc";
 
  650                $this->
renderLink(
$tpl, 
"sort_list", $sort_txt, $sort_cmd, $anch);
 
  653            $notes_given = 
false;
 
  654            foreach ($notes as $note) {
 
  655                if ($this->edit_note_form && ($note->getId() == 
$_GET[
"note_id"])
 
  660                    $tpl->setCurrentBlock(
"edit_note_form");
 
  662                    $tpl->setVariable(
"EDIT_FORM", $this->form_tpl->get());
 
  663                    $tpl->parseCurrentBlock();
 
  669                        && !$this->delete_note
 
  670                        && !$this->export_html && !$this->
print 
  671                        && !$this->edit_note_form && !$this->add_note_form) {
 
  672                        $ilCtrl->setParameterByClass(
"ilnotegui", 
"note_id", $note->getId());
 
  678                            "note_" . $note->getId()
 
  683                    if ($this->multi_selection && !$this->delete_note) {
 
  684                        $tpl->setCurrentBlock(
"checkbox_col");
 
  685                        $tpl->setVariable(
"CHK_NOTE", 
"note[]");
 
  686                        $tpl->setVariable(
"CHK_NOTE_ID", $note->getId());
 
  687                        $tpl->parseCurrentBlock();
 
  693                        if (!$this->delete_note && !$this->export_html && !$this->
print 
  694                            && !$this->edit_note_form && !$this->add_note_form) {
 
  695                            $ilCtrl->setParameterByClass(
"ilnotegui", 
"note_id", $note->getId());
 
  706                    $tpl->setVariable(
"CNT_COL", $cnt_col);
 
  713                        $tpl->setCurrentBlock(
"user_img");
 
  716                            ilObjUser::_getPersonalPicturePath($note->getAuthor(), 
"xxsmall")
 
  718                        $tpl->setVariable(
"USR_ALT", 
$lng->txt(
"user_image") . 
": " .
 
  720                        $tpl->parseCurrentBlock();
 
  728                    if ($note->getUpdateDate() != 
null) {
 
  729                        $tpl->setVariable(
"TXT_LAST_EDIT", 
$lng->txt(
"last_edited_on"));
 
  742                    if ($this->delete_note) {
 
  743                        $tpl->setCurrentBlock(
"delete_ids");
 
  744                        $tpl->setVariable(
"HID_NOTE", 
"note[]");
 
  745                        $tpl->setVariable(
"HID_NOTE_ID", $note->getId());
 
  746                        $tpl->parseCurrentBlock();
 
  759                    $rowclass = ($rowclass != 
"tblrow1")
 
  762                    if (!$this->export_html && !$this->
print) {
 
  763                        $tpl->setCurrentBlock(
"note_img");
 
  765                            $tpl->setVariable(
"IMG_NOTE", $this->comment_img[$note->getLabel()][
"img"]);
 
  766                            $tpl->setVariable(
"ALT_NOTE", $this->comment_img[$note->getLabel()][
"alt"]);
 
  768                            $tpl->setVariable(
"IMG_NOTE", $this->note_img[$note->getLabel()][
"img"]);
 
  769                            $tpl->setVariable(
"ALT_NOTE", $this->note_img[$note->getLabel()][
"alt"]);
 
  771                        $tpl->parseCurrentBlock();
 
  773                        switch ($note->getLabel()) {
 
  775                                $tpl->setVariable(
"EXP_ICON", 
"[ ]");
 
  779                                $tpl->setVariable(
"EXP_ICON", 
"[!]");
 
  783                                $tpl->setVariable(
"EXP_ICON", 
"[?]");
 
  787                                $tpl->setVariable(
"EXP_ICON", 
"[+]");
 
  791                                $tpl->setVariable(
"EXP_ICON", 
"[-]");
 
  795                    $tpl->setCurrentBlock(
"note");
 
  796                    $tpl->setVariable(
"ROWCLASS", $rowclass);
 
  797                    $text = (trim($note->getText()) != 
"")
 
  798                        ? nl2br($note->getText())
 
  799                        : 
"<p class='subtitle'>" . 
$lng->txt(
"note_content_removed") . 
"</p>";
 
  801                    $tpl->setVariable(
"VAL_SUBJECT", $note->getSubject());
 
  802                    $tpl->setVariable(
"NOTE_ID", $note->getId());
 
  806                    $tpl->parseCurrentBlock();
 
  808                $tpl->setCurrentBlock(
"note_row");
 
  809                $tpl->parseCurrentBlock();
 
  814                $tpl->setCurrentBlock(
"no_notes");
 
  816                    $tpl->setVariable(
"NO_NOTES", 
$lng->txt(
"notes_no_comments"));
 
  822                $tpl->parseCurrentBlock();
 
  828            if ($this->multi_selection && !$this->delete_note && !$this->edit_note_form
 
  829                && count($notes) > 0) {
 
  831                    $tpl->setCurrentBlock(
"delete_cmd");
 
  832                    $tpl->setVariable(
"TXT_DELETE_NOTES", $this->lng->txt(
"delete"));
 
  833                    $tpl->parseCurrentBlock();
 
  836                $tpl->setCurrentBlock(
"multiple_commands");
 
  837                $tpl->setVariable(
"TXT_SELECT_ALL", $this->lng->txt(
"select_all"));
 
  839                $tpl->setVariable(
"ALT_ARROW", $this->lng->txt(
"actions"));
 
  840                $tpl->setVariable(
"TXT_PRINT_NOTES", $this->lng->txt(
"print"));
 
  841                $tpl->setVariable(
"TXT_EXPORT_NOTES", $this->lng->txt(
"exp_html"));
 
  842                $tpl->parseCurrentBlock();
 
  846            if ($this->delete_note) {
 
  847                $tpl->setCurrentBlock(
"delete_cancel");
 
  848                $tpl->setVariable(
"TXT_DEL_NOTES", $this->lng->txt(
"delete"));
 
  849                $tpl->setVariable(
"TXT_CANCEL_DEL_NOTES", $this->lng->txt(
"cancel"));
 
  850                $tpl->parseCurrentBlock();
 
  855                $tpl->touchBlock(
"print_js");
 
  856                $tpl->setCurrentBlock(
"print_back");
 
  857                $tpl->setVariable(
"LINK_BACK", $this->ctrl->getLinkTarget($this, 
"showNotes"));
 
  858                $tpl->setVariable(
"TXT_BACK", $this->lng->txt(
"back"));
 
  859                $tpl->parseCurrentBlock();
 
  864        switch (
$_GET[
"note_mess"] != 
"" ? 
$_GET[
"note_mess"] : $this->note_mess) {
 
  867                $mtxt = 
$lng->txt(
"msg_obj_modified");
 
  873                    ? 
$lng->txt(
"notes_notes_deleted")
 
  874                    : 
$lng->txt(
"notes_comments_deleted");
 
  880                    ? 
$lng->txt(
"notes_note_deleted")
 
  881                    : 
$lng->txt(
"notes_comment_deleted");
 
  886                $mtxt = 
$lng->txt(
"form_input_not_valid");
 
  891                $mtxt = 
$lng->txt(
"info_delete_sure");
 
  896                $mtxt = 
$lng->txt(
"no_checkbox");
 
  902            $tpl->setVariable(
"MESS", 
"");
 
  907        if ($this->delete_note && count($notes) == 0) {
 
  927        $parent_class = 
"ilObj" . $objDefinition->getClassName($parent_type) . 
"GUI";
 
  928        $parent_path = 
$ilCtrl->lookupClassPath($parent_class);
 
  929        include_once $parent_path;
 
  930        if (method_exists($parent_class, 
"lookupSubObjectTitle")) {
 
  931            return call_user_func_array(array($parent_class, 
"lookupSubObjectTitle"), array($parent_obj_id, $sub_obj_id));
 
  943        if (
$ilUser->getId() == ANONYMOUS_USER_ID) {
 
  947        $is_author = ($a_note->getAuthor() == 
$ilUser->getId());
 
  971        if ($a_note->getAuthor() == 
$ilUser->getId()
 
  972            && (
$ilUser->getId() != ANONYMOUS_USER_ID)) {
 
  989        $this->form_tpl = 
new ilTemplate(
"tpl.notes_edit.html", 
true, 
true, 
"Services/Notes");
 
  992            $this->form_tpl->setVariable(
"NOTE_ID", $a_note->getId());
 
  995        if ($a_mode == 
"create") {
 
  997                ? 
$lng->txt(
"note_add_comment")
 
  998                : 
$lng->txt(
"note_add_note"));
 
  999            $this->form_tpl->setVariable(
"CMD", 
"addNote");
 
 1002                ? 
$lng->txt(
"note_update_comment")
 
 1003                : 
$lng->txt(
"note_update_note"));
 
 1004            $this->form_tpl->setVariable(
"CMD", 
"updateNote");
 
 1008        include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1010        $this->form->setOpenTag(
false);
 
 1011        $this->form->setCloseTag(
false);
 
 1012        $this->form->setDisableStandardMessage(
true);
 
 1033            $ta->setValue($a_note->getText());
 
 1035        $this->form->addItem($ta);
 
 1056            $hi->setValue(
$_GET[
"note_id"]);
 
 1057            $this->form->addItem($hi);
 
 1061        if ($a_mode == 
"create") {
 
 1062            $this->form->addCommandButton(
"addNote", 
$lng->txt(
"save"));
 
 1068            $this->form->addCommandButton(
"updateNote", 
$lng->txt(
"save"));
 
 1076        $this->form->setFormAction($this->ctrl->getFormAction($this));
 
 1088        $tpl = 
new ilTemplate(
"tpl.pd_note.html", 
true, 
true, 
"Services/Notes");
 
 1089        $note = 
new ilNote($note_id);
 
 1092        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());
 
 1102            $ilCtrl->getLinkTargetByClass(
 
 1103                array(
"ilpersonaldesktopgui", 
"ilpdnotesgui", 
"ilnotegui"),
 
 1107        $tpl->setVariable(
"TXT_EDIT_NOTE", 
$lng->txt(
"edit"));
 
 1108        $tpl->parseCurrentBlock();
 
 1109        $ilCtrl->clearParametersByClass(
"ilnotegui");
 
 1111        $tpl->setCurrentBlock(
"note_img");
 
 1112        $tpl->setVariable(
"IMG_NOTE", $this->note_img[$note->getLabel()][
"img"]);
 
 1113        $tpl->setVariable(
"ALT_NOTE", $this->note_img[$note->getLabel()][
"alt"]);
 
 1114        $tpl->parseCurrentBlock();
 
 1117        if ($note->getUpdateDate() != 
null) {
 
 1118            $tpl->setVariable(
"TXT_LAST_EDIT", 
$lng->txt(
"last_edited_on"));
 
 1131        $tpl->setVariable(
"VAL_SUBJECT", $note->getSubject());
 
 1132        $text = (trim($note->getText()) != 
"")
 
 1133            ? nl2br($note->getText())
 
 1134            : 
"<p class='subtitle'>" . 
$lng->txt(
"note_content_removed") . 
"</p>";
 
 1150        if ($this->targets_enabled) {
 
 1151            if ($a_rep_obj_id > 0) {
 
 1157                    $vis_ref_ids = array();
 
 1158                    foreach ($ref_ids as $ref_id) {
 
 1159                        if ($ilAccess->checkAccess(
"visible", 
"", $ref_id)) {
 
 1160                            $vis_ref_ids[] = $ref_id;
 
 1165                    if (count($vis_ref_ids) > 0) {
 
 1166                        foreach ($vis_ref_ids as $vis_ref_id) {
 
 1168                            $sub_link = $sub_title = 
"";
 
 1169                            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") {
 
 1173                                    $sub_link = 
"goto.php?target=sahs_" . $vis_ref_id . 
"_" . $a_obj_id;
 
 1174                                    include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004Node.php");
 
 1178                            } elseif (
$type == 
"poll") {
 
 1179                                include_once 
"Services/Link/classes/class.ilLink.php";
 
 1182                            } elseif ($a_obj_type != 
"pg") {
 
 1183                                if (!is_object($this->item_list_gui[
$type])) {
 
 1184                                    $class = $objDefinition->getClassName(
$type);
 
 1186                                    $full_class = 
"ilObj" . $class . 
"ListGUI";
 
 1187                                    include_once(
$location . 
"/class." . $full_class . 
".php");
 
 1188                                    $this->item_list_gui[
$type] = 
new $full_class();
 
 1193                                if ($a_obj_type == 
"crsr" || $a_obj_type == 
"catr" ||  $a_obj_type == 
"grpr") {
 
 1194                                    include_once 
"Services/ContainerReference/classes/class.ilContainerReference.php";
 
 1200                                $this->item_list_gui[
$type]->initItem($vis_ref_id, $a_rep_obj_id, 
$title);
 
 1201                                $link = $this->item_list_gui[
$type]->getCommandLink(
"infoScreen");
 
 1206                                $link = $this->item_list_gui[
$type]->appendRepositoryFrameParameter($link) . 
"#note_" . $a_note_id;
 
 1209                                $link = 
"goto.php?target=pg_" . $a_obj_id . 
"_" . $vis_ref_id;
 
 1212                            $par_id = 
$tree->getParentId($vis_ref_id);
 
 1215                            if ($sub_link != 
"") {
 
 1216                                if ($this->export_html || $this->
print) {
 
 1217                                    $tpl->setCurrentBlock(
"exp_target_sub_object");
 
 1219                                    $tpl->setCurrentBlock(
"target_sub_object");
 
 1220                                    $tpl->setVariable(
"LINK_SUB_TARGET", $sub_link);
 
 1222                                $tpl->setVariable(
"TXT_SUB_TARGET", $sub_title);
 
 1223                                $tpl->setVariable(
"IMG_SUB_TARGET", $sub_icon);
 
 1224                                $tpl->parseCurrentBlock();
 
 1228                            if ($this->export_html || $this->
print) {
 
 1229                                $tpl->setCurrentBlock(
"exp_target_object");
 
 1231                                $tpl->setCurrentBlock(
"target_object");
 
 1232                                $tpl->setVariable(
"LINK_TARGET", $link);
 
 1253                            $tpl->parseCurrentBlock();
 
 1255                        $tpl->touchBlock(
"target_objects");
 
 1261                    if (!$this->wsp_tree) {
 
 1262                        include_once 
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
 
 1263                        include_once 
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
 
 1267                    $node_id = $this->wsp_tree->lookupNodeId($a_rep_obj_id);
 
 1268                    if ($this->wsp_access_handler->checkAccess(
"visible", 
"", $node_id)) {
 
 1269                        $path = $this->wsp_tree->getPathFull($node_id);
 
 1271                            $item = array_pop(
$path);
 
 1272                            $parent = array_pop(
$path);
 
 1274                            if (!$parent[
"title"]) {
 
 1275                                $parent[
"title"] = $this->lng->txt(
"wsp_personal_workspace");
 
 1283                                    $item[
"title"] .= 
" (" . $sub_title . 
")";
 
 1293                            $parent[
"title"] = $this->lng->txt(
"wsp_tab_shared") .
 
 1296                            $link = 
"ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&dsh=" .
 
 1301                        if ($this->export_html || $this->
print) {
 
 1302                            $tpl->setCurrentBlock(
"exp_target_object");
 
 1304                            $tpl->setCurrentBlock(
"target_object");
 
 1305                            $tpl->setVariable(
"LINK_TARGET", $link);
 
 1311                        $tpl->setVariable(
"TXT_CONTAINER", $parent[
"title"]);
 
 1317                        $tpl->setVariable(
"TXT_TARGET", $item[
"title"]);
 
 1323                        $tpl->parseCurrentBlock();
 
 1340        $ilUser->setPref(
"notes_" . $suffix, 
"y");
 
 1342        $this->add_note_form = 
true;
 
 1374        if (
$_POST[
"note"] != 
"") {
 
 1376            $note->setObject($this->obj_type, $this->rep_obj_id, $this->obj_id);
 
 1377            $note->setInRepository($this->repository_mode);
 
 1378            $note->setType(
$_GET[
"note_type"]);
 
 1379            $note->setAuthor(
$ilUser->getId());
 
 1380            $note->setText(ilUtil::stripslashes(
$_POST[
"note"]));
 
 1387            $ilCtrl->setParameter($this, 
"note_mess", 
"mod");
 
 1390        $ilCtrl->redirect($this, 
"showNotes", 
"notes_top", $this->ajax);
 
 1423            $ilCtrl->setParameter($this, 
"note_mess", 
"mod");
 
 1425        $ilCtrl->redirect($this, 
"showNotes", 
"notes_top", $this->ajax);
 
 1427        $ilCtrl->redirect($this, 
"showNotes", 
"notes_top", $this->ajax);
 
 1428        $this->note_mess = 
"frmfld";
 
 1429        $this->form->setValuesByPost();
 
 1430        $_GET[
"note_id"] = $note->getId();
 
 1431        $_GET[
"note_type"] = $note->getType();
 
 1440        $this->edit_note_form = 
true;
 
 1450        $this->delete_note = 
true;
 
 1451        $this->note_mess = 
"qdel";
 
 1463            $this->note_mess = 
"noc";
 
 1465            $this->delete_note = 
true;
 
 1466            $this->note_mess = 
"qdel";
 
 1498            $ilCtrl->setParameter($this, 
"note_mess", 
"ntsdel");
 
 1500            $ilCtrl->setParameter($this, 
"note_mess", 
"ntdel");
 
 1502        $ilCtrl->redirect($this, 
"showNotes", 
"notes_top", $this->ajax);
 
 1512        $this->export_html = 
true;
 
 1513        $this->multi_selection = 
false;
 
 1525        $this->
print = 
true;
 
 1526        $this->multi_selection = 
false;
 
 1542        $ilUser->writePref(
"notes_" . $suffix, 
"y");
 
 1557        $ilUser->writePref(
"notes_" . $suffix, 
"n");
 
 1569        $ilUser->writePref(
"notes_pub_all", 
"y");
 
 1581        $ilUser->writePref(
"notes_pub_all", 
"n");
 
 1593        if ($a_main_tpl != 
null) {
 
 1600        $lng->loadLanguageModule(
"notes");
 
 1602        include_once(
"./Services/UIComponent/Modal/classes/class.ilModalGUI.php");
 
 1605        $lng->toJs(array(
"private_notes", 
"notes_public_comments"), 
$tpl);
 
 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) {
 
 1626            $a_update_code = 
"null";
 
 1628            $a_update_code = 
"'" . $a_update_code . 
"'";
 
 1631        return "ilNotes.listNotes(event, '" . $a_hash . 
"', " . $a_update_code . 
");";
 
 1643        if ($a_update_code === 
null) {
 
 1644            $a_update_code = 
"null";
 
 1646            $a_update_code = 
"'" . $a_update_code . 
"'";
 
 1649        return "ilNotes.listComments(event, '" . $a_hash . 
"', " . $a_update_code . 
");";
 
 1661    protected static function buildAjaxHash($a_node_type, $a_node_id, $a_sub_id, $a_sub_type)
 
 1663        return $a_node_type . 
";" . $a_node_id . 
";" . $a_sub_id . 
";" . $a_sub_type;
 
 1669    public function renderLink($a_tpl, $a_var, $a_txt, $a_cmd, $a_anchor = 
"")
 
 1673        $low_var = strtolower($a_var);
 
 1674        $up_var = strtoupper($a_var);
 
 1677            $a_tpl->setVariable(
"LINK_" . $up_var, 
"#");
 
 1678            $oc = 
"onclick = \"ilNotes.cmdAjaxLink(event, '" .
 
 1679                $ilCtrl->getLinkTargetByClass(
"ilnotegui", $a_cmd, 
"", 
true) .
 
 1681            $a_tpl->setVariable(
"ON_CLICK_" . $up_var, $oc);
 
 1683            $a_tpl->setVariable(
 
 1685                $ilCtrl->getLinkTargetByClass(
"ilnotegui", $a_cmd, $a_anchor)
 
 1689        $a_tpl->setCurrentBlock($low_var);
 
 1690        $a_tpl->setVariable(
"TXT_" . $up_var, $a_txt);
 
 1691        $a_tpl->parseCurrentBlock();
 
 1701        $this->observer[] = $a_callback;
 
 1712        if (is_array($this->observer) && count($this->observer) > 0) {
 
 1713            foreach ($this->observer as $item) {
 
 1714                $param = $a_note->getObject();
 
 1715                $param[
"action"] = $a_action;
 
 1716                $param[
"note_id"] = $a_note->getId();
 
 1718                call_user_func_array($item, $param);
 
 1726        return $this->getNotesHtml();
 
 1732        return $this->getNotesHtml();
 
An exception for terminatinating execution or to throw for unit testing.
static _lookupTargetId($a_obj_id)
lookup target id
static _lookupTitle($a_obj_id)
Overwitten from base class.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date @access public.
static setUseRelativeDates($a_status)
set use relative dates
static useRelativeDates()
check if relative dates are used
static get($a_glyph, $a_text="")
Get glyph html.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
static initJS(ilTemplate $a_main_tpl=null)
Init javascript.
enableHiding($a_enable=true)
enable hiding
static buildAjaxHash($a_node_type, $a_node_id, $a_sub_id, $a_sub_type)
Combine properties to hash.
activateComments()
Activate Comments.
getSubObjectTitle($parent_obj_id, $sub_obj_id)
Get sub object title if available with callback.
confirmDelete()
cancel deletion of note
getOnlyNotesHTML()
Get only notes html.
addNoteForm($a_init_form=true)
get notes list including add note area
enablePublicNotes($a_enable=true)
enable public notes
getPDNoteHTML($note_id)
Note display for personal desktop.
deactivateComments()
Deactivate Comments.
deleteNotes()
delete notes confirmation
getNoteListHTML($a_type=IL_NOTE_PRIVATE, $a_init_form=true)
get notes/comments list as html code
static getListCommentsJSCall($a_hash, $a_update_code=null)
Get list comments js call.
initNoteForm($a_mode="edit", $a_type, $a_note=null)
Init note form.
getOnlyCommentsHTML()
Get only comments html.
cancelDelete()
cancel deletion of note
editNoteForm($a_init_form=true)
get notes list including add note area
showTargets(&$tpl, $a_rep_obj_id, $a_note_id, $a_obj_type, $a_obj_id)
show related objects as links
exportNotesHTML()
export selected notes to html
cancelAddNote()
cancel add note
enableAnchorJump($a_enable=true)
enable anchor for form jump
static initJavascript($a_ajax_url, $a_type=IL_NOTE_PRIVATE, ilTemplate $a_main_tpl=null)
Init javascript.
checkEdit($a_note)
Check edit.
notifyObserver($a_action, $a_note)
Notify observers on update/create.
enablePublicNotesDeletion($a_enable=true)
enable public notes
checkDeletion($a_note)
Check whether deletion is allowed.
static getListNotesJSCall($a_hash, $a_update_code=null)
Get list notes js call.
cancelUpdateNote()
cancel edit note
printNotes()
notes print view screen
setRepositoryMode($a_value)
Set repository mode.
enablePrivateNotes($a_enable=true)
enable private notes
addObserver($a_callback)
Add observer.
getNotesHTML($a_init_form=true)
deleteNote()
delete note confirmation
__construct($a_rep_obj_id="", $a_obj_id="", $a_obj_type="", $a_include_subobjects=false)
constructor, specifies notes set
enableCommentsSettings($a_enable=true)
enable private notes
executeCommand()
execute command
enableMultiSelection($a_enable=true)
enable multi selection (checkboxes and commands)
enableTargets($a_enable=true)
enable target objects
showAllPublicNotes()
show all public notes to user
showMyPublicNotes()
show only public notes of user
renderLink($a_tpl, $a_var, $a_txt, $a_cmd, $a_anchor="")
Render a link.
static commentsActivated($a_rep_obj_id, $a_obj_id, $a_obj_type)
Are comments activated for object?
static activateComments($a_rep_obj_id, $a_obj_id, $a_obj_type, $a_activate=true)
Activate notes feature.
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 _lookupLogin($a_user_id)
lookup login
static _lookupOwnerName($a_owner_id)
lookup owner name for owner id
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _getIcon( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
static _getAllReferences($a_id)
get all reference ids of object
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data@access public
static _lookupOwner($a_id)
lookup object owner
static _lookupType($a_id, $a_reference=false)
lookup object type
static _lookupTitle($a_obj_id)
Lookup Title.
special template class to simplify handling of ITX/PEAR
This class represents a text area property in a property form.
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, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
Access handler for personal workspace.
static getGotoLink($a_node_id, $a_obj_id, $a_additional=null)
Tree handler for personal workspace.
static initPanel($a_resize=false, ilTemplate $a_main_tpl=null)
Init yui panel.
static initjQuery($a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
if(!array_key_exists('StateId', $_REQUEST)) $id