ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilMessageGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
27{
28 protected int $note_type = Note::MESSAGE;
29 protected bool $anonymised = false;
30 protected string $counterpart_name = "";
31
32 public function __construct(
33 int $recipient,
34 $rep_obj_id = 0,
35 int $obj_id = 0,
36 string $obj_type = ""
37 ) {
40 $obj_id,
42 );
43 $this->enablePrivateNotes(false);
44 $this->enablePublicNotes(false);
45 $this->recipient = $recipient;
46 }
47
48 public function getNotesHTML(): string
49 {
50 throw new ilException("Call to getNotesHTML is deprecated");
51 }
52
53 public function getCommentsHTML(): string
54 {
55 throw new ilException("Call to getCommentsHTML is deprecated");
56 }
57
58 protected function getNoEntriesText(bool $search): string
59 {
60 if (!$search) {
61 $mess_txt = $this->lng->txt("notes_no_messages");
62 } else {
63 $mess_txt = $this->lng->txt("notes_no_messages_found");
64 }
65 return $mess_txt;
66 }
67
68 protected function getItemGroupTitle(int $obj_id = 0): string
69 {
70 if (!$this->show_header) {
71 return "";
72 }
73 return $this->lng->txt("notes_messages");
74 }
75
76 protected function getItemTitle(Note $note): string
77 {
78 if ($this->anonymised) {
79 if ($note->getAuthor() === $this->user->getId()) {
80 return $this->lng->txt("notes_message_author_you");
81 } else {
82 if ($this->counterpart_name !== "") {
84 }
85 return $this->lng->txt("notes_message_counterpart");
86 }
87 }
88 $avatar = ilObjUser::_getAvatar($note->getAuthor());
89 return ilUserUtil::getNamePresentation($note->getAuthor(), false, false);
90 }
91
92 protected function addItemProperties(Note $note, array &$properties): void
93 {
95 $properties[$this->lng->txt("create_date")] = $creation_date;
96 }
97
98 protected function getFormLabelKey(): string
99 {
100 return "message";
101 }
102
103 protected function getDeleteText(): string
104 {
105 return $this->lng->txt("notes_delete_message");
106 }
107
108 public function getHTML(): string
109 {
110 throw new ilException("Not implemented.");
111 }
112
113 public function getListHTML(bool $a_init_form = true): string
114 {
115 return parent::getListHTML($a_init_form);
116 }
117
118
119 protected function getListTitle(): string
120 {
121 return $this->lng->txt("notes_messages");
122 }
123
124 protected function getAddText(): string
125 {
126 return $this->lng->txt("note_add_message");
127 }
128
129 protected function getDeletedMultipleText(): string
130 {
131 return $this->lng->txt("notes_messages_deleted");
132 }
133
134 protected function getDeletedSingleText(): string
135 {
136 return $this->lng->txt("notes_message_deleted");
137 }
138
139 protected function getLatestItemText(): string
140 {
141 return $this->lng->txt("notes_latest_message");
142 }
143
144 protected function getAddEditItemText(): string
145 {
146 return $this->lng->txt("notes_add_edit_message");
147 }
148
149 public function setAnonymised(bool $anonymised, string $counterpart_name)
150 {
151 $this->anonymised = $anonymised;
152 $this->counterpart_name = $counterpart_name;
153 }
154
155}
const IL_CAL_DATETIME
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
Class for single dates.
Base class for ILIAS Exception handling.
getNoEntriesText(bool $search)
addItemProperties(Note $note, array &$properties)
__construct(int $recipient, $rep_obj_id=0, int $obj_id=0, string $obj_type="")
getItemGroupTitle(int $obj_id=0)
getListHTML(bool $a_init_form=true)
getItemTitle(Note $note)
setAnonymised(bool $anonymised, string $counterpart_name)
@ilCtrl_Calls ilNoteGUI: ilCommentGUI
enablePrivateNotes(bool $a_enable=true)
string $obj_type
enablePublicNotes(bool $a_enable=true)
static _getAvatar(int $a_usr_id)
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:
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc