34     protected \ILIAS\Notes\InternalGUIService 
$gui;
    35     protected \ILIAS\DI\UIServices 
$ui;
    56         $this->
user = $DIC->user();
    57         $this->
tabs = $DIC->tabs();
    58         $this->
help = $DIC[
"ilHelp"];
    60         $this->
access = $DIC->access();
    61         $this->
toolbar = $DIC->toolbar();
    63         $lng = $DIC->language();
    64         $ilCtrl = $DIC->ctrl();
    65         $ilUser = $DIC->user();
    66         $ilHelp = $DIC[
"ilHelp"];
    67         $this->
ui = $DIC->ui();
    69         $this->request = $DIC->notes()
    74         $ilHelp->setScreenIdComponent(
"note");
    81         $this->
ctrl = $ilCtrl;
    83         $this->notes_manager = $DIC->notes()->internal()->domain()->notes();
    84         $this->gui = $DIC->notes()->internal()->gui();
    87         $rel_obj = $this->request->getRelatedObjId();
    88         $this->note_type = ($this->request->getNoteType() === Note::PRIVATE || $ilCtrl->getCmd() === 
"getNotesHTML")
    91         if ($ilCtrl->getCmd() === 
"getCommentsHTML") {
    92             $this->note_type = Note::PUBLIC;
    94         $this->
ctrl->setParameter($this, 
"note_type", $this->note_type);
    96             $ilUser->writePref(
"pd_notes_rel_obj" . $this->note_type, (
string) $rel_obj);
    99         elseif ($this->request->getNoteId() > 0) {
   100             $note = $this->notes_manager->getById($this->request->getNoteId());
   102             $ilUser->writePref(
"pd_notes_rel_obj" . $this->note_type, 
$context->getObjId());
   105         $ajax_url = $this->
ctrl->getLinkTargetByClass(
   106             [
"ildashboardgui", 
"ilpdnotesgui", 
"ilnotegui"],
   112         $this->gui->initJavascript($ajax_url);
   118         if (!isset(
$data[
"object"]) || 
$data[
"object"] === 
"") {
   119             $this->current_rel_obj = null;
   121             $this->current_rel_obj = (
int) 
$data[
"object"];
   123         $this->search_text = 
$data[
"text"] ?? 
"";
   128         $next_class = $this->
ctrl->getNextClass();
   129         switch ($next_class) {
   141                 $cmd = $this->
ctrl->getCmd(
"view");
   146         $this->tpl->printToStdout(
true);
   153         $t = $this->
lng->txt(
"notes");
   155             $t = $this->
lng->txt(
"notes_and_comments");
   158             $t = $this->
lng->txt(
"notes_comments");
   161         if ($this->note_type === Note::PRIVATE) {
   162             $t = $this->
lng->txt(
"private_notes");
   165             $t = $this->
lng->txt(
"notes_public_comments");
   169         $this->tpl->setTitle($t);
   174         if (is_null($this->related_objects)) {
   175             $this->related_objects = $this->notes_manager->getRelatedObjectsOfUser(
   193         if ($this->note_type === Note::PRIVATE) {
   194             $rel_objs = array_merge(
   201         if (count($rel_objs) === 0 && $this->note_type === Note::PUBLIC) {
   203             $this->tpl->setOnScreenMessage(
'info', $lng->
txt(
"msg_no_search_result"));
   206         $notes_gui = $this->
getGui();
   208         if ($this->note_type === Note::PRIVATE) {
   209             $notes_gui->enablePrivateNotes(
true);
   210             $notes_gui->enablePublicNotes(
false);
   212             $notes_gui->enablePrivateNotes(
false);
   213             $notes_gui->enablePublicNotes(
true);
   215             if ($this->current_rel_obj > 0 &&
   218                     if ($ilAccess->checkAccess(
"write", 
"", 
$ref_id)) {
   219                         $notes_gui->enablePublicNotesDeletion(
true);
   225         $notes_gui->enableTargets(
true);
   227         $next_class = $this->
ctrl->getNextClass($this);
   229         if (in_array($next_class, [
"ilnotegui", 
"ilcommentgui"])) {
   230             $html = $this->
ctrl->forwardCommand($notes_gui);
   231         } elseif ($this->note_type === Note::PRIVATE) {
   232             $html = $notes_gui->getNotesHTML();
   234             $html = $notes_gui->getListHTML();
   237         $filter_html = $this->
getFilter()->render();
   239         $this->tpl->setContent($filter_html . $html);
   245         if ($this->current_rel_obj === null) {
   246             $rep_objs = $rel_objs;
   248             $include_subs = 
true;
   250         } elseif ($this->current_rel_obj > 0) {
   253             $include_subs = 
true;
   258             $include_subs = 
false;
   259             $obj_id = $this->
user->getId();
   261         if ($this->note_type === Note::PRIVATE) {
   272             $gui = $this->gui->getCommentsGUI(
   290             "pd_notes_rel_obj" . $this->note_type,
   291             (
string) $this->request->getRelatedObjId()
   293         $this->
ctrl->redirect($this);
   311             $ilCtrl->redirect($this, 
"showPrivateNotes");
   314         $ilCtrl->redirectByClass(ilCommentGUI::class, 
"getListHTML");
   319         $this->notes_manager->setSortAscending($this->gui->standardRequest()->getSortation() === 
"asc");
   327         if (is_null($this->
filter)) {
   330             if ($this->note_type === Note::PRIVATE) {
   331                 $options[-1] = $this->
lng->txt(
"note_without_object");
   337             $this->
filter = $gui->filter(
   338                 "notes_filter_" . $this->note_type,
   344                 ->text(
"text", $lng->
txt(
"notes_text"))
   345                 ->select(
"object", $lng->
txt(
"notes_origin"), $options);
   355         $c = $this->
lng->txt(
"create_date") . 
", ";
   357             'desc' => 
$c . $this->
lng->txt(
"sorting_desc"),
   358             'asc' => 
$c . $this->
lng->txt(
"sorting_asc")
   360         $select_option = ($this->notes_manager->getSortAscending())
   363         $s = $this->
ui->factory()->viewControl()->sortation($options)
   364                ->withTargetURL($ctrl->
getLinkTarget($this, 
"setSortation"), 
'sortation')
   365                ->withLabel($options[$select_option]);
   366         $this->
toolbar->addComponent($s);
   369         $pv = $this->gui->print();
   370         $modal_elements = $pv->getModalElements(
   373         $this->
toolbar->addComponent($modal_elements->button);
   374         $this->
toolbar->addComponent($modal_elements->modal);
   377         $b = $this->
ui->factory()->button()->standard(
   378             $this->
lng->txt(
"notes_html_export"),
   389         $pv = $this->gui->print();
 
getLinkTargetByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
 
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
 
writePref(string $a_keyword, string $a_value)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
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 _getAllReferences(int $id)
get all reference ids for object ID 
 
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory) 
 
loadLanguageModule(string $a_module)
Load language module. 
 
static _lookupTitle(int $obj_id)
 
StandardGUIRequest $request
 
NotesManager $notes_manager
 
ilGlobalTemplateInterface $tpl
 
ILIAS Notes InternalGUIService $gui
 
getLinkTarget(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
 
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
 
static _lookupType(int $id, bool $reference=false)