32 protected \ILIAS\Notes\InternalGUIService
$gui;
35 protected \ILIAS\Notes\InternalDataService
$data;
68 protected \ILIAS\DI\UIServices
$ui;
102 string $a_obj_type =
"",
103 bool $a_include_subobjects =
false,
109 $this->
user = $DIC->user();
111 $this->obj_definition =
$DIC[
"objDefinition"];
112 $this->tree =
$DIC->repositoryTree();
113 $this->
access = $DIC->access();
114 $this->
ui = $DIC->ui();
115 $ilCtrl =
$DIC->ctrl();
116 $this->
lng = $DIC->language();
120 $ns =
$DIC->notes()->internal();
127 $this->data = $ns->data();
128 $this->gui = $ns->gui();
129 $this->notes_access = $ns->domain()->noteAccess();
131 $this->
lng->loadLanguageModule(
"notes");
133 $ilCtrl->saveParameter($this,
"notes_only");
135 $this->rep_obj_id = $a_rep_obj_id;
136 $this->obj_id = $a_obj_id;
137 $this->obj_type = $a_obj_type;
138 $this->inc_sub = $a_include_subobjects;
139 $this->news_id = $a_news_id;
142 if (!is_array($a_rep_obj_id) && !$this->obj_type && $a_rep_obj_id) {
148 $this->
ctrl = $ilCtrl;
150 $this->add_note_form =
false;
151 $this->edit_note_form =
false;
152 $this->private_enabled =
false;
154 if (!is_array($this->rep_obj_id)) {
155 if ($this->manager->commentsActive($this->rep_obj_id)) {
156 $this->public_enabled =
true;
158 $this->public_enabled =
false;
161 $this->targets_enabled =
false;
162 $this->export_html =
false;
163 $this->print =
false;
164 $this->comments_settings =
false;
169 $this->
ctrl->saveParameter($this,
"note_type");
170 $this->requested_note_id = $this->request->getNoteId();
171 $this->requested_note_mess = $this->request->getNoteMess();
172 $this->requested_news_id = $this->request->getNewsId();
177 $this->show_empty_list_message = $a_val;
187 $this->show_header = $a_val;
198 $this->use_obj_title_header = $a_val;
208 $this->default_command = $a_val;
213 $this->hide_new_form = $a_val;
224 $next_class = $this->
ctrl->getNextClass($this);
225 switch ($next_class) {
226 case strtolower(ilCommentGUI::class):
227 $gui = $this->gui->getCommentsGUI(
236 $gui->enableCommentsSettings($this->comments_settings);
237 $this->
ctrl->forwardCommand($gui);
241 return $this->$cmd();
247 $this->private_enabled = $a_enable;
252 $this->public_enabled = $a_enable;
257 $this->comments_settings = $a_enable;
262 $this->public_deletion_enabled = $a_enable;
268 $this->targets_enabled = $a_enable;
273 $this->repository_mode = $a_value;
279 $ilCtrl->
setParameter($this,
"notes_type", Note::PRIVATE);
296 if ($this->
ctrl->isAsynch()) {
297 return $this->
ui->renderer()->renderAsync($components);
299 return $this->
ui->renderer()->render($components);
305 $this->
ctrl->redirectByClass(ilCommentGUI::class,
"getListHTML",
"", $this->ajax);
313 if ($this->comments_settings) {
314 $this->manager->activateComments($this->rep_obj_id,
true);
317 $ilCtrl->
redirectByClass(static::class,
"getListHTML",
"", $this->ajax);
324 if ($this->comments_settings) {
325 $this->manager->activateComments($this->rep_obj_id,
false);
328 $ilCtrl->
redirectByClass(static::class,
"getListHTML",
"", $this->ajax);
336 if ($this->notes ===
null) {
339 if ($this->export_html || $this->print) {
340 if ($this->requested_note_id > 0) {
343 $filter = $this->request->getNoteText();
347 $ascending = $this->manager->getSortAscending();
348 if ($this->only_latest) {
351 $author_id = ($this->note_type === Note::PRIVATE)
355 if (!is_array($this->rep_obj_id)) {
356 $notes = $this->manager->getNotesForContext(
357 $this->data->context(
362 $this->repository_mode
372 $notes = $this->manager->getNotesForRepositoryObjIds(
388 bool $a_init_form =
true
392 $f = $this->
ui->factory();
399 $tpl =
new ilTemplate(
"tpl.notes_list.html",
true,
true,
"components/ILIAS/Notes");
402 $cnt_str = (count(
$notes) > 0)
403 ?
" (" . count(
$notes) .
")"
408 if ($origin_header !=
"") {
409 $tpl->setCurrentBlock(
"title");
410 $tpl->setVariable(
"TITLE", $origin_header);
411 $tpl->parseCurrentBlock();
414 $tpl->setVariable(
"TXT_NOTES", $this->
getListTitle() . $cnt_str);
418 if (!$this->edit_note_form && !is_array($this->rep_obj_id) &&
420 $tpl->setCurrentBlock(
"edit_note_form");
422 $b = $this->
ui->factory()->button()->standard(
426 $tpl->setVariable(
"EDIT_STYLE",
"display:none;");
429 $ilCtrl->getFormActionByClass(static::class,
"addNote",
"",
true)
433 $this->
lng->txt(
"cancel")
441 $this->
getNoteForm(
"create", $this->note_type)->render()
443 $tpl->parseCurrentBlock();
450 $notes_given =
false;
453 if ($this->edit_note_form) {
454 $note = $this->manager->getById($this->requested_note_id);
455 $ilCtrl->setParameterByClass(static::class,
"note_id", $this->requested_note_id);
458 $ilCtrl->getFormActionByClass(static::class,
"updateNote",
"",
true)
461 "CANCEL_FORM_ACTION",
462 $ilCtrl->getFormActionByClass(static::class,
"cancelUpdateNote",
"",
true)
464 $tpl->setVariable(
"NOTE_FOCUS",
"1");
467 $this->
lng->txt(
"cancel")
471 $this->
getNoteForm(
"edit", $this->note_type, $note)->render()
473 $tpl->parseCurrentBlock();
478 $text_placeholders = [];
481 foreach (
$notes as $note) {
482 if ($this->only_latest && $notes_given) {
486 $current_obj_id = $note->getContext()->getObjId();
487 if ($last_obj_id !==
null && $current_obj_id !== $last_obj_id) {
489 $item_groups[] =
$f->item()->group($it_group_title, $items);
492 $last_obj_id = $current_obj_id;
502 $item_groups[] =
$f->item()->group($it_group_title, $items);
505 if (!is_array($this->rep_obj_id)) {
506 $title = $item_groups[0]->getTitle();
507 $item_groups[0] =
$f->item()->group(
"", $item_groups[0]->getItems());
511 $panel =
$f->panel()->listing()->standard($title, $item_groups);
512 if (!is_array($this->rep_obj_id) && !$this->no_actions) {
516 $html = str_replace($text_placeholders, $texts, $html);
517 $tpl->setVariable(
"NOTES_LIST", $html);
518 } elseif (!is_array($this->rep_obj_id)) {
520 $item_groups = [
$f->item()->group($it_group_title, [])];
521 $panel =
$f->panel()->listing()->standard(
"", $item_groups);
523 if ($this->show_empty_list_message) {
525 $mess =
$f->messageBox()->info($mess_txt);
528 $tpl->setVariable(
"NOTES_LIST", $html);
530 } elseif ($this->search_text !==
"") {
532 $mess =
$f->messageBox()->info($mess_txt);
540 switch ($this->requested_note_mess !==
"" ? $this->requested_note_mess : $this->note_mess) {
543 $mtxt =
$lng->
txt(
"msg_obj_modified");
558 $mtxt =
$lng->
txt(
"form_input_not_valid");
563 $mtxt =
$lng->
txt(
"info_delete_sure");
568 $mtxt =
$lng->
txt(
"no_checkbox");
574 $tpl->setVariable(
"MESS",
"");
577 if ($this->widget_header !==
"") {
578 $tpl->setVariable(
"WIDGET_HEADER", $this->widget_header);
586 return $this->
lng->txt(
"private_notes");
591 return $this->
lng->txt(
"note_add_note");
596 return $this->
lng->txt(
"notes_notes_deleted");
601 return $this->
lng->txt(
"notes_note_deleted");
611 return $this->
lng->txt(
"notes_add_edit_note");
617 $mess_txt = $this->
lng->txt(
"notes_no_notes");
619 $mess_txt = $this->
lng->txt(
"notes_no_notes_found");
643 if ($this->manager->getSortAscending()) {
644 $dd_buttons[] = $this->getShyButton(
646 $this->
lng->txt(
"notes_sort_desc"),
652 $dd_buttons[] = $this->getShyButton(
654 $this->
lng->txt(
"notes_sort_asc"),
661 $s = $this->
ui->factory()->dropdown()->standard(
670 if (!$this->show_header) {
673 if (!is_array($this->rep_obj_id) && !$this->getUseObjectTitleHeader()) {
674 $it_group_title = $this->
lng->txt(
"notes");
676 $it_group_title = ($obj_id)
678 : $this->
lng->txt(
"note_without_object");
680 return $it_group_title;
699 if ($actions && $this->notes_access->canEdit($note)) {
700 if (!$this->export_html && !$this->print
701 && !$this->edit_note_form && !$this->add_note_form && !$this->no_actions) {
703 $dd_buttons[] = $this->getShyButton(
705 $this->
lng->txt(
"edit"),
707 "note_" . $note->
getId(),
714 if ($actions && !$this->export_html && !$this->print
715 && !$this->no_actions
716 && $this->notes_access->canDelete($note)) {
718 $dd_buttons[] = $this->getShyButton(
720 $this->
lng->txt(
"delete"),
722 "note_" . $note->
getId(),
733 if ($this->targets_enabled) {
734 $target = $this->getTarget($note);
735 if ($target[
"title"] !==
"") {
736 if ($target[
"link"] ===
"") {
737 $properties[$this->
lng->txt(
"notes_origin")] = $target[
"title"];
739 $properties[$this->
lng->txt(
"notes_origin")] =
$f
753 $title = $this->getItemTitle($note);
754 if ($note->
getType() === Note::PUBLIC) {
755 $avatar = $this->gui->profile()->getAvatar($note->
getAuthor());
757 $this->addItemProperties($note, $properties);
769 $item =
$f->item()->standard($title)
770 ->withDescription($this->getNoteTextPlaceholder($note))
771 ->withProperties($properties);
772 if (!is_null($avatar)) {
773 $item = $item->withLeadAvatar($avatar);
775 if (count($dd_buttons) > 0) {
776 $item = $item->withActions(
777 $f->dropdown()->standard($dd_buttons)
786 if ($note->
getType() === Note::PUBLIC) {
789 $title = $creation_date;
797 if ($note->
getType() === Note::PUBLIC) {
798 $properties[$this->
lng->txt(
"create_date")] = $creation_date;
804 return "##note-text-" . $note->
getId() .
"##";
809 return (trim($note->
getText()) !==
"")
810 ? nl2br(htmlentities($note->
getText()))
811 : $this->
lng->txt(
"note_content_removed");
821 $objDefinition = $this->obj_definition;
823 if ($parent_type ===
"") {
826 $parent_class =
"ilObj" . $objDefinition->getClassName($parent_type) .
"GUI";
827 if (method_exists($parent_class,
"lookupSubObjectTitle")) {
828 return call_user_func_array(array($parent_class,
"lookupSubObjectTitle"), array($parent_obj_id, $sub_obj_id));
837 ): \
ILIAS\Repository\Form\FormAdapterGUI {
841 $label_key .= ($mode ===
"create")
844 $label_key .=
"_" . $this->getFormLabelKey($type);
845 $cmd = ($mode ===
"create")
852 if ($cmd ===
"updateNote") {
853 $this->
ctrl->setParameter($this,
"note_id", $this->requested_note_id);
855 $action = $this->
ctrl->getFormActionByClass(static::class, $cmd,
"");
856 $form = $this->gui->form(static::class, $action)
857 ->section(
"props", $this->
lng->txt($label_key))
858 ->textarea(
"note", $this->
lng->txt(
"note_text"),
"", $value);
874 $ilAccess = $this->access;
875 $objDefinition = $this->obj_definition;
876 $ilUser = $this->user;
881 $a_note_id = $note->
getId();
884 $a_obj_id =
$context->getSubObjId();
890 foreach ($ref_ids as
$ref_id) {
891 if ($vis_ref_id > 0) {
894 if ($ilAccess->checkAccess(
"visible",
"",
$ref_id)) {
900 if ($vis_ref_id > 0) {
904 if ($type ===
"poll") {
905 $link = ilLink::_getLink($vis_ref_id,
"poll");
906 } elseif ($a_obj_type !==
"pg") {
907 if (!isset($this->item_list_gui[$type])) {
908 $class = $objDefinition->getClassName($type);
909 $full_class =
"ilObj" . $class .
"ListGUI";
910 $this->item_list_gui[$type] =
new $full_class();
915 if ($a_obj_type ===
"crsr" || $a_obj_type ===
"catr" || $a_obj_type ===
"grpr") {
919 $this->item_list_gui[$type]->initItem($vis_ref_id,
$context->getObjId(), $title, $a_obj_type);
920 $link = $this->item_list_gui[$type]->getCommandLink(
"infoScreen");
921 $link = $this->item_list_gui[$type]->appendRepositoryFrameParameter($link) .
"#note_" . $a_note_id;
924 $link =
"goto.php?target=pg_" . $a_obj_id .
"_" . $vis_ref_id;
928 if (!isset($this->wsp_tree)) {
932 $node_id = $this->wsp_tree->lookupNodeId(
$context->getObjId());
933 if ($this->wsp_access_handler->checkAccess(
"visible",
"", $node_id)) {
934 $path = $this->wsp_tree->getPathFull($node_id);
936 $item = array_pop(
$path);
937 $title = $item[
"title"];
945 $link =
"ilias.php?baseClass=ilDashboardGUI&cmd=jumpToWorkspace&dsh=" .
961 bool $a_init_form =
true
963 $this->add_note_form =
true;
964 return $this->getListHTML($a_init_form);
972 return $this->getListHTML();
980 return $this->getListHTML();
988 $ilUser = $this->user;
989 $ilCtrl = $this->ctrl;
991 $text = $this->getNoteForm(
994 )->getData(
"note") ??
"";
997 if ($text !==
"" && !is_array($this->rep_obj_id)) {
1003 $this->repository_mode
1005 $note = $this->data->note(
1015 $this->manager->createNote(
1020 $ilCtrl->setParameter($this,
"note_mess",
"mod");
1022 $ilCtrl->redirect($this,
"getListHTML",
"", $this->
ctrl->isAsynch());
1027 $ilCtrl = $this->ctrl;
1029 $note = $this->manager->getById($this->requested_note_id);
1030 $text = $this->getNoteForm(
1033 )->getData(
"note") ??
"";
1035 if ($this->notes_access->canEdit($note)) {
1036 $this->manager->updateNoteText(
1037 $this->requested_note_id,
1041 $ilCtrl->setParameter($this,
"note_mess",
"mod");
1043 $ilCtrl->redirect($this,
"getListHTML",
"", $this->
ctrl->isAsynch());
1050 bool $a_init_form =
true
1052 $this->edit_note_form =
true;
1054 return $this->getListHTML($a_init_form);
1063 $ctrl = $this->ctrl;
1066 "tpl.notes_and_comments.html",
1069 "components/ILIAS/Notes"
1073 $ntpl->setVariable(
"OUTER_ID",
" id='notes_embedded_outer' ");
1076 $ntpl->setVariable(
"CONTENT", $content);
1078 if ($ctrl->
isAsynch() && !$this->request->isFilterCommand()) {
1083 return $ntpl->get();
1091 $f = $this->
ui->factory();
1092 $ctrl = $this->ctrl;
1093 $ctrl->
setParameter($this,
"note_id", $this->requested_note_id);
1094 $note = $this->manager->getById($this->requested_note_id);
1096 $text = $this->getDeleteText();
1098 $mess =
$f->messageBox()->confirmation($text);
1099 $item = $this->getItemForNote($note,
false);
1101 $b1 = $this->getButton(
1103 $this->
lng->txt(
"cancel"),
1106 $b2 = $this->getButton(
1108 $this->
lng->txt(
"delete"),
1112 $it_group_title = $this->getItemGroupTitle($note->
getContext()->getObjId());
1113 $item_groups = [
$f->item()->group($it_group_title, [$item])];
1114 $panel =
$f->panel()->listing()->standard(
"", $item_groups);
1116 $html = $this->renderComponents([$mess, $panel, $b2, $b1]);
1117 $html = str_replace($this->getNoteTextPlaceholder($note), $this->getNoteText($note), $html);
1119 return $this->renderContent($html);
1124 return $this->
lng->txt(
"notes_delete_note");
1129 return $this->getListHTML();
1134 $ilCtrl = $this->ctrl;
1137 $ids = [$this->request->getNoteId()];
1138 foreach ($ids as
$id) {
1139 $note = $this->manager->getById(
$id);
1140 if ($this->notes_access->canDelete($note, $this->user->
getId(), $this->public_deletion_enabled)) {
1141 $this->manager->deleteNote($note, $this->
user->getId(), $this->public_deletion_enabled);
1146 $ilCtrl->setParameter($this,
"note_mess",
"ntsdel");
1148 $ilCtrl->setParameter($this,
"note_mess",
"ntdel");
1150 $ilCtrl->redirect($this,
"getListHTML",
"", $this->ajax);
1160 $this->export_html =
true;
1164 $authors = array_unique(array_map(
function (
Note $note) {
1166 }, $this->getNotes()));
1167 $export = new \ILIAS\Notes\Export\NotesHtmlExport(
1169 $this->
user->getId(),
1172 $export->exportHTML($this->getListHTML());
1180 ?
string $a_update_code =
null
1182 if ($a_update_code === null) {
1183 $a_update_code =
"null";
1185 $a_update_code =
"'" . $a_update_code .
"'";
1188 return "ilNotes.listNotes(event, '" . $a_hash .
"', " . $a_update_code .
");";
1196 ?
string $a_update_code =
null
1198 if ($a_update_code === null) {
1199 $a_update_code =
"null";
1201 $a_update_code =
"'" . $a_update_code .
"'";
1204 return "ilNotes.listComments(event, '" . $a_hash .
"', " . $a_update_code .
");";
1214 string $a_anchor =
"",
1217 $ctrl = $this->
ctrl;
1218 $f = $this->
ui->factory();
1220 $class = static::class;
1222 $button =
$f->button()->shy(
1225 )->withOnLoadCode(
function (
$id) use ($ctrl, $a_cmd, $note_id, $class) {
1228 "document.querySelector('#$id').addEventListener('click', () => { ilNotes.cmdAjaxLink(event, '" .
1233 $button =
$f->button()->shy(
1248 string $a_anchor =
""
1250 $ctrl = $this->
ctrl;
1251 $f = $this->
ui->factory();
1254 $button =
$f->button()->standard(
1257 )->withOnLoadCode(
function (
$id) use ($ctrl, $a_cmd) {
1259 "document.querySelector('#$id').addEventListener('click', () => { ilNotes.cmdAjaxLink(event, '" .
1264 $button =
$f->button()->standard(
1276 callable $a_callback
1278 $this->observer[] = $a_callback;
1283 $this->manager->setSortAscending(
true);
1284 return $this->getListHTML();
1289 $this->manager->setSortAscending(
false);
1290 return $this->getListHTML();
1296 $this->hide_new_form =
true;
1297 $this->no_actions =
true;
1298 $this->enable_sorting =
false;
1299 $this->user_img_export_html =
true;
1304 if (!is_array($this->rep_obj_id) && !$this->only_latest && $this->
ctrl->isAsynch()) {
1305 switch ($this->obj_type) {
1320 if ($this->obj_id) {
1321 $sub_title = $this->getSubObjectTitle($this->rep_obj_id, $this->obj_id);
1323 $title .=
" - " . $sub_title;
1327 return $img .
" " . $title;
1334 $f = $this->
ui->factory();
1335 $r = $this->
ui->renderer();
1337 $ctrl = $this->ctrl;
1356 $cnt[$this->rep_obj_id][$this->note_type] = $this->manager->getNrOfNotesForContext(
$context, $this->note_type);
1357 $cnt = $cnt[$this->rep_obj_id][$this->note_type] ?? 0;
1359 $widget_el_id =
"notew_" . str_replace(
";",
"_", $hash);
1361 $update_url = $ctrl->
getLinkTarget($this,
"updateGlyph",
"",
true,
false);
1362 $query_url = $ctrl->
getLinkTarget($this,
"getListHtml",
"",
true,
false);
1364 $c =
$f->counter()->status((
int) $cnt);
1365 $comps[] =
$f->symbol()->glyph()->comment()->withCounter(
$c)->withAdditionalOnLoadCode(
function (
$id) use ($hash, $query_url) {
1366 $code =
"$('#$id').attr('data-note-key','$hash');\n";
1367 $code .=
"$('#$id').attr('data-note-ui-type','trigger');\n";
1368 $code .=
"$('#$id').attr('data-note-query-url','" . $query_url .
"');\n";
1369 $code .=
"$(\"#$id\").click(function(event) { ilNotes.clickTrigger(event)});";
1372 if ($this->
ctrl->isAsynch()) {
1373 $html = $r->renderAsync($comps);
1375 $html = $r->render($comps);
1377 $html =
"<span id='" . $widget_el_id .
"' data-note-key='$hash' data-note-ui-type='widget' data-note-update-url='$update_url'>" . $html .
"</span>";
1378 $ctrl->
setParameter($this,
"news_id", $this->requested_news_id);
1384 $f = $this->
ui->factory();
1385 $r = $this->
ui->renderer();
1387 $ctrl = $this->ctrl;
1406 $cnt[$this->rep_obj_id][$this->note_type] = $this->manager->getNrOfNotesForContext(
$context, $this->note_type);
1407 $cnt = $cnt[$this->rep_obj_id][$this->note_type] ?? 0;
1409 $widget_el_id =
"notew_" . str_replace(
";",
"_", $hash);
1411 $update_url = $ctrl->
getLinkTarget($this,
"updateNumber",
"",
true,
false);
1412 $query_url = $ctrl->
getLinkTarget($this,
"getListHtml",
"",
true,
false);
1414 $comps[] =
$f->button()->shy($cnt,
"#")->withAdditionalOnLoadCode(
function (
$id) use ($hash, $query_url) {
1415 $code =
"$('#$id').attr('data-note-key','$hash');\n";
1416 $code .=
"$('#$id').attr('data-note-ui-type','trigger');\n";
1417 $code .=
"$('#$id').attr('data-note-query-url','" . $query_url .
"');\n";
1418 $code .=
"$(\"#$id\").click(function(event) { ilNotes.clickTrigger(event)});";
1421 if ($this->
ctrl->isAsynch()) {
1422 $html = $r->renderAsync($comps);
1424 $html = $r->render($comps);
1427 $html =
"<span id='" . $widget_el_id .
"' data-note-key='$hash' data-note-ui-type='widget' data-note-update-url='$update_url'>" . $html .
"</span>";
1428 $ctrl->
setParameter($this,
"news_id", $this->requested_news_id);
1434 $f = $this->
ui->factory();
1435 $r = $this->
ui->renderer();
1437 $ctrl = $this->ctrl;
1456 $widget_el_id =
"notew_" . str_replace(
";",
"_", $hash);
1458 $update_url = $ctrl->
getLinkTarget($this,
"updateNumber",
"",
true,
false);
1459 $query_url = $ctrl->
getLinkTarget($this,
"getListHtml",
"",
true,
false);
1460 $but =
$f->button()->shy($this->
lng->txt(
"comments"),
"#")->withAdditionalOnLoadCode(
function (
$id) use ($hash, $query_url) {
1461 $code =
"$('#$id').attr('data-note-key','$hash');\n";
1462 $code .=
"$('#$id').attr('data-note-ui-type','trigger');\n";
1463 $code .=
"$('#$id').attr('data-note-query-url','" . $query_url .
"');\n";
1464 $code .=
"$(\"#$id\").click(function(event) { ilNotes.clickTrigger(event)});";
1472 $f = $this->
ui->factory();
1473 $r = $this->
ui->renderer();
1475 $ctrl = $this->ctrl;
1494 $cnt[$this->rep_obj_id][$this->note_type] = $this->manager->getNrOfNotesForContext(
$context, $this->note_type);
1495 $cnt = $cnt[$this->rep_obj_id][$this->note_type] ?? 0;
1497 $tpl =
new ilTemplate(
"tpl.note_widget_header.html",
true,
true,
"components/ILIAS/Notes");
1498 $widget_el_id =
"notew_" . str_replace(
";",
"_", $hash);
1500 $update_url = $ctrl->
getLinkTarget($this,
"updateWidget",
"",
true,
false);
1501 $query_url = $ctrl->
getLinkTarget($this,
"getListHtml",
"",
true,
false);
1504 $c =
$f->counter()->status((
int) $cnt);
1505 $comps[] =
$f->symbol()->glyph()->comment()->withCounter(
$c)->withAdditionalOnLoadCode(
function (
$id) use ($hash, $query_url) {
1506 $code =
"$('#$id').attr('data-note-key','$hash');\n";
1507 $code .=
"$('#$id').attr('data-note-ui-type','trigger');\n";
1508 $code .=
"$('#$id').attr('data-note-query-url','" . $query_url .
"');\n";
1509 $code .=
"$(\"#$id\").click(function(event) { ilNotes.clickTrigger(event)});";
1512 $comps[] =
$f->divider()->vertical();
1513 $tpl->setVariable(
"GLYPH", $r->render($comps));
1514 $tpl->setVariable(
"TXT_LATEST", $this->getLatestItemText());
1517 $b =
$f->button()->shy($this->getAddEditItemText(),
"#")->withAdditionalOnLoadCode(
function (
$id) use ($hash, $query_url) {
1518 $code =
"$('#$id').attr('data-note-key','$hash');\n";
1519 $code .=
"$('#$id').attr('data-note-ui-type','trigger');\n";
1520 $code .=
"$('#$id').attr('data-note-query-url','" . $query_url .
"');\n";
1521 $code .=
"$(\"#$id\").click(function(event) { ilNotes.clickTrigger(event)});";
1525 $tpl->setVariable(
"SHY_BUTTON", $r->renderAsync(
$b));
1527 $tpl->setVariable(
"SHY_BUTTON", $r->render(
$b));
1530 $this->widget_header = $tpl->get();
1532 $this->hide_new_form =
true;
1533 $this->only_latest =
true;
1534 $this->no_actions =
true;
1535 $html =
"<div id='" . $widget_el_id .
"' data-note-key='$hash' data-note-ui-type='widget' data-note-update-url='$update_url'>" . $this->getNoteListHTML() .
"</div>";
1536 $ctrl->
setParameter($this,
"news_id", $this->requested_news_id);
1542 echo $this->getWidget();
1548 echo $this->getGlyph();
1554 echo $this->getNumber();
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
static buildAjaxHash(int $node_type, ?int $node_id, string $obj_type, int $obj_id, ?string $sub_type=null, ?int $sub_id=null, int $news_id=0)
Build ajax hash.
static _lookupTitle(int $obj_id)
static _lookupTargetId(int $a_obj_id)
Class ilCtrl provides processing control methods.
redirectByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc
getLinkTarget(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc
setParameterByClass(string $a_class, string $a_parameter, $a_value)
@inheritDoc
getLinkTargetByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
static useRelativeDates()
static setUseRelativeDates(bool $a_status)
set use relative dates
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
special template class to simplify handling of ITX/PEAR
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static getLogger(string $a_component_id)
Get component logger.
Component logger with individual log levels by component id.
@ilCtrl_Calls ilNoteGUI: ilCommentGUI
static getListNotesJSCall(string $a_hash, ?string $a_update_code=null)
Get list notes js call.
getTarget(Note $note)
show related objects as links
ILIAS Notes InternalGUIService $gui
ilWorkspaceAccessHandler $wsp_access_handler
ilWorkspaceTree $wsp_tree
StandardGUIRequest $request
renderComponents(array $components)
getShyButton(string $a_var, string $a_txt, string $a_cmd, string $a_anchor="", int $note_id=0)
__construct( $a_rep_obj_id=0, int $a_obj_id=0, string $a_obj_type="", bool $a_include_subobjects=false, int $a_news_id=0, bool $ajax=true, string $search_text="")
addItemProperties(Note $note, array &$properties)
static getListCommentsJSCall(string $a_hash, ?string $a_update_code=null)
Get list comments js call.
getNoEntriesText(bool $search)
getNoteListHTML(bool $a_init_form=true)
setShowEmptyListMessage(bool $a_val)
renderContent(string $content)
Render content into notes wrapper.
ilObjectDefinition $obj_definition
getItemForNote(Note $note, bool $actions=true)
getUseObjectTitleHeader()
getListHTML(bool $a_init_form=true)
addNoteForm(bool $a_init_form=true)
get notes list including add note area
enablePublicNotesDeletion(bool $a_enable=true)
enablePrivateNotes(bool $a_enable=true)
bool $use_obj_title_header
enableCommentsSettings(bool $a_enable=true)
getButton(string $a_var, string $a_txt, string $a_cmd, string $a_anchor="")
bool $show_empty_list_message
exportNotesHTML()
export selected notes to html
cancelAddNote()
cancel add note
getNoteForm(string $mode, int $type, ?Note $note=null)
editNoteForm(bool $a_init_form=true)
get notes list including add note area
setRepositoryMode(bool $a_value)
cancelUpdateNote()
cancel edit note
setDefaultCommand(string $a_val)
string $requested_note_mess
enablePublicNotes(bool $a_enable=true)
getSubObjectTitle(int $parent_obj_id, int $sub_obj_id)
Get sub object title if available with callback.
ILIAS Notes AccessManager $notes_access
bool $user_img_export_html
setHideNewForm(bool $a_val)
getNoteTextPlaceholder(Note $note)
setShowHeader(bool $a_val)
setUseObjectTitleHeader(bool $a_val)
enableTargets(bool $a_enable=true)
getShowEmptyListMessage()
bool $public_deletion_enabled
ILIAS Notes InternalDataService $data
addObserver(callable $a_callback)
Add observer.
getItemGroupTitle(int $obj_id=0)
parses the objects.xml it handles the xml-description of all ilias objects
static _lookupType(int $id, bool $reference=false)
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
static _lookupOwnerName(int $owner_id)
Lookup owner name for owner id.
static _lookupOwner(int $obj_id)
Lookup owner user ID for object ID.
static _getAllReferences(int $id)
get all reference ids for object ID
static _lookupTitle(int $obj_id)
special template class to simplify handling of ITX/PEAR
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path=null)
Default behaviour is:
static getSystemMessageHTML(string $a_txt, string $a_type="info")
Get HTML for a system message.
static img(string $a_src, ?string $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getGotoLink(int $a_node_id, int $a_obj_id, string $a_additional="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
if(!file_exists('../ilias.ini.php'))