ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjForumListGUI Class Reference

Class ilObjForumListGUI. More...

+ Inheritance diagram for ilObjForumListGUI:
+ Collaboration diagram for ilObjForumListGUI:

Public Member Functions

 __construct ()
 
 init ()
 
 setChildId (int $a_child_id)
 
 getChildId ()
 
 getProperties ()
 
 getCommandFrame (string $cmd)
 
 getCommandLink (string $cmd)
 
- Public Member Functions inherited from ilObjectListGUI
 setContainerObject (object $container_obj)
 
 getContainerObject ()
 
 init ()
 initialisation More...
 
 enableProperties (bool $status)
 
 getPropertiesStatus ()
 
 enablePreconditions (bool $status)
 
 getPreconditionsStatus ()
 
 enableNoticeProperties (bool $status)
 
 getNoticePropertiesStatus ()
 
 enableDescription (bool $status)
 
 getDescriptionStatus ()
 
 enableSearchFragments (bool $status)
 
 getSearchFragmentStatus ()
 
 enableLinkedPath (bool $status)
 
 enableRelevance (bool $status)
 
 enabledRelevance ()
 
 setRelevance (int $rel)
 
 getRelevance ()
 
 enableIcon (bool $status)
 
 getIconStatus ()
 
 enableCheckbox (bool $status)
 
 getCheckboxStatus ()
 
 enableExpand (bool $status)
 
 getExpandStatus ()
 
 setExpanded (bool $status)
 
 isExpanded ()
 
 setPositionInputField (string $field_index, string $position_value)
 
 enableDelete (bool $status)
 
 getDeleteStatus ()
 
 enableCut (bool $status)
 
 getCutStatus ()
 
 enableCopy (bool $status)
 
 getCopyStatus ()
 
 enableSubscribe (bool $status)
 
 getSubscribeStatus ()
 
 enableLink (bool $status)
 
 getLinkStatus ()
 
 enablePath (bool $path, int $start_node=0, \ilPathGUI $path_gui=null)
 
 getPathStatus ()
 
 enableCommands (bool $status, bool $std_only=false)
 
 getCommandsStatus ()
 
 enableInfoScreen (bool $info_screen)
 
 getInfoScreenStatus ()
 
 addSubItemHTML (string $html)
 Add HTML for sub item (used for sessions) More...
 
 enableProgressInfo (bool $status)
 
 getProgressInfoStatus ()
 
 enableSubstitutions (bool $status)
 
 getSubstitutionStatus ()
 
 enableItemDetailLinks (bool $status)
 enable item detail links E.g Direct links to chapters or pages More...
 
 getItemDetailLinkStatus ()
 get item detail link status More...
 
 setItemDetailLinks (array $detail_links, string $intro_txt='')
 set items detail links More...
 
 insertItemDetailLinks ()
 
 setTitle (string $title)
 
 getTitle ()
 getTitle overwritten in class.ilObjLinkResourceList.php More...
 
 setDescription (string $description)
 
 getDescription ()
 getDescription overwritten in class.ilObjLinkResourceList.php More...
 
 setSearchFragment (string $text)
 
 getSearchFragment ()
 
 setSeparateCommands (bool $val)
 
 getSeparateCommands ()
 
 getCommandId ()
 get command id Normally the ref id. More...
 
 setAdditionalInformation (?string $val)
 
 getAdditionalInformation ()
 
 setDetailsLevel (int $level)
 Details level Currently used in Search which shows only limited properties of forums Currently used for Sessions (switch between minimal and extended view for each session) More...
 
 getDetailsLevel ()
 
 enableRepositoryTransfer (bool $value)
 Enable copy/move to repository (from personal workspace) More...
 
 restrictToGoto (bool $value)
 Restrict all actions/links to goto. More...
 
 getDefaultCommand ()
 
 checkCommandAccess (string $permission, string $cmd, int $ref_id, string $type, ?int $obj_id=null)
 
 initItem (int $ref_id, int $obj_id, string $type, string $title="", string $description="")
 initialize new item (is called by getItemHTML()) More...
 
 setConditionTarget (int $ref_id, int $obj_id, string $target_type)
 
 resetConditionTarget ()
 
 disableTitleLink (bool $status)
 
 setDefaultCommandParameters (array $params)
 
 createDefaultCommand (array $command)
 Get default command link Overwritten for e.g categories,courses => they return a goto link If search engine visibility is enabled these object type return a goto_CLIENT_ID_cat_99.html link. More...
 
 getCommandLink (string $cmd)
 Get command link url. More...
 
 getCommandFrame (string $cmd)
 Get command target frame. More...
 
 getCommandImage (string $cmd)
 Get command icon image. More...
 
 getProperties ()
 Get item properties. More...
 
 addCustomProperty (string $property="", string $value="", bool $alert=false, bool $newline=false)
 
 getCustomProperties (array $prop)
 
 getAlertProperties ()
 
 getNoticeProperties ()
 
 addCustomCommand (string $link, string $lang_var, string $frame="", string $onclick="")
 
 addCustomCommandButton (Button $button, ?Modal $triggeredModal=null)
 
 forceVisibleOnly (bool $stat)
 
 isVisibleOnlyForced ()
 
 getCommands ()
 get all current commands for a specific ref id (in the permission context of the current user) More...
 
 getIconImageType ()
 Returns the icon image type. More...
 
 insertTitle ()
 
 insertSubstitutions ()
 
 insertDescription ()
 
 insertSearchFragment ()
 Insert highlighted search fragment. More...
 
 insertRelevance ()
 
 setMode (string $mode)
 set output mode More...
 
 getMode ()
 get output mode More...
 
 setConditionDepth (int $depth)
 set depth for precondition output (stops at level 5) More...
 
 isMode (string $mode)
 check current output mode More...
 
 determineProperties ()
 
 insertProperties ()
 
 insertNoticeProperties ()
 
 insertPreconditions ()
 insert all missing preconditions More...
 
 insertCommand (string $href, string $text, string $frame="", string $img="", string $cmd="", string $onclick="")
 insert command button More...
 
 insertDeleteCommand ()
 
 insertLinkCommand ()
 
 insertCutCommand (bool $to_repository=false)
 
 insertCopyCommand (bool $to_repository=false)
 
 insertPasteCommand ()
 
 insertSubscribeCommand ()
 
 insertInfoScreenCommand ()
 
 insertCommonSocialCommands (bool $header_actions=false)
 Insert common social commands (comments, notes, tagging) More...
 
 insertTimingsCommand ()
 
 insertCommands (bool $use_async=false, bool $get_async_commands=false, string $async_url="", bool $header_actions=false)
 insert all commands into html code More...
 
 enableComments (bool $value, bool $enable_comments_settings=true)
 
 enableNotes (bool $value)
 
 enableTags (bool $value)
 
 enableRating (bool $value, string $text=null, bool $categories=false, array $ctrl_path=null, bool $force_rate_parent=false)
 
 enableMultiDownload (bool $value)
 Toggles whether multiple objects can be downloaded at once or not. More...
 
 insertMultiDownloadCommand ()
 
 enableDownloadCheckbox (int $ref_id)
 
 getDownloadCheckboxState ()
 
 setHeaderSubObject (?string $type, ?int $id)
 
 addHeaderIcon (string $id, string $img, string $tooltip=null, string $onclick=null, string $status_text=null, string $href=null)
 
 addHeaderIconHTML (string $id, string $html)
 
 addHeaderGlyph (string $id, ILIAS\UI\Component\Symbol\Glyph\Glyph $glyph, $onclick=null)
 
 setAjaxHash (string $hash)
 
 getHeaderAction (ilGlobalTemplateInterface $main_tpl=null)
 
 appendRepositoryFrameParameter (string $link)
 workaround: all links into the repository (from outside) must tell repository to set up the frameset More...
 
 modifySAHSlaunch (string $link, string $wtarget)
 workaround: SAHS in new javavasript-created window or iframe More...
 
 insertPath ()
 
 insertProgressInfo ()
 
 insertIconsAndCheckboxes ()
 
 getTypeIcon ()
 Get object type specific type icon. More...
 
 insertSubItems ()
 
 insertPositionField ()
 
 adminCommandsIncluded ()
 returns whether any admin commands (link, delete, cut) are included in the output More...
 
 storeAccessCache ()
 
 getListItemHTML (int $ref_id, int $obj_id, string $title, string $description, bool $use_async=false, bool $get_async_commands=false, string $async_url="")
 Get all item information (title, commands, description) in HTML. More...
 
 setParentRefId (int $ref_id)
 Set current parent ref id to enable unique js-ids (sessions, etc.) More...
 
 getUniqueItemId (bool $as_div=false)
 Get unique item identifier (for js-actions) More...
 
 getCommandsHTML ()
 Get commands HTML (must be called after get list item html) More...
 
 isSideBlock ()
 Returns whether current item is a block in a side column or not. More...
 
 setBoldTitle (bool $bold_title)
 
 isTitleBold ()
 
 enableTimings (bool $status)
 enable timings link More...
 
 getAsListItem (int $ref_id, int $obj_id, string $type, string $title, string $description)
 Get list item ui object. More...
 
 getAsCard (int $ref_id, int $obj_id, string $type, string $title, string $description)
 Get card object. More...
 
 checkInfoPageOnAsynchronousRendering ()
 
 insertLPCommand ()
 insert learning progress command More...
 

Private Attributes

int $child_id
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectListGUI
static prepareJsLinks (string $redraw_url, string $notes_url, string $tags_url, ilGlobalTemplateInterface $tpl=null)
 Insert js/ajax links into template. More...
 
static preloadCommonProperties (array $obj_ids, int $context)
 
- Data Fields inherited from ilObjectListGUI
const IL_LIST_AS_TRIGGER = "trigger"
 
const IL_LIST_FULL = "full"
 
const DETAILS_MINIMAL = 10
 
const DETAILS_SEARCH = 20
 
const DETAILS_ALL = 30
 
const CONTEXT_REPOSITORY = 1
 
const CONTEXT_WORKSPACE = 2
 
const CONTEXT_WORKSPACE_SHARING = 4
 
const CONTEXT_PERSONAL_DESKTOP = 5
 
const CONTEXT_SEARCH = 6
 
const DOWNLOAD_CHECKBOX_NONE = 0
 
const DOWNLOAD_CHECKBOX_ENABLED = 1
 
const DOWNLOAD_CHECKBOX_DISABLED = 2
 
- Protected Member Functions inherited from ilObjectListGUI
 enableLearningProgress (bool $enabled)
 
 buildGotoLink ()
 
 parseConditions (int $toggle_id, array $conditions, bool $obligatory=true)
 
 modifyTitleLink (string $default_link)
 
 resetCustomData ()
 reset properties and commands More...
 
 isCommentsActivated (string $type, int $ref_id, int $obj_id, bool $header_actions, bool $check_write_access=true)
 Check comments status against comments settings and context. More...
 
 getTileImagePath ()
 
- Protected Attributes inherited from ilObjectListGUI
bool $force_rate_parent = false
 
array $access_cache
 
ilAccessHandler $access
 
ilObjUser $user
 
ilObjectDefinition $obj_definition
 
ilTree $tree
 
ilSetting $settings
 
UIServices $ui
 
ilRbacSystem $rbacsystem
 
ilCtrlInterface $ctrl
 
ilLanguage $lng
 
string $mode
 
bool $path_enabled
 
int $context
 
ilObjectService $object_service
 
ILIAS HTTP Wrapper RequestWrapper $request_wrapper
 
ILIAS Refinery Factory $refinery
 
bool $static_link_enabled = false
 
bool $delete_enabled = false
 
bool $cut_enabled = false
 
bool $subscribe_enabled = false
 
bool $link_enabled = false
 
bool $copy_enabled = true
 
bool $progress_enabled = false
 
bool $notice_properties_enabled = true
 
bool $info_screen_enabled = false
 
string $type
 
string $gui_class_name = ""
 
array $commands = []
 
ilLDAPRoleGroupMapping $ldap_mapping
 
ilFavouritesManager $fav_manager
 
int $requested_ref_id
 
string $requested_cmd
 
string $requested_base_class
 
ClipboardManager $clipboard
 
bool $description_enabled = true
 
bool $preconditions_enabled = true
 
bool $properties_enabled = true
 
bool $commands_enabled = true
 
array $cust_prop = []
 
array $cust_commands = []
 
array $cust_modals = []
 
int $condition_depth = 0
 
bool $std_cmd_only = false
 
array $sub_item_html = []
 
bool $multi_download_enabled = false
 
int $download_checkbox_state = self::DOWNLOAD_CHECKBOX_NONE
 
int $obj_id
 
int $ref_id
 
int $sub_obj_id
 
string $sub_obj_type
 
ilAdvancedMDSubstitution $substitutions = null
 
bool $substitutions_enabled = false
 
bool $icons_enabled = false
 
bool $checkboxes_enabled = false
 
bool $position_enabled = false
 
bool $item_detail_links_enabled = false
 
array $item_detail_links = []
 
string $item_detail_links_intro = ''
 
bool $search_fragments_enabled = false
 
string $search_fragment = ''
 
bool $path_linked = false
 
bool $enabled_relevance = false
 
int $relevance = 0
 
bool $expand_enabled = false
 
bool $is_expanded = true
 
bool $bold_title = false
 
int $details_level = self::DETAILS_ALL
 
int $reference_ref_id = 0
 
int $reference_obj_id = null
 
bool $separate_commands = false
 
bool $search_fragment_enabled = false
 
string $additional_information = ""
 
bool $repository_transfer_enabled = false
 
bool $shared = false
 
bool $restrict_to_goto = false
 
bool $comments_enabled = false
 
bool $comments_settings_enabled = false
 
bool $notes_enabled = false
 
bool $tags_enabled = false
 
bool $rating_enabled = false
 
bool $rating_categories_enabled = false
 
string $rating_text = null
 
array $rating_ctrl_path = null
 
bool $timings_enabled = true
 
bool $force_visible_only = false
 
array $prevent_duplicate_commands = []
 
int $parent_ref_id
 
string $title_link = ''
 
bool $title_link_disabled = false
 
bool $lp_cmd_enabled = false
 
ilAdvancedSelectionListGUI $current_selection_list
 
ilPathGUI $path_gui = null
 
array $default_command_params = []
 
array $header_icons = []
 
object $container_obj = null
 
ilTemplate $tpl
 
string $position_value
 
int $path_start_node
 
array $default_command = []
 
bool $adm_commands_included
 
bool $prevent_access_caching
 
array $condition_target
 
array $notice_prop = []
 
string $ajax_hash
 
ilListItemAccessCache $acache
 
string $position_field_index = ""
 
string $title = ""
 
string $description = ""
 
ilWorkspaceAccessHandler $ws_access
 
- Static Protected Attributes inherited from ilObjectListGUI
static array $cnt_notes = []
 
static array $cnt_tags = []
 
static array $tags = []
 
static array $comments_activation = []
 
static bool $preload_done = false
 
static int $js_unique_id = 0
 
static string $tpl_file_name = "tpl.container_list_item.html"
 
static string $tpl_component = "Services/Container"
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjForumListGUI::__construct ( )

Definition at line 31 of file class.ilObjForumListGUI.php.

References ILIAS\GlobalScreen\Provider\__construct().

32  {
34  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ getChildId()

ilObjForumListGUI::getChildId ( )

Definition at line 56 of file class.ilObjForumListGUI.php.

References $child_id.

Referenced by getCommandLink().

56  : int
57  {
58  return $this->child_id;
59  }
+ Here is the caller graph for this function:

◆ getCommandFrame()

ilObjForumListGUI::getCommandFrame ( string  $cmd)

Definition at line 180 of file class.ilObjForumListGUI.php.

References ilFrameTargetInfo\_getFrame().

180  : string
181  {
182  return ilFrameTargetInfo::_getFrame('MainContent');
183  }
static _getFrame(string $a_class)
+ Here is the call graph for this function:

◆ getCommandLink()

ilObjForumListGUI::getCommandLink ( string  $cmd)

Definition at line 185 of file class.ilObjForumListGUI.php.

References getChildId().

185  : string
186  {
187  switch ($cmd) {
188  case 'thread':
189  return (
190  'ilias.php?baseClass=' . ilRepositoryGUI::class . '&cmd=viewThread&cmdClass=' .
191  ilObjForumGUI::class . '&ref_id=' . $this->ref_id . '&thr_pk=' . $this->getChildId()
192  );
193 
194  case 'posting':
195  $thread_post = $this->getChildId();
196  // TODO PHP 8 This cannot be correct, an id which is used as an array (don't know what is the correct code here) ...
197  return (
198  'ilias.php?baseClass=' . ilRepositoryGUI::class . '&cmd=viewThread&cmdClass=' .
199  ilObjForumGUI::class . '&target=1&ref_id=' . $this->ref_id . '&thr_pk=' .
200  $thread_post[0] . '&pos_pk=' . $thread_post[1] . '#' . $thread_post[1]
201  );
202 
203  default:
204  return parent::getCommandLink($cmd);
205  }
206  }
+ Here is the call graph for this function:

◆ getProperties()

ilObjForumListGUI::getProperties ( )

Definition at line 61 of file class.ilObjForumListGUI.php.

References ilFrameTargetInfo\_getFrame(), ilObjectListGUI\DETAILS_ALL, ilDatePresentation\formatDate(), ilForumProperties\FORUM_OVERVIEW_WITH_NEW_POSTS, ilObjectListGUI\getDetailsLevel(), ilForumPostDraft\getDraftsStatisticsByRefId(), ilForumProperties\getInstance(), ilObjForumAccess\getLastPostByRefId(), ilObjForumAccess\getStatisticsByRefId(), IL_CAL_DATETIME, ILIAS\Repository\int(), ilForumPostDraft\isSavePostDraftAllowed(), ILIAS\Repository\lng(), ilObject\lookupOfflineStatus(), ilObjForumAccess\prepareMessageForLists(), and ILIAS\Repository\user().

61  : array
62  {
63  $props = [];
64 
65  $maySee = $this->rbacsystem->checkAccess('visible', $this->ref_id);
66  $mayRead = $this->rbacsystem->checkAccess('read', $this->ref_id);
67 
68  if (!$maySee && !$mayRead) {
69  return $props;
70  }
71 
72  $props = parent::getProperties();
73 
74  if (!$mayRead || ilObject::lookupOfflineStatus($this->obj_id)) {
75  return $props;
76  }
77 
78  $this->lng->loadLanguageModule('forum');
79 
80  $properties = ilObjForumAccess::getStatisticsByRefId($this->ref_id);
81  $num_posts_total = $properties['num_posts'];
82  $num_unread_total = $properties['num_unread_posts'];
83 
84  $num_drafts_total = 0;
86  $drafts_statistics = ilForumPostDraft::getDraftsStatisticsByRefId($this->ref_id);
87  $num_drafts_total = $drafts_statistics['total'];
88  }
89 
90  $frm_overview_setting = (int) (new ilSetting('frma'))->get(
91  'forum_overview',
93  );
94  $num_new_total = 0;
95  if ($frm_overview_setting === ilForumProperties::FORUM_OVERVIEW_WITH_NEW_POSTS) {
96  $num_new_total = $properties['num_new_posts'];
97  }
98 
99  if (!$this->user->isAnonymous()) {
101  $props[] = [
102  'alert' => false,
103  'property' => $this->lng->txt('forums_articles') . ' (' . $this->lng->txt('unread') . ')',
104  'value' => $num_posts_total . ' (' . $num_unread_total . ')'
105  ];
106  if ($frm_overview_setting === ilForumProperties::FORUM_OVERVIEW_WITH_NEW_POSTS && $num_new_total > 0) {
107  $props[] = [
108  'alert' => false,
109  'property' => $this->lng->txt('forums_new_articles'),
110  'value' => $num_new_total
111  ];
112  }
113  }
114 
115  if ($num_drafts_total > 0 && ilForumPostDraft::isSavePostDraftAllowed()) {
116  $props[] = [
117  'alert' => false,
118  'property' => $this->lng->txt('drafts'),
119  'value' => $num_drafts_total
120  ];
121  }
122  } else {
123  $props[] = [
124  'alert' => false,
125  'property' => $this->lng->txt('forums_articles'),
126  'value' => $num_posts_total
127  ];
128  }
129 
130  if (
132  ilForumProperties::getInstance($this->obj_id)->isAnonymized()
133  ) {
134  $props[] = [
135  'alert' => false,
136  'newline' => false,
137  'property' => $this->lng->txt('forums_anonymized'),
138  'value' => $this->lng->txt('yes')
139  ];
140  }
141 
142  $last_post = ilObjForumAccess::getLastPostByRefId($this->ref_id);
143  if (is_array($last_post) && $last_post['pos_pk'] > 0) {
144  $lpCont = "<a class=\"il_ItemProperty\" target=\"" . ilFrameTargetInfo::_getFrame('MainContent') .
145  "\" href=\"ilias.php?baseClass=" . ilRepositoryGUI::class . "&amp;cmd=viewThread&amp;cmdClass=" .
146  ilObjForumGUI::class . "&amp;target=true&amp;pos_pk=" .
147  $last_post['pos_pk'] . "&amp;thr_pk=" . $last_post['pos_thr_fk'] . "&amp;ref_id=" .
148  $this->ref_id . "#" . $last_post["pos_pk"] . "\">" .
149  ilObjForumAccess::prepareMessageForLists($last_post['pos_message']) . "</a> " .
150  strtolower($this->lng->txt('from')) . "&nbsp;";
151 
152  $authorinfo = new ilForumAuthorInformation(
153  (int) $last_post['pos_author_id'],
154  (int) $last_post['pos_display_user_id'],
155  (string) $last_post['pos_usr_alias'],
156  (string) $last_post['import_name'],
157  [
158  'class' => 'il_ItemProperty',
159  'href' => 'ilias.php?baseClass=' . ilRepositoryGUI::class . '&amp;cmd=showUser&amp;' .
160  'cmdClass=' . ilObjForumGUI::class . '&amp;ref_id=' . $this->ref_id . '&amp;' .
161  'user=' . $last_post['pos_display_user_id'] . '&amp;offset=0&amp;backurl=' .
162  urlencode('ilias.php?baseClass=' . ilRepositoryGUI::class . '&amp;ref_id=' . $this->ref_id)
163  ]
164  );
165 
166  $lpCont .= $authorinfo->getLinkedAuthorName();
167  $lpCont .= ', ' . ilDatePresentation::formatDate(new ilDateTime($last_post['pos_date'], IL_CAL_DATETIME));
168 
169  $props[] = [
170  'alert' => false,
171  'newline' => true,
172  'property' => $this->lng->txt('forums_last_post'),
173  'value' => $lpCont
174  ];
175  }
176 
177  return $props;
178  }
static getLastPostByRefId(int $ref_id)
static getStatisticsByRefId(int $ref_id)
const IL_CAL_DATETIME
static prepareMessageForLists(string $text)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
static getInstance(int $a_obj_id=0)
static lookupOfflineStatus(int $obj_id)
Lookup offline status using objectDataCache.
static getDraftsStatisticsByRefId(int $ref_id)
static _getFrame(string $a_class)
+ Here is the call graph for this function:

◆ init()

ilObjForumListGUI::init ( )

Definition at line 36 of file class.ilObjForumListGUI.php.

References ilObjForumAccess\_getCommands().

36  : void
37  {
38  $this->static_link_enabled = true;
39  $this->delete_enabled = true;
40  $this->cut_enabled = true;
41  $this->copy_enabled = true;
42  $this->subscribe_enabled = true;
43  $this->link_enabled = true;
44  $this->info_screen_enabled = true;
45  $this->type = 'frm';
46  $this->gui_class_name = ilObjForumGUI::class;
47 
48  $this->commands = ilObjForumAccess::_getCommands();
49  }
+ Here is the call graph for this function:

◆ setChildId()

ilObjForumListGUI::setChildId ( int  $a_child_id)

Definition at line 51 of file class.ilObjForumListGUI.php.

51  : void
52  {
53  $this->child_id = $a_child_id;
54  }

Field Documentation

◆ $child_id

int ilObjForumListGUI::$child_id
private

Definition at line 29 of file class.ilObjForumListGUI.php.

Referenced by getChildId().


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