ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 (   $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 = "" 
)

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

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().

38  {
41  $obj_id,
42  $obj_type,
43  $include_subobjects,
44  $news_id,
45  $ajax,
47  );
48  $this->enablePrivateNotes(false);
49  $this->enablePublicNotes(true);
50  }
string $obj_type
enablePrivateNotes(bool $a_enable=true)
string $search_text
__construct(Container $dic, ilPlugin $plugin)
enablePublicNotes(bool $a_enable=true)
+ Here is the call graph for this function:

Member Function Documentation

◆ addItemProperties()

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

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

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

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,)
+ Here is the call graph for this function:

◆ getAddEditItemText()

ilCommentGUI::getAddEditItemText ( )
protected

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

References ILIAS\Repository\lng().

106  : string
107  {
108  return $this->lng->txt("notes_add_edit_comment");
109  }
+ Here is the call graph for this function:

◆ getAddText()

ilCommentGUI::getAddText ( )
protected

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

References ILIAS\Repository\lng().

189  : string
190  {
191  return $this->lng->txt("note_add_comment");
192  }
+ Here is the call graph for this function:

◆ getCommentsHTML()

ilCommentGUI::getCommentsHTML ( )

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

57  : string
58  {
59  throw new ilException("Call to getCommentsHTML is deprecated");
60  }

◆ getDeletedMultipleText()

ilCommentGUI::getDeletedMultipleText ( )
protected

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

References ILIAS\Repository\lng().

194  : string
195  {
196  return $this->lng->txt("notes_comments_deleted");
197  }
+ Here is the call graph for this function:

◆ getDeletedSingleText()

ilCommentGUI::getDeletedSingleText ( )
protected

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

References ILIAS\Repository\lng().

199  : string
200  {
201  return $this->lng->txt("notes_comment_deleted");
202  }
+ Here is the call graph for this function:

◆ getDeleteText()

ilCommentGUI::getDeleteText ( )
protected

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

References ILIAS\Repository\lng().

96  : string
97  {
98  return $this->lng->txt("notes_delete_comment");
99  }
+ Here is the call graph for this function:

◆ getFormLabelKey()

ilCommentGUI::getFormLabelKey ( )
protected

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

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

◆ getItemGroupTitle()

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

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

References ILIAS\Repository\lng().

72  : string
73  {
74  if (!$this->show_header) {
75  return "";
76  }
77  return $this->lng->txt("notes_comments");
78  }
+ Here is the call graph for this function:

◆ getItemTitle()

ilCommentGUI::getItemTitle ( Note  $note)
protected

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

References ILIAS\Notes\Note\getAuthor().

80  : string
81  {
82  return $this->gui->profile()->getNamePresentation($note->getAuthor());
83  }
+ Here is the call graph for this function:

◆ getLatestItemText()

ilCommentGUI::getLatestItemText ( )
protected

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

References ILIAS\Repository\lng().

101  : string
102  {
103  return $this->lng->txt("notes_latest_comment");
104  }
+ Here is the call graph for this function:

◆ getListHTML()

ilCommentGUI::getListHTML ( bool  $a_init_form = true)

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

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().

Referenced by assQuestionGUI\getCommentsPanelHTML().

119  : string
120  {
121  $ilUser = $this->user;
122  $lng = $this->lng;
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  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
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...
getNoteListHTML(bool $a_init_form=true)
ilSetting $settings
ilLanguage $lng
ilObjUser $user
getShyButton(string $a_var, string $a_txt, string $a_cmd, string $a_anchor="", int $note_id=0)
renderContent(string $content)
Render content into notes wrapper.
global $ilSetting
Definition: privfeed.php:31
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
renderComponents(array $components)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getListTitle()

ilCommentGUI::getListTitle ( )
protected

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

References ILIAS\Repository\lng().

184  : string
185  {
186  return $this->lng->txt("notes_public_comments");
187  }
+ Here is the call graph for this function:

◆ getNoEntriesText()

ilCommentGUI::getNoEntriesText ( bool  $search)
protected

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

References ILIAS\Repository\lng().

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  }
+ Here is the call graph for this function:

◆ getNotesHTML()

ilCommentGUI::getNotesHTML ( )

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: