ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilCommentGUI Class Reference

Comment GUI. More...

+ Inheritance diagram for ilCommentGUI:
+ Collaboration diagram for ilCommentGUI:

Public Member Functions

 __construct ( $rep_obj_id=0, int $obj_id=0, string $obj_type="", bool $include_subobjects=false, int $news_id=0, bool $ajax=true, string $search_text="")
 
 getNotesHTML ()
 
 getCommentsHTML ()
 
 getListHTML (bool $a_init_form=true)
 
- Public Member Functions inherited from ilNoteGUI
 __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="")
 
 setShowEmptyListMessage (bool $a_val)
 
 getShowEmptyListMessage ()
 
 setShowHeader (bool $a_val)
 
 getShowHeader ()
 
 setUseObjectTitleHeader (bool $a_val)
 
 getUseObjectTitleHeader ()
 
 setDefaultCommand (string $a_val)
 
 setHideNewForm (bool $a_val)
 
 getDefaultCommand ()
 
 executeCommand ()
 
 enablePrivateNotes (bool $a_enable=true)
 
 enablePublicNotes (bool $a_enable=true)
 
 enableCommentsSettings (bool $a_enable=true)
 
 enablePublicNotesDeletion (bool $a_enable=true)
 
 enableTargets (bool $a_enable=true)
 
 setRepositoryMode (bool $a_value)
 
 getNotesHTML ()
 
 getListHTML (bool $a_init_form=true)
 
 activateComments ()
 
 deactivateComments ()
 
 getNoteListHTML (bool $a_init_form=true)
 
 getTarget (Note $note)
 show related objects as links More...
 
 addNoteForm (bool $a_init_form=true)
 get notes list including add note area More...
 
 cancelAddNote ()
 cancel add note More...
 
 cancelUpdateNote ()
 cancel edit note More...
 
 addNote ()
 add note More...
 
 updateNote ()
 
 editNoteForm (bool $a_init_form=true)
 get notes list including add note area More...
 
 renderContent (string $content)
 Render content into notes wrapper. More...
 
 cancelDelete ()
 
 confirmDelete ()
 
 exportNotesHTML ()
 export selected notes to html More...
 
 getShyButton (string $a_var, string $a_txt, string $a_cmd, string $a_anchor="", int $note_id=0)
 
 getButton (string $a_var, string $a_txt, string $a_cmd, string $a_anchor="")
 
 addObserver (callable $a_callback)
 Add observer. More...
 
 setExportMode ()
 
 getGlyph ()
 
 getNumber ()
 
 getTriggerShyButton ()
 
 getWidget ()
 

Protected Member Functions

 getNoEntriesText (bool $search)
 
 getItemGroupTitle (int $obj_id=0)
 
 getItemTitle (Note $note)
 
 addItemProperties (Note $note, array &$properties)
 
 getFormLabelKey ()
 
 getDeleteText ()
 
 getLatestItemText ()
 
 getAddEditItemText ()
 
 getListTitle ()
 
 getAddText ()
 
 getDeletedMultipleText ()
 
 getDeletedSingleText ()
 
- Protected Member Functions inherited from ilNoteGUI
 renderComponents (array $components)
 
 getCommentsHTML ()
 
 getNotes ()
 
 getListTitle ()
 
 getAddText ()
 
 getDeletedMultipleText ()
 
 getDeletedSingleText ()
 
 getLatestItemText ()
 
 getAddEditItemText ()
 
 getNoEntriesText (bool $search)
 
 getSortationControl ()
 
 getItemGroupTitle (int $obj_id=0)
 
 getItemForNote (Note $note, bool $actions=true)
 
 getItemTitle (Note $note)
 
 addItemProperties (Note $note, array &$properties)
 
 getNoteTextPlaceholder (Note $note)
 
 getNoteText (Note $note)
 
 getSubObjectTitle (int $parent_obj_id, int $sub_obj_id)
 Get sub object title if available with callback. More...
 
 getNoteForm (string $mode, int $type, ?Note $note=null)
 
 getFormLabelKey ()
 
 deleteNote ()
 
 getDeleteText ()
 
 listSortAsc ()
 
 listSortDesc ()
 
 getOriginHeader ()
 
 updateWidget ()
 
 updateGlyph ()
 
 updateNumber ()
 

Protected Attributes

int $note_type = Note::PUBLIC
 
- Protected Attributes inherited from ilNoteGUI
array $notes = null
 
ILIAS Notes InternalGUIService $gui
 
string $search_text
 
ILIAS Notes AccessManager $notes_access
 
ILIAS Notes InternalDataService $data
 
ilWorkspaceAccessHandler $wsp_access_handler
 
ilWorkspaceTree $wsp_tree
 
bool $public_enabled
 
StandardGUIRequest $request
 
NotesManager $manager
 
bool $targets_enabled = false
 
bool $export_html = false
 
bool $print = false
 
bool $comments_settings = false
 
string $obj_type
 
bool $private_enabled
 
bool $edit_note_form
 
bool $add_note_form
 
bool $ajax
 
bool $inc_sub
 
int $obj_id
 
 $rep_obj_id
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilObjUser $user
 
ilSetting $settings
 
ilObjectDefinition $obj_definition
 
ilTree $tree
 
ilAccessHandler $access
 
string $default_command = "getListHTML"
 
array $observer = []
 
ILIAS DI UIServices $ui
 
int $news_id = 0
 
bool $hide_new_form = false
 
bool $only_latest = false
 
string $widget_header = ""
 
bool $no_actions = false
 
bool $enable_sorting = true
 
bool $user_img_export_html = false
 
ilLogger $log
 
ilTemplate $form_tpl
 
int $note_type = Note::PRIVATE
 
int $requested_note_id = 0
 
string $requested_note_mess = ""
 
int $requested_news_id = 0
 
bool $delete_note = false
 
string $note_mess = ""
 
array $item_list_gui = []
 
bool $use_obj_title_header = true
 
bool $show_empty_list_message = true
 
bool $show_header = true
 
int $recipient = 0
 

Additional Inherited Members

- Static Public Member Functions inherited from ilNoteGUI
static getListNotesJSCall (string $a_hash, ?string $a_update_code=null)
 Get list notes js call. More...
 
static getListCommentsJSCall (string $a_hash, ?string $a_update_code=null)
 Get list comments js call. More...
 
- Data Fields inherited from ilNoteGUI
bool $public_deletion_enabled = false
 
bool $repository_mode = false
 
bool $old = false
 

Detailed Description

Comment GUI.

Definition at line 26 of file class.ilCommentGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilCommentGUI::__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 = "" 
)
Parameters
int | int[]$a_rep_obj_idobject id of repository object (0 for personal desktop)
int$a_obj_idsub-object id (0 for repository items, user id for personal desktop)
string$a_obj_type"pd" for personal desktop
bool$a_include_subobjectsinclude all subobjects of rep object (e.g. pages)
int$a_news_id
bool$ajax
Exceptions
ilCtrlException

Reimplemented from ilNoteGUI.

Definition at line 30 of file class.ilCommentGUI.php.

38 {
41 $obj_id,
43 $include_subobjects,
45 $ajax,
47 );
48 $this->enablePrivateNotes(false);
49 $this->enablePublicNotes(true);
50 }
enablePrivateNotes(bool $a_enable=true)
string $obj_type
string $search_text
enablePublicNotes(bool $a_enable=true)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ilNoteGUI\$ajax, ilNoteGUI\$news_id, ilNoteGUI\$obj_id, ilNoteGUI\$obj_type, ilNoteGUI\$rep_obj_id, ilNoteGUI\$search_text, ILIAS\GlobalScreen\Provider\__construct(), ilNoteGUI\enablePrivateNotes(), and ilNoteGUI\enablePublicNotes().

+ Here is the call graph for this function:

Member Function Documentation

◆ addItemProperties()

ilCommentGUI::addItemProperties ( Note  $note,
array &  $properties 
)
protected

Reimplemented from ilNoteGUI.

Definition at line 85 of file class.ilCommentGUI.php.

85 : void
86 {
88 $properties[$this->lng->txt("create_date")] = $creation_date;
89 }
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.

References ilDatePresentation\formatDate(), ILIAS\Notes\Note\getCreationDate(), IL_CAL_DATETIME, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getAddEditItemText()

ilCommentGUI::getAddEditItemText ( )
protected

Reimplemented from ilNoteGUI.

Definition at line 106 of file class.ilCommentGUI.php.

106 : string
107 {
108 return $this->lng->txt("notes_add_edit_comment");
109 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getAddText()

ilCommentGUI::getAddText ( )
protected

Reimplemented from ilNoteGUI.

Definition at line 189 of file class.ilCommentGUI.php.

189 : string
190 {
191 return $this->lng->txt("note_add_comment");
192 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getCommentsHTML()

ilCommentGUI::getCommentsHTML ( )

Reimplemented from ilNoteGUI.

Definition at line 57 of file class.ilCommentGUI.php.

57 : string
58 {
59 throw new ilException("Call to getCommentsHTML is deprecated");
60 }
Base class for ILIAS Exception handling.

◆ getDeletedMultipleText()

ilCommentGUI::getDeletedMultipleText ( )
protected

Reimplemented from ilNoteGUI.

Definition at line 194 of file class.ilCommentGUI.php.

194 : string
195 {
196 return $this->lng->txt("notes_comments_deleted");
197 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getDeletedSingleText()

ilCommentGUI::getDeletedSingleText ( )
protected

Reimplemented from ilNoteGUI.

Definition at line 199 of file class.ilCommentGUI.php.

199 : string
200 {
201 return $this->lng->txt("notes_comment_deleted");
202 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getDeleteText()

ilCommentGUI::getDeleteText ( )
protected

Reimplemented from ilNoteGUI.

Definition at line 96 of file class.ilCommentGUI.php.

96 : string
97 {
98 return $this->lng->txt("notes_delete_comment");
99 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getFormLabelKey()

ilCommentGUI::getFormLabelKey ( )
protected

Reimplemented from ilNoteGUI.

Definition at line 91 of file class.ilCommentGUI.php.

91 : string
92 {
93 return "comment";
94 }

◆ getItemGroupTitle()

ilCommentGUI::getItemGroupTitle ( int  $obj_id = 0)
protected

Reimplemented from ilNoteGUI.

Definition at line 72 of file class.ilCommentGUI.php.

72 : string
73 {
74 if (!$this->show_header) {
75 return "";
76 }
77 return $this->lng->txt("notes_comments");
78 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getItemTitle()

ilCommentGUI::getItemTitle ( Note  $note)
protected

Reimplemented from ilNoteGUI.

Definition at line 80 of file class.ilCommentGUI.php.

80 : string
81 {
82 return $this->gui->profile()->getNamePresentation($note->getAuthor());
83 }

References ILIAS\Notes\Note\getAuthor().

+ Here is the call graph for this function:

◆ getLatestItemText()

ilCommentGUI::getLatestItemText ( )
protected

Reimplemented from ilNoteGUI.

Definition at line 101 of file class.ilCommentGUI.php.

101 : string
102 {
103 return $this->lng->txt("notes_latest_comment");
104 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getListHTML()

ilCommentGUI::getListHTML ( bool  $a_init_form = true)

Reimplemented from ilNoteGUI.

Definition at line 119 of file class.ilCommentGUI.php.

119 : string
120 {
121 $ilUser = $this->user;
123 $ilCtrl = $this->ctrl;
125
126 if ($this->ajax) {
127 $this->gui->initJavascript();
128 }
129 $ilCtrl = $this->ctrl;
130 $ilCtrl->setParameter($this, "notes_type", $this->note_type);
131
132 $content = "";
133 // #15948 - public enabled vs. comments_settings
134 $active = true;
135 // news items (in timeline) do not check, if the object has news activated!
136 if (!is_array($this->rep_obj_id) && $this->news_id === 0) {
137
138 // if common object settings are used, we check for activation
139 // 37713, 37701
140 // removed setting check due to 41511
141 //if ($this->comments_settings) {
142 $active = $this->manager->commentsActive($this->rep_obj_id);
143 //}
144 }
145 if ($active) {
146 $content = $this->getNoteListHTML($a_init_form);
147 }
148
149 // Comments Settings
150 if (!is_array($this->rep_obj_id) && $this->comments_settings && $ilUser->getId() !== ANONYMOUS_USER_ID) {
151 $active = $this->manager->commentsActive($this->rep_obj_id);
152 if ($active) {
153 if ($this->news_id === 0) {
154 $content .= $this->renderComponents([$this->getShyButton(
155 "comments_settings",
156 $lng->txt("notes_deactivate_comments"),
157 "deactivateComments",
158 ""
159 )
160 ]);
161 }
162 } else {
163 $content .= $this->renderComponents([$this->getShyButton(
164 "comments_settings",
165 $lng->txt("notes_activate_comments"),
166 "activateComments",
167 ""
168 )
169 ]);
170 /*
171 if ($this->ajax && !$comments_col) {
172 $ntpl->setVariable(
173 "COMMENTS_MESS",
174 ilUtil::getSystemMessageHTML($lng->txt("comments_feature_currently_not_activated_for_object"), "info")
175 );
176 }*/
177 }
178 }
179 return $this->renderContent($content);
180 }
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc
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...
renderComponents(array $components)
ilSetting $settings
getShyButton(string $a_var, string $a_txt, string $a_cmd, string $a_anchor="", int $note_id=0)
getNoteListHTML(bool $a_init_form=true)
renderContent(string $content)
Render content into notes wrapper.
ilObjUser $user
ilLanguage $lng
const ANONYMOUS_USER_ID
Definition: constants.php:27
global $ilSetting
Definition: privfeed.php:31

References ilNoteGUI\$ctrl, $ilSetting, ilNoteGUI\$lng, ilNoteGUI\$settings, ilNoteGUI\$user, ANONYMOUS_USER_ID, ilNoteGUI\getNoteListHTML(), ilNoteGUI\getShyButton(), ilNoteGUI\renderComponents(), ilNoteGUI\renderContent(), ilCtrl\setParameter(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ getListTitle()

ilCommentGUI::getListTitle ( )
protected

Reimplemented from ilNoteGUI.

Definition at line 184 of file class.ilCommentGUI.php.

184 : string
185 {
186 return $this->lng->txt("notes_public_comments");
187 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getNoEntriesText()

ilCommentGUI::getNoEntriesText ( bool  $search)
protected

Reimplemented from ilNoteGUI.

Definition at line 62 of file class.ilCommentGUI.php.

62 : string
63 {
64 if (!$search) {
65 $mess_txt = $this->lng->txt("notes_no_comments");
66 } else {
67 $mess_txt = $this->lng->txt("notes_no_comments_found");
68 }
69 return $mess_txt;
70 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getNotesHTML()

ilCommentGUI::getNotesHTML ( )

Reimplemented from ilNoteGUI.

Definition at line 52 of file class.ilCommentGUI.php.

52 : string
53 {
54 throw new ilException("Call to getNotesHTML is deprecated");
55 }

Field Documentation

◆ $note_type

int ilCommentGUI::$note_type = Note::PUBLIC
protected

Definition at line 28 of file class.ilCommentGUI.php.


The documentation for this class was generated from the following file: