ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilForumTopicTableGUI Class Reference

Class ilForumTopicTableGUI. More...

+ Inheritance diagram for ilForumTopicTableGUI:
+ Collaboration diagram for ilForumTopicTableGUI:

Public Member Functions

 __construct ($a_parent_obj, $a_parent_cmd='', $template_context='', $ref_id=0, $topicData=array(), $is_moderator=false, $overview_setting='')
 
 init ()
 
 initTopicsOverviewTable ()
 
 initMergeThreadsTable ()
 
 fillRow ($thread)
 
 numericOrdering ($column)
 Currently not used because of external segmentation and sorting. More...
 
 setMapper (ilForum $mapper)
 
 getMapper ()
 
 setRefId ($ref_id)
 
 getRefId ()
 
 setOverviewSetting ($overview_setting)
 
 getOverviewSetting ()
 
 setIsModerator ($is_moderator)
 
 getIsModerator ()
 
 setTopicData ($topicData)
 
 getTopicData ()
 
 setSelectedThread (ilForumTopic $thread_obj)
 
 getSelectedThread ()
 
- Public Member Functions inherited from ilTable2GUI
 __construct ($a_parent_obj, $a_parent_cmd="", $a_template_context="")
 ilTable2GUI constructor. More...
 
 setOpenFormTag ($a_val)
 Set open form tag. More...
 
 getOpenFormTag ()
 Get open form tag. More...
 
 setCloseFormTag ($a_val)
 Set close form tag. More...
 
 getCloseFormTag ()
 Get close form tag. More...
 
 determineLimit ()
 Determine the limit. More...
 
 getSelectableColumns ()
 Get selectable columns. More...
 
 determineSelectedColumns ()
 Determine selected columns. More...
 
 isColumnSelected ($a_col)
 Is given column selected? More...
 
 getSelectedColumns ()
 Get selected columns. More...
 
 executeCommand ()
 Execute command. More...
 
 resetOffset ($a_in_determination=false)
 Reset offset. More...
 
 initFilter ()
 Init filter. More...
 
 getParentObject ()
 Get parent object. More...
 
 getParentCmd ()
 Get parent command. More...
 
 setTopAnchor ($a_val)
 Set top anchor. More...
 
 getTopAnchor ()
 Get top anchor. More...
 
 setNoEntriesText ($a_text)
 Set text for an empty table. More...
 
 getNoEntriesText ()
 Get text for an empty table. More...
 
 setIsDataTable ($a_val)
 Set is data table. More...
 
 getIsDataTable ()
 Get is data table. More...
 
 setEnableTitle ($a_enabletitle)
 Set Enable Title. More...
 
 getEnableTitle ()
 Get Enable Title. More...
 
 setEnableHeader ($a_enableheader)
 Set Enable Header. More...
 
 getEnableHeader ()
 Get Enable Header. More...
 
 setEnableNumInfo ($a_val)
 Set enable num info. More...
 
 getEnableNumInfo ()
 Get enable num info. More...
 
 setTitle ($a_title, $a_icon=0, $a_icon_alt=0)
 Set title and title icon. More...
 
 setDescription ($a_val)
 Set description. More...
 
 getDescription ()
 Get description. More...
 
 setOrderField ($a_order_field)
 set order column More...
 
 getOrderField ()
 
 setData ($a_data)
 
 getData ()
 
 dataExists ()
 
 setPrefix ($a_prefix)
 
 getPrefix ()
 
 addFilterItem ($a_input_item, $a_optional=false)
 Add filter item. More...
 
 addFilterItemByMetaType ($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=null)
 Add filter by standard type. More...
 
 getFilterItems ($a_optionals=false)
 Get filter items. More...
 
 getFilterItemByPostVar ($a_post_var)
 
 setFilterCols ($a_val)
 Set filter columns. More...
 
 getFilterCols ()
 Get filter columns. More...
 
 setDisableFilterHiding ($a_val=true)
 Set disable filter hiding. More...
 
 getDisableFilterHiding ()
 Get disable filter hiding. More...
 
 isFilterSelected ($a_col)
 Is given filter selected? More...
 
 getSelectedFilters ()
 Get selected filters. More...
 
 determineSelectedFilters ()
 Determine selected filters. More...
 
 setCustomPreviousNext ($a_prev_link, $a_next_link)
 Set custom previous/next links. More...
 
 setFormAction ($a_form_action, $a_multipart=false)
 Set Form action parameter. More...
 
 getFormAction ()
 Get Form action parameter. More...
 
 setFormName ($a_formname="")
 Set Form name. More...
 
 getFormName ()
 Get Form name. More...
 
 setId ($a_val)
 Set id. More...
 
 getId ()
 Get element id. More...
 
 setDisplayAsBlock ($a_val)
 Set display as block. More...
 
 getDisplayAsBlock ()
 Get display as block. More...
 
 getSelectAllCheckbox ()
 Get the name of the checkbox that should be toggled with a select all button. More...
 
 setSelectAllCheckbox ($a_select_all_checkbox)
 Set the name of the checkbox that should be toggled with a select all button. More...
 
 setExternalSorting ($a_val)
 Set external sorting. More...
 
 getExternalSorting ()
 Get external sorting. More...
 
 setFilterCommand ($a_val, $a_caption=null)
 Set filter command. More...
 
 getFilterCommand ()
 Get filter command. More...
 
 setResetCommand ($a_val, $a_caption=null)
 Set reset filter command. More...
 
 getResetCommand ()
 Get reset filter command. More...
 
 setExternalSegmentation ($a_val)
 Set external segmentation. More...
 
 getExternalSegmentation ()
 Get external segmentation. More...
 
 setRowTemplate ($a_template, $a_template_dir="")
 Set row template. More...
 
 setDefaultOrderField ($a_defaultorderfield)
 Set Default order field. More...
 
 getDefaultOrderField ()
 Get Default order field. More...
 
 setDefaultOrderDirection ($a_defaultorderdirection)
 Set Default order direction. More...
 
 getDefaultOrderDirection ()
 Get Default order direction. More...
 
 setDefaultFilterVisiblity ($a_status)
 Set default filter visiblity. More...
 
 getDefaultFilterVisibility ()
 Get default filter visibility. More...
 
 clearCommandButtons ()
 
 addCommandButton ($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
 Add Command button. More...
 
 addCommandButtonInstance (ilButtonBase $a_button)
 Add Command button instance. More...
 
 addSelectionButton ($a_sel_var, $a_options, $a_cmd, $a_text, $a_default_selection='')
 Add Selection List + Command button. More...
 
 addMultiItemSelectionButton ($a_sel_var, $a_options, $a_cmd, $a_text, $a_default_selection='')
 Add Selection List + Command button for selected items. More...
 
 setCloseCommand ($a_link)
 Add command for closing table. More...
 
 addMultiCommand ($a_cmd, $a_text)
 Add Command button. More...
 
 addHiddenInput ($a_name, $a_value)
 Add Hidden Input field. More...
 
 addHeaderCommand ($a_href, $a_text, $a_target="", $a_img="")
 Add Header Command (Link) (Image needed for now) More...
 
 setTopCommands ($a_val)
 Set top commands (display command buttons on top of table, too) More...
 
 getTopCommands ()
 Get top commands (display command buttons on top of table, too) More...
 
 addColumn ( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
 Add a column to the header. More...
 
 getNavParameter ()
 
 setOrderLink ($sort_field, $order_dir)
 
 fillHeader ()
 
 determineOffsetAndOrder ($a_omit_offset=false)
 Determine offset and order. More...
 
 storeNavParameter ()
 
 getHTML ()
 Get HTML. More...
 
 numericOrdering ($a_field)
 Should this field be sorted numeric? More...
 
 render ()
 render table public More...
 
 writeFilterToSession ()
 Write filter values to session. More...
 
 resetFilter ()
 Reset filter. More...
 
 fillFooter ()
 Fill footer row. More...
 
 getLinkbar ($a_num)
 Get previous/next linkbar. More...
 
 fillHiddenRow ()
 
 fillActionRow ()
 Fill Action Row. More...
 
 setHeaderHTML ($html)
 set header html More...
 
 storeProperty ($type, $value)
 Store table property. More...
 
 loadProperty ($type)
 Load table property. More...
 
 getCurrentState ()
 get current settings for order, limit, columns and filter More...
 
 setContext ($id)
 Set context. More...
 
 getContext ()
 Get context. More...
 
 setShowRowsSelector ($a_value)
 Toggle rows-per-page selector. More...
 
 getShowRowsSelector ()
 Get rows-per-page selector state. More...
 
 setShowTemplates ($a_value)
 Toggle templates. More...
 
 getShowTemplates ()
 Get template state. More...
 
 restoreTemplate ($a_name)
 Restore state from template. More...
 
 saveTemplate ($a_name)
 Save current state as template. More...
 
 deleteTemplate ($a_name)
 Delete template. More...
 
 getLimit ()
 Get limit. More...
 
 getOffset ()
 Get offset. More...
 
 setExportFormats (array $formats)
 Set available export formats. More...
 
 setPrintMode ($a_value=false)
 Toogle print mode. More...
 
 getPrintMode ()
 Get print mode. More...
 
 getExportMode ()
 Was export activated? More...
 
 exportData ($format, $send=false)
 Export and optionally send current table data. More...
 
 setEnableAllCommand ($a_value)
 Enable actions for all entries in current result. More...
 
 setRowSelectorLabel ($row_selector_label)
 
 getRowSelectorLabel ()
 
 setPreventDoubleSubmission ($a_val)
 Set prevent double submission. More...
 
 getPreventDoubleSubmission ()
 Get prevent double submission. More...
 
 setLimit ($a_limit=0, $a_default_limit=0)
 
- Public Member Functions inherited from ilTableGUI
 __construct ($a_data=0, $a_global_tpl=true)
 Constructor. More...
 
 setTemplate ($a_tpl)
 set template public More...
 
getTemplateObject ()
 
 setData ($a_data)
 set table data public More...
 
 getData ()
 
 setTitle ($a_title, $a_icon=0, $a_icon_alt=0)
 set table title public More...
 
 setHelp ($a_help_page, $a_help_icon, $a_help_icon_alt=0)
 set table help page public More...
 
 setHeaderNames ($a_header_names)
 set table header names public More...
 
 getColumnCount ()
 Returns the column count based on the number of the header row columns public. More...
 
 setHeaderVars ($a_header_vars, $a_header_params=0)
 set table header vars public More...
 
 setColumnWidth ($a_column_width)
 set table column widths public More...
 
 setOneColumnWidth ($a_column_width, $a_column_number)
 set one table column width public More...
 
 setMaxCount ($a_max_count)
 set max. More...
 
 setLimit ($a_limit=0, $a_default_limit=0)
 set max. More...
 
 getLimit ()
 Get limit. More...
 
 setPrefix ($a_prefix)
 set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort separately) public More...
 
 setOffset ($a_offset)
 set dataset offset public More...
 
 getOffset ()
 Get offset. More...
 
 setOrderColumn ($a_order_column=0, $a_default_column=0)
 set order column public More...
 
 getOrderColumn ()
 Get order column. More...
 
 setOrderDirection ($a_order_direction)
 set order direction public More...
 
 getOrderDirection ()
 Get order direction. More...
 
 setFooter ($a_style, $a_previous=0, $a_next=0)
 set order direction public More...
 
 enable ($a_module_name)
 enables particular modules of table More...
 
 disable ($a_module_name)
 diesables particular modules of table More...
 
 sortData ()
 
 render ()
 render table public More...
 
 renderHeader ()
 
 setOrderLink ($key, $order_dir)
 
 setStyle ($a_element, $a_style)
 
 getStyle ($a_element)
 
 setBase ($a_base)
 Set Base script name (deprecated, only use this for workarounds). More...
 
 getBase ()
 Get Base script name (deprecated, only use this for workarounds). More...
 
 getFormName ()
 
 setFormName ($a_name="cmd")
 
 getSelectAllCheckbox ()
 
 setSelectAllCheckbox ($a_select_all_checkbox)
 
 clearActionButtons ()
 
 addActionButton ($btn_name, $btn_value)
 

Data Fields

 $position = 1
 
 $is_post_draft_allowed = false
 
- Data Fields inherited from ilTable2GUI
const FILTER_TEXT = 1
 
const FILTER_SELECT = 2
 
const FILTER_DATE = 3
 
const FILTER_LANGUAGE = 4
 
const FILTER_NUMBER_RANGE = 5
 
const FILTER_DATE_RANGE = 6
 
const FILTER_DURATION_RANGE = 7
 
const FILTER_DATETIME_RANGE = 8
 
const FILTER_CHECKBOX = 9
 
const EXPORT_EXCEL = 1
 
const EXPORT_CSV = 2
 
const ACTION_ALL_LIMIT = 1000
 
- Data Fields inherited from ilTableGUI
 $title
 
 $icon
 
 $icon_alt
 
 $help_page
 
 $help_icon
 
 $help_icon_alt
 
 $header_names
 
 $header_vars
 
 $linkbar_vars
 
 $data
 
 $column_count
 
 $column_width
 
 $max_count
 
 $limit
 
 $max_limit = false
 
 $offset
 
 $order_column
 
 $order_direction
 
 $footer_style
 
 $footer_previous
 
 $footer_next
 
 $lang_support = true
 
 $global_tpl
 
 $form_name
 
 $select_all_checkbox
 
 $action_buttons
 
 $prefix
 
 $base = ""
 
 $enabled
 
 $styles
 

Protected Member Functions

 formatCellValue ($cell, $value)
 
- Protected Member Functions inherited from ilTable2GUI
 prepareOutput ()
 Anything that must be done before HTML is generated. More...
 
 isFilterVisible ()
 Check if filter is visible: manually shown (session, db) or default value set. More...
 
 isAdvMDFilter (ilAdvancedMDRecordGUI $a_gui, $a_element)
 Check if filter element is based on adv md. More...
 
 fillRow ($a_set)
 Standard Version of Fill Row. More...
 
 getFilterValue (ilFormPropertyGUI $a_item)
 Get current filter value. More...
 
 SetFilterValue (ilFormPropertyGUI $a_item, $a_value)
 Set current filter value. More...
 
 fillMetaExcel (ilExcel $a_excel, &$a_row)
 Add meta information to excel export. More...
 
 fillHeaderExcel (ilExcel $a_excel, &$a_row)
 Excel Version of Fill Header. More...
 
 fillRowExcel (ilExcel $a_excel, &$a_row, $a_set)
 Excel Version of Fill Row. More...
 
 fillMetaCSV ($a_csv)
 Add meta information to csv export. More...
 
 fillHeaderCSV ($a_csv)
 CSV Version of Fill Header. More...
 
 fillRowCSV ($a_csv, $a_set)
 CSV Version of Fill Row. More...
 

Protected Attributes

 $mapper
 
 $is_moderator = false
 
 $ref_id = 0
 
 $overview_setting = ''
 
 $topicData = array()
 
 $ctrl
 
 $merge_thread_obj = null
 
 $mainTemplate
 
- Protected Attributes inherited from ilTable2GUI
 $ctrl
 
 $tpl
 
 $parent_obj
 
 $parent_cmd
 
 $close_command = ""
 
 $top_anchor = "il_table_top"
 
 $filters = array()
 
 $optional_filters = array()
 
 $filter_cmd = 'applyFilter'
 
 $reset_cmd = 'resetFilter'
 
 $filter_cols = 5
 
 $ext_sort = false
 
 $ext_seg = false
 
 $context = ""
 
 $mi_sel_buttons = []
 
 $disable_filter_hiding = false
 
 $selected_filter = false
 
 $top_commands = true
 
 $selectable_columns = array()
 
 $selected_column = array()
 
 $show_templates = false
 
 $show_rows_selector = true
 
 $rows_selector_off = false
 
 $nav_determined = false
 
 $limit_determined = false
 
 $filters_determined = false
 
 $columns_determined = false
 
 $open_form_tag = true
 
 $close_form_tag = true
 
 $export_formats = []
 
 $export_mode
 
 $print_mode
 
 $enable_command_for_all
 
 $restore_filter
 
 $restore_filter_values
 
 $default_filter_visibility = false
 
 $sortable_fields = array()
 
 $prevent_double_submission = true
 
 $row_selector_label
 
 $sel_buttons = []
 
- Protected Attributes inherited from ilTableGUI
 $tpl
 
 $lng
 

Private Attributes

 $user
 
 $settings
 

Additional Inherited Members

- Static Public Member Functions inherited from ilTable2GUI
static getAllCommandLimit ()
 Get maximum number of entries to enable actions for all. More...
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilForumTopicTableGUI::__construct (   $a_parent_obj,
  $a_parent_cmd = '',
  $template_context = '',
  $ref_id = 0,
  $topicData = array(),
  $is_moderator = false,
  $overview_setting = '' 
)
Parameters
$a_parent_obj
string$a_parent_cmd
string$template_context
int$ref_id
bool$is_moderator
string$overview_setting

Definition at line 79 of file class.ilForumTopicTableGUI.php.

References $DIC, $id, $is_moderator, $overview_setting, $ref_id, $topicData, getRefId(), ilForumPostDraft\isSavePostDraftAllowed(), ilTable2GUI\setDefaultOrderDirection(), ilTable2GUI\setDefaultOrderField(), ilTable2GUI\setExternalSegmentation(), ilTable2GUI\setExternalSorting(), ilTable2GUI\setId(), setIsModerator(), setOverviewSetting(), setRefId(), settings(), setTopicData(), and user().

80  {
81  global $DIC;
82 
83  $this->lng = $DIC->language();
84  $this->ctrl = $DIC->ctrl();
85  $this->mainTemplate = $DIC->ui()->mainTemplate();
86  $this->user = $DIC->user();
87  $this->settings = $DIC->settings();
88 
89  $this->parent_cmd = $a_parent_cmd;
92  $this->setRefId($ref_id);
93  $this->setTopicData($topicData);
94 
95  // Call this immediately in constructor
96  $id = 'frm_tt_' . substr(md5($this->parent_cmd), 0, 3) . '_' . $this->getRefId();
97  $this->setId($id);
98 
99  // Let the database do the work
100  $this->setDefaultOrderDirection('DESC');
101  $this->setDefaultOrderField('lp_date');
102  $this->setExternalSorting(true);
103  $this->setExternalSegmentation(true);
104 
105  parent::__construct($a_parent_obj, $a_parent_cmd, $template_context);
106 
107  // Add global css for table styles
108  $this->mainTemplate->addCss('./Modules/Forum/css/forum_table.css');
109 
110  $this->is_post_draft_allowed = ilForumPostDraft::isSavePostDraftAllowed();
111  }
setExternalSorting($a_val)
Set external sorting.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
global $DIC
Definition: saml.php:7
setExternalSegmentation($a_val)
Set external segmentation.
if(!array_key_exists('StateId', $_REQUEST)) $id
setId($a_val)
Set id.
user()
Definition: user.php:4
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setOverviewSetting($overview_setting)
settings()
Definition: settings.php:2
+ Here is the call graph for this function:

Member Function Documentation

◆ fillRow()

ilForumTopicTableGUI::fillRow (   $thread)
Parameters
ilForumTopic$thread

Definition at line 216 of file class.ilForumTopicTableGUI.php.

References $_POST, array, ilDatePresentation\formatDate(), ilUtil\formCheckbox(), ilUtil\formRadioButton(), ilForumPostDraft\getDraftsStatisticsByRefId(), getOverviewSetting(), ilTable2GUI\getParentObject(), getRefId(), IL_CAL_DATETIME, settings(), and user().

217  {
218  $this->ctrl->setParameter($this->getParentObject(), 'thr_pk', $thread->getId());
219  if ('mergeThreads' == $this->parent_cmd) {
220  $checked = $this->max_count == 1 || (isset($_POST['thread_ids']) && in_array($thread->getId(), $_POST['thread_ids']));
221  $this->tpl->setVariable('VAL_CHECK', ilUtil::formRadioButton(
222  $checked,
223  'thread_ids[]',
224  $thread->getId()
225  ));
226  } elseif ('showThreads' == $this->parent_cmd) {
227  $this->tpl->setVariable('VAL_CHECK', ilUtil::formCheckbox(
228  (isset($_POST['thread_ids']) && in_array($thread->getId(), $_POST['thread_ids']) ? true : false),
229  'thread_ids[]',
230  $thread->getId()
231  ));
232 
233  if ($this->parent_obj->objProperties->isIsThreadRatingEnabled()) {
234  $rating = new ilRatingGUI();
235  $rating->setObject($this->parent_obj->object->getId(), $this->parent_obj->object->getType(), $thread->getId(), 'thread');
236  $rating->setUserId($this->user->getId());
237  $this->tpl->setVariable('VAL_RATING', $rating->getHTML());
238  }
239  } else {
240  if ($thread->isSticky()) {
241  $this->tpl->setVariable('VAL_SORTING_NAME', 'thread_sorting[' . $thread->getId() . ']');
242  $this->tpl->setVariable('VAL_SORTING', (int) $this->position * 10);
243  } else {
244  $this->tpl->setVariable('VAL_CHECK', '');
245  }
246  $this->position++;
247  }
248  $subject = '';
249 
250  if ($thread->isSticky()) {
251  $subject .= '<span class="light">[' . $this->lng->txt('sticky') . ']</span> ';
252  }
253  if ($thread->isClosed()) {
254  $subject .= '<span class="light">[' . $this->lng->txt('topic_close') . ']</span> ';
255  }
256 
257  if (!$this->user->isAnonymous() &&
258  $this->settings->get('forum_notification') != 0 &&
259  $thread->getUserNotificationEnabled()
260  ) {
261  $subject .= '<span class="light">[' . $this->lng->txt('forums_notification_enabled') . ']</span> ';
262  }
263 
264  $num_posts = $thread->getNumPosts();
265  $num_unread = $thread->getNumUnreadPosts();
266  $num_new = $thread->getNumNewPosts();
267 
268  if ($num_posts > 0) {
269  $subject = '<div><a href="' . $this->ctrl->getLinkTarget($this->getParentObject(), 'viewThread') . '">' . $thread->getSubject() . '</a></div>' . $subject;
270  } else {
271  $subject = $thread->getSubject() . $subject;
272  }
273  $this->tpl->setVariable('VAL_SUBJECT', $subject);
274 
275  // Author
276  $this->ctrl->setParameter($this->getParentObject(), 'backurl', urlencode($this->ctrl->getLinkTargetByClass("ilrepositorygui", "")));
277  $this->ctrl->setParameter($this->getParentObject(), 'user', $thread->getDisplayUserId());
278 
279  $authorinfo = new ilForumAuthorInformation(
280  $thread->getThrAuthorId(),
281  $thread->getDisplayUserId(),
282  $thread->getUserAlias(),
283  $thread->getImportName(),
284  array(
285  'class' => 'il_ItemProperty',
286  'href' => $this->ctrl->getLinkTarget($this->getParentObject(), 'showUser')
287  )
288  );
289  $this->tpl->setVariable('VAL_AUTHOR', $authorinfo->getLinkedAuthorName());
290 
291  $topicStats = $num_posts;
292  if (!$this->user->isAnonymous()) {
293  if ($num_unread > 0) {
294  $topicStats .= '<br /><span class="ilAlert ilWhiteSpaceNowrap">' . $this->lng->txt('unread') . ': ' . $num_unread . '</span>';
295  }
296  if ($num_new > 0 && $this->getOverviewSetting() == 0) {
297  $topicStats .= '<br /><span class="ilAlert ilWhiteSpaceNowrap">' . $this->lng->txt('new') . ': ' . $num_new . '</span>';
298  }
299  }
300 
301  $this->tpl->setVariable('VAL_ARTICLE_STATS', $topicStats);
302  $this->tpl->setVariable('VAL_NUM_VISIT', $thread->getVisits());
303  if ($this->is_post_draft_allowed) {
304  $draft_statistics = ilForumPostDraft::getDraftsStatisticsByRefId($this->getRefId());
305  $this->tpl->setVariable('VAL_DRAFTS', (int) $draft_statistics[$thread->getId()]);
306  }
307  // Last posting
308  if ($num_posts > 0) {
309  if ($thread->getLastPostForThreadOverview() instanceof ilForumPost) {
310  $objLastPost = $thread->getLastPostForThreadOverview();
311 
312  $authorinfo = new ilForumAuthorInformation(
313  $objLastPost->getPosAuthorId(),
314  $objLastPost->getDisplayUserId(),
315  $objLastPost->getUserAlias(),
316  $objLastPost->getImportName(),
317  array(
318  'href' => $this->ctrl->getLinkTarget($this->getParentObject(), 'viewThread') . '#' . $objLastPost->getId()
319  )
320  );
321 
322  $this->tpl->setVariable(
323  'VAL_LP_DATE',
324  '<div class="ilWhiteSpaceNowrap">' . ilDatePresentation::formatDate(new ilDateTime($objLastPost->getCreateDate(), IL_CAL_DATETIME)) . '</div>' .
325  '<div class="ilWhiteSpaceNowrap">' . $this->lng->txt('from') . ' ' . $authorinfo->getLinkedAuthorName() . '</div>'
326  );
327  }
328  }
329 
330  // Row style
331  $css_row = $this->css_row;
332  if ($thread->isSticky()) {
333  $css_row = $css_row == 'tblrow1' ? 'tblstickyrow1' : 'tblstickyrow2';
334  }
335  $this->tpl->setVariable('CSS_ROW', $css_row);
336 
337  $this->ctrl->setParameter($this->getParentObject(), 'thr_pk', '');
338  $this->ctrl->setParameter($this->getParentObject(), 'user', '');
339  $this->ctrl->setParameter($this->getParentObject(), 'backurl', '');
340  }
const IL_CAL_DATETIME
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
getParentObject()
Get parent object.
user()
Definition: user.php:4
Class ilRatingGUI.
Date and time handling
Create styles array
The data for the language used.
static formRadioButton($checked, $varname, $value, $onclick=null, $disabled=false)
??? public
settings()
Definition: settings.php:2
$_POST["username"]
static formCheckbox($checked, $varname, $value, $disabled=false)
??? public
static getDraftsStatisticsByRefId($ref_id)
+ Here is the call graph for this function:

◆ formatCellValue()

ilForumTopicTableGUI::formatCellValue (   $cell,
  $value 
)
protected
  • Currently not used because of external segmentation and sorting and formatting in fillRow
    Parameters
    string$cell
    mixed$value
    Returns
    mixed

Definition at line 348 of file class.ilForumTopicTableGUI.php.

349  {
350  return $value;
351  }

◆ getIsModerator()

ilForumTopicTableGUI::getIsModerator ( )
Returns
bool

Definition at line 482 of file class.ilForumTopicTableGUI.php.

References $is_moderator.

Referenced by initTopicsOverviewTable(), and numericOrdering().

+ Here is the caller graph for this function:

◆ getMapper()

ilForumTopicTableGUI::getMapper ( )
Returns
ilForum

Definition at line 428 of file class.ilForumTopicTableGUI.php.

References $mapper.

Referenced by numericOrdering().

429  {
430  return $this->mapper;
431  }
+ Here is the caller graph for this function:

◆ getOverviewSetting()

ilForumTopicTableGUI::getOverviewSetting ( )
Returns
string

Definition at line 464 of file class.ilForumTopicTableGUI.php.

References $overview_setting.

Referenced by fillRow().

+ Here is the caller graph for this function:

◆ getRefId()

ilForumTopicTableGUI::getRefId ( )
Returns
int

Definition at line 446 of file class.ilForumTopicTableGUI.php.

References $ref_id.

Referenced by __construct(), fillRow(), and numericOrdering().

447  {
448  return $this->ref_id;
449  }
+ Here is the caller graph for this function:

◆ getSelectedThread()

ilForumTopicTableGUI::getSelectedThread ( )
Returns
ilForumTopic

Definition at line 516 of file class.ilForumTopicTableGUI.php.

References $merge_thread_obj.

Referenced by initMergeThreadsTable(), and numericOrdering().

+ Here is the caller graph for this function:

◆ getTopicData()

ilForumTopicTableGUI::getTopicData ( )
Returns
array

Definition at line 500 of file class.ilForumTopicTableGUI.php.

References $topicData.

501  {
502  return $this->topicData;
503  }

◆ init()

ilForumTopicTableGUI::init ( )

Definition at line 113 of file class.ilForumTopicTableGUI.php.

References initMergeThreadsTable(), and initTopicsOverviewTable().

114  {
115  if ($this->parent_cmd == 'mergeThreads') {
116  $this->initMergeThreadsTable();
117  } else {
118  $this->initTopicsOverviewTable();
119  }
120  }
+ Here is the call graph for this function:

◆ initMergeThreadsTable()

ilForumTopicTableGUI::initMergeThreadsTable ( )

Definition at line 181 of file class.ilForumTopicTableGUI.php.

References ilTable2GUI\addColumn(), ilTable2GUI\addCommandButton(), ilTableGUI\disable(), getSelectedThread(), ilUtil\sendInfo(), ilTable2GUI\setFormAction(), ilTable2GUI\setRowSelectorLabel(), ilTable2GUI\setRowTemplate(), ilTable2GUI\setShowRowsSelector(), and ilTable2GUI\setTitle().

Referenced by init().

182  {
183  // Columns
184  $this->addColumn('', 'check', '1px', true);
185  $this->addColumn($this->lng->txt('forums_thread'), 'th_title');
186  $this->addColumn($this->lng->txt('forums_created_by'), 'author');
187  $this->addColumn($this->lng->txt('forums_articles'), 'num_posts');
188  $this->addColumn($this->lng->txt('visits'), 'num_visit');
189  if ($this->is_post_draft_allowed) {
190  $this->addColumn($this->lng->txt('drafts', ''));
191  }
192  $this->addColumn($this->lng->txt('forums_last_post'), 'lp_date');
193 
194  // Disable sorting
195  $this->disable('sort');
196 
197  // Default Form Action
198  $this->setFormAction($this->ctrl->getFormAction($this->getParentObject(), 'confirmMergeThreads'));
199 
200  // Row template
201  $this->setRowTemplate('tpl.forums_threads_table.html', 'Modules/Forum');
202 
203  ilUtil::sendInfo($this->lng->txt('please_choose_target'));
204 
205  $this->setTitle(sprintf($this->lng->txt('frm_selected_merge_src'), $this->getSelectedThread()->getSubject()));
206 
207  $this->addCommandButton('confirmMergeThreads', $this->lng->txt('merge'));
208  $this->addCommandButton('showThreads', $this->lng->txt('cancel'));
209  $this->setShowRowsSelector(true);
210  $this->setRowSelectorLabel($this->lng->txt('number_of_threads'));
211  }
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
setRowSelectorLabel($row_selector_label)
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
disable($a_module_name)
diesables particular modules of table
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initTopicsOverviewTable()

ilForumTopicTableGUI::initTopicsOverviewTable ( )

Definition at line 125 of file class.ilForumTopicTableGUI.php.

References ilTable2GUI\addColumn(), ilTable2GUI\addCommandButton(), ilTable2GUI\addMultiCommand(), getIsModerator(), ilTable2GUI\setFormAction(), ilTable2GUI\setRowSelectorLabel(), ilTable2GUI\setRowTemplate(), ilTable2GUI\setSelectAllCheckbox(), ilTable2GUI\setShowRowsSelector(), settings(), and user().

Referenced by init().

126  {
127  if ($this->parent_cmd == "showThreads") {
128  $this->setSelectAllCheckbox('thread_ids');
129  $this->addColumn('', 'check', '1px', true);
130  } else {
131  $this->addColumn('', 'check', '10px', true);
132  }
133 
134  $this->addColumn($this->lng->txt('forums_thread'), 'thr_subject');
135  $this->addColumn($this->lng->txt('forums_created_by'), '');
136  $this->addColumn($this->lng->txt('forums_articles'), 'num_posts');
137  $this->addColumn($this->lng->txt('visits'), 'num_visit');
138 
139  if ($this->is_post_draft_allowed) {
140  $this->addColumn($this->lng->txt('drafts', ''));
141  }
142 
143  $this->addColumn($this->lng->txt('forums_last_post'), 'post_date');
144  if ('showThreads' == $this->parent_cmd && $this->parent_obj->objProperties->isIsThreadRatingEnabled()) {
145  $this->addColumn($this->lng->txt('frm_rating'), 'rating');
146  }
147 
148  // Default Form Action
149  $this->setFormAction($this->ctrl->getFormAction($this->getParentObject(), 'showThreads'));
150 
151  // Row template
152  $this->setRowTemplate('tpl.forums_threads_table.html', 'Modules/Forum');
153 
154  if ($this->parent_cmd == 'sortThreads') {
155  $this->addCommandButton('saveThreadSorting', $this->lng->txt('save'));
156  } else {
157  // Multi commands
158  $this->addMultiCommand('', $this->lng->txt('please_choose'));
159  if ($this->settings->get('forum_notification') > 0 && !$this->user->isAnonymous()) {
160  $this->addMultiCommand('enable_notifications', $this->lng->txt('forums_enable_notification'));
161  $this->addMultiCommand('disable_notifications', $this->lng->txt('forums_disable_notification'));
162  }
163  if ($this->getIsModerator()) {
164  $this->addMultiCommand('makesticky', $this->lng->txt('make_topics_sticky'));
165  $this->addMultiCommand('unmakesticky', $this->lng->txt('make_topics_non_sticky'));
166  $this->addMultiCommand('editThread', $this->lng->txt('frm_edit_title'));
167  $this->addMultiCommand('close', $this->lng->txt('close_topics'));
168  $this->addMultiCommand('reopen', $this->lng->txt('reopen_topics'));
169  $this->addMultiCommand('move', $this->lng->txt('move_thread_to_forum'));
170  }
171  $this->addMultiCommand('html', $this->lng->txt('export_html'));
172  if ($this->getIsModerator()) {
173  $this->addMultiCommand('confirmDeleteThreads', $this->lng->txt('delete'));
174  $this->addMultiCommand('merge', $this->lng->txt('merge_posts_into_thread'));
175  }
176  }
177  $this->setShowRowsSelector(true);
178  $this->setRowSelectorLabel($this->lng->txt('number_of_threads'));
179  }
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
setRowSelectorLabel($row_selector_label)
user()
Definition: user.php:4
addMultiCommand($a_cmd, $a_text)
Add Command button.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
settings()
Definition: settings.php:2
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ numericOrdering()

ilForumTopicTableGUI::numericOrdering (   $column)

◆ setIsModerator()

ilForumTopicTableGUI::setIsModerator (   $is_moderator)
Parameters
bool$is_moderator
Returns
ilForumTopicTableGUI

Definition at line 473 of file class.ilForumTopicTableGUI.php.

References $is_moderator.

Referenced by __construct().

474  {
475  $this->is_moderator = $is_moderator;
476  return $this;
477  }
+ Here is the caller graph for this function:

◆ setMapper()

ilForumTopicTableGUI::setMapper ( ilForum  $mapper)
Parameters
ilForum$mapper
Returns
ilForumTopicTableGUI

Definition at line 419 of file class.ilForumTopicTableGUI.php.

References $mapper.

420  {
421  $this->mapper = $mapper;
422  return $this;
423  }

◆ setOverviewSetting()

ilForumTopicTableGUI::setOverviewSetting (   $overview_setting)
Parameters
string$overview_setting
Returns
ilForumTopicTableGUI

Definition at line 455 of file class.ilForumTopicTableGUI.php.

References $overview_setting.

Referenced by __construct().

456  {
457  $this->overview_setting = $overview_setting;
458  return $this;
459  }
+ Here is the caller graph for this function:

◆ setRefId()

ilForumTopicTableGUI::setRefId (   $ref_id)
Parameters
int$ref_id
Returns
ilForumTopicTableGUI

Definition at line 437 of file class.ilForumTopicTableGUI.php.

References $ref_id.

Referenced by __construct().

438  {
439  $this->ref_id = $ref_id;
440  return $this;
441  }
+ Here is the caller graph for this function:

◆ setSelectedThread()

ilForumTopicTableGUI::setSelectedThread ( ilForumTopic  $thread_obj)
Parameters
ilForumTopic$thread_obj

Definition at line 508 of file class.ilForumTopicTableGUI.php.

509  {
510  $this->merge_thread_obj = $thread_obj;
511  }

◆ setTopicData()

ilForumTopicTableGUI::setTopicData (   $topicData)
Parameters
array$topicData
Returns
ilForumTopicTableGUI

Definition at line 491 of file class.ilForumTopicTableGUI.php.

References $topicData.

Referenced by __construct().

492  {
493  $this->topicData = $topicData;
494  return $this;
495  }
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilForumTopicTableGUI::$ctrl
protected

Definition at line 46 of file class.ilForumTopicTableGUI.php.

◆ $is_moderator

ilForumTopicTableGUI::$is_moderator = false
protected

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

Referenced by __construct(), getIsModerator(), and setIsModerator().

◆ $is_post_draft_allowed

ilForumTopicTableGUI::$is_post_draft_allowed = false

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

◆ $mainTemplate

ilForumTopicTableGUI::$mainTemplate
protected

Definition at line 66 of file class.ilForumTopicTableGUI.php.

◆ $mapper

ilForumTopicTableGUI::$mapper
protected

Definition at line 21 of file class.ilForumTopicTableGUI.php.

Referenced by getMapper(), and setMapper().

◆ $merge_thread_obj

ilForumTopicTableGUI::$merge_thread_obj = null
protected

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

Referenced by getSelectedThread().

◆ $overview_setting

ilForumTopicTableGUI::$overview_setting = ''
protected

◆ $position

ilForumTopicTableGUI::$position = 1

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

◆ $ref_id

ilForumTopicTableGUI::$ref_id = 0
protected

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

Referenced by __construct(), getRefId(), and setRefId().

◆ $settings

ilForumTopicTableGUI::$settings
private

Definition at line 69 of file class.ilForumTopicTableGUI.php.

◆ $topicData

ilForumTopicTableGUI::$topicData = array()
protected

Definition at line 41 of file class.ilForumTopicTableGUI.php.

Referenced by __construct(), getTopicData(), and setTopicData().

◆ $user

ilForumTopicTableGUI::$user
private

Definition at line 68 of file class.ilForumTopicTableGUI.php.


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