ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilMailFolderTableGUI Class Reference
+ Inheritance diagram for ilMailFolderTableGUI:
+ Collaboration diagram for ilMailFolderTableGUI:

Public Member Functions

 __construct ( $a_parent_obj, $a_current_folder_id, $a_parent_cmd, bool $isTrashFolder, bool $isSentFolder, bool $isDraftsFolder, Factory $uiFactory=null, Renderer $uiRenderer=null)
 Constructor. More...
 
 getSelectableColumns ()
 
 prepareHTML ()
 Call this before using getHTML() More...
 
 isDraftFolder ()
 
 isSentFolder ()
 
 isTrashFolder ()
 
 setSelectedItems (array $a_selected_items)
 
 getSelectedItems ()
 
 setNumberOfMails (int $a_number_of_mails)
 
 getNumberOfMails ()
 
 initFilter ()
 
 writeFilterToSession ()
 
 resetFilter ()
 
 getHTML ()
 
- 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, $a_select_all_on_top=false)
 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)
 

Protected Member Functions

 isColumnVisible (int $index)
 
 fillRow ($a_set)
 
 removeInvisibleFields (array $row)
 
 getColumnDefinition ()
 
 shouldUseLuceneSearch ()
 
 fetchTableData ()
 
 setTitleData (string $folderLabel, int $mailCount, int $unreadCount, string $imgFolder)
 
 formatActionsDropDown (array $mail)
 
 addViewRowAction (array $mail, array &$buttons)
 
 addReplyRowAction (array $mail, array &$buttons)
 
 addForwardRowAction (array $mail, array &$buttons)
 
 addPrintRowAction (array $mail, array &$buttons)
 
- 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

 $_folderNode = []
 
 $_parentObject = null
 
 $_currentFolderId = 0
 
 $_number_of_mails = 0
 
 $_selectedItems = []
 
 $_isTrashFolder = false
 
 $_isDraftsFolder = false
 
 $_isSentFolder = false
 
 $user
 
 $filter = []
 
 $sub_filter = []
 
 $visibleOptionalColumns = []
 
 $optionalColumns = []
 
 $optional_filter = []
 
- 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
 
 $select_all_on_top = false
 
 $sel_buttons = []
 
- Protected Attributes inherited from ilTableGUI
 $tpl
 
 $lng
 

Private Member Functions

 initCommandButtons ()
 
 initMultiCommands (array $actions)
 
 isLuceneEnabled ()
 

Private Attributes

 $uiFactory
 
 $uiRenderer
 
 $column_definition = null
 

Additional Inherited Members

- Static Public Member Functions inherited from ilTable2GUI
static getAllCommandLimit ()
 Get maximum number of entries to enable actions for all. More...
 
- 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
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilMailFolderTableGUI::__construct (   $a_parent_obj,
  $a_current_folder_id,
  $a_parent_cmd,
bool  $isTrashFolder,
bool  $isSentFolder,
bool  $isDraftsFolder,
Factory  $uiFactory = null,
Renderer  $uiRenderer = null 
)

Constructor.

Parameters
$a_parent_objPass an instance of ilObjectGUI
integer$a_current_folder_idId of the current mail box folder
string$a_parent_cmdCommand for the parent class
Factory | null$uiFactory
Renderer | null$uiRenderer

Definition at line 59 of file class.ilMailFolderTableGUI.php.

References $DIC, $uiFactory, $uiRenderer, ILIAS\GlobalScreen\Provider\__construct(), ilTable2GUI\getParentObject(), ilTable2GUI\setDefaultOrderDirection(), ilTable2GUI\setDefaultOrderField(), ilTable2GUI\setEnableTitle(), ilTable2GUI\setExternalSegmentation(), ilTable2GUI\setExternalSorting(), ilTable2GUI\setFilterCommand(), ilTable2GUI\setFormAction(), ilTable2GUI\setId(), ilTable2GUI\setPrefix(), ilTable2GUI\setResetCommand(), ilTable2GUI\setRowTemplate(), ilTable2GUI\setSelectAllCheckbox(), and user().

68  {
69  global $DIC;
70 
71  $this->user = $DIC->user();
72 
73  if (null === $uiFactory) {
74  $uiFactory = $DIC->ui()->factory();
75  }
76  if (null === $uiRenderer) {
77  $uiRenderer = $DIC->ui()->renderer();
78  }
79  $this->uiFactory = $uiFactory;
80  $this->uiRenderer = $uiRenderer;
81 
82  $this->_currentFolderId = $a_current_folder_id;
83  $this->_parentObject = $a_parent_obj;
84 
85  $this->_isTrashFolder = $isTrashFolder;
86  $this->_isSentFolder = $isSentFolder;
87  $this->_isDraftsFolder = $isDraftsFolder;
88 
89  $this->setId('mail_folder_tbl_' . $a_current_folder_id);
90  $this->setPrefix('mtable');
91 
92  $this->setExternalSorting(true);
93  $this->setExternalSegmentation(true);
94  $this->setDefaultOrderField('send_time');
95  $this->setDefaultOrderDirection('desc');
96 
97  parent::__construct($a_parent_obj, $a_parent_cmd);
98 
99  $this->ctrl->setParameter($this->getParentObject(), 'mobj_id', $this->_currentFolderId);
100  $this->setFormAction($this->ctrl->getFormAction($this->getParentObject(), 'showFolder'));
101  $this->ctrl->clearParameters($this->getParentObject());
102 
103  $this->setEnableTitle(true);
104  $this->setSelectAllCheckbox('mail_id[]');
105  $this->setRowTemplate('tpl.mail_folder_row.html', 'Services/Mail');
106 
107  $this->setFilterCommand('applyFilter');
108  $this->setResetCommand('resetFilter');
109  }
setExternalSorting($a_val)
Set external sorting.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
setExternalSegmentation($a_val)
Set external segmentation.
getParentObject()
Get parent object.
setId($a_val)
Set id.
user()
Definition: user.php:4
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setResetCommand($a_val, $a_caption=null)
Set reset filter command.
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
setPrefix($a_prefix)
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
__construct(Container $dic, ilPlugin $plugin)
$DIC
Definition: xapitoken.php:46
setEnableTitle($a_enabletitle)
Set Enable Title.
setFilterCommand($a_val, $a_caption=null)
Set filter command.
+ Here is the call graph for this function:

Member Function Documentation

◆ addForwardRowAction()

ilMailFolderTableGUI::addForwardRowAction ( array  $mail,
array &  $buttons 
)
protected
Parameters
array$mail
array$buttons

Definition at line 869 of file class.ilMailFolderTableGUI.php.

References isDraftFolder().

Referenced by formatActionsDropDown().

869  : void
870  {
871  if (!$this->isDraftFolder()) {
872  $this->ctrl->setParameterByClass('ilmailformgui', 'mobj_id', $this->_currentFolderId);
873  $this->ctrl->setParameterByClass('ilmailformgui', 'mail_id', (int) $mail['mail_id']);
874  $this->ctrl->setParameterByClass('ilmailformgui', 'type', 'forward');
875  $forwardButton = $this->uiFactory
876  ->link()
877  ->standard(
878  $this->lng->txt('forward'),
879  $this->ctrl->getLinkTargetByClass('ilmailformgui')
880  );
881  $this->ctrl->clearParametersByClass('ilmailformgui');
882 
883  $buttons[] = $forwardButton;
884  }
885  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addPrintRowAction()

ilMailFolderTableGUI::addPrintRowAction ( array  $mail,
array &  $buttons 
)
protected
Parameters
array$mail
array$buttons

Definition at line 891 of file class.ilMailFolderTableGUI.php.

References ilTable2GUI\getParentObject(), and isDraftFolder().

Referenced by formatActionsDropDown().

891  : void
892  {
893  if (!$this->isDraftFolder()) {
894  $this->ctrl->setParameter($this->getParentObject(), 'mobj_id', $this->_currentFolderId);
895  $this->ctrl->setParameter($this->getParentObject(), 'mail_id', (int) $mail['mail_id']);
896  $printButton = $this->uiFactory
897  ->link()
898  ->standard(
899  $this->lng->txt('print'),
900  $this->ctrl->getLinkTarget($this->getParentObject(), 'printMail')
901  )->withOpenInNewViewport(true);
902  $this->ctrl->clearParameters($this->getParentObject());
903 
904  $buttons[] = $printButton;
905  }
906  }
getParentObject()
Get parent object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addReplyRowAction()

ilMailFolderTableGUI::addReplyRowAction ( array  $mail,
array &  $buttons 
)
protected
Parameters
array$mail
array$buttons

Definition at line 845 of file class.ilMailFolderTableGUI.php.

References isDraftFolder().

Referenced by formatActionsDropDown().

845  : void
846  {
847  if (!$this->isDraftFolder()) {
848  if (isset($mail['sender_id']) && $mail['sender_id'] > 0 && $mail['sender_id'] != ANONYMOUS_USER_ID) {
849  $this->ctrl->setParameterByClass('ilmailformgui', 'mobj_id', $this->_currentFolderId);
850  $this->ctrl->setParameterByClass('ilmailformgui', 'mail_id', (int) $mail['mail_id']);
851  $this->ctrl->setParameterByClass('ilmailformgui', 'type', 'reply');
852  $replyButton = $this->uiFactory
853  ->link()
854  ->standard(
855  $this->lng->txt('reply'),
856  $this->ctrl->getLinkTargetByClass('ilmailformgui')
857  );
858  $this->ctrl->clearParametersByClass('ilmailformgui');
859 
860  $buttons[] = $replyButton;
861  }
862  }
863  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addViewRowAction()

ilMailFolderTableGUI::addViewRowAction ( array  $mail,
array &  $buttons 
)
protected
Parameters
array$mail
array$buttons

Definition at line 813 of file class.ilMailFolderTableGUI.php.

References ilTable2GUI\getParentObject(), and isDraftFolder().

Referenced by formatActionsDropDown().

813  : void
814  {
815  if ($this->isDraftFolder()) {
816  $this->ctrl->setParameterByClass('ilmailformgui', 'mail_id', (int) $mail['mail_id']);
817  $this->ctrl->setParameterByClass('ilmailformgui', 'mobj_id', $this->_currentFolderId);
818  $this->ctrl->setParameterByClass('ilmailformgui', 'type', 'draft');
819  $viewButton = $this->uiFactory
820  ->link()
821  ->standard(
822  $this->lng->txt('view'),
823  $this->ctrl->getLinkTargetByClass('ilmailformgui')
824  );
825  $this->ctrl->clearParametersByClass('ilmailformgui');
826  } else {
827  $this->ctrl->setParameter($this->getParentObject(), 'mail_id', (int) $mail['mail_id']);
828  $this->ctrl->setParameter($this->getParentObject(), 'mobj_id', $this->_currentFolderId);
829  $viewButton = $this->uiFactory
830  ->link()
831  ->standard(
832  $this->lng->txt('view'),
833  $this->ctrl->getLinkTarget($this->getParentObject(), 'showMail')
834  );
835  $this->ctrl->clearParameters($this->getParentObject());
836  }
837 
838  $buttons[] = $viewButton;
839  }
getParentObject()
Get parent object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fetchTableData()

ilMailFolderTableGUI::fetchTableData ( )
protected
Returns
$this
Exceptions
Exception

Definition at line 422 of file class.ilMailFolderTableGUI.php.

References $_currentFolderId, ilTableGUI\$data, Vendor\Package\$e, ilMailBoxQuery\$filter, ilMailBoxQuery\$filtered_ids, ilMailBoxQuery\$folderId, ilMailBoxQuery\$limit, ilMailBoxQuery\$offset, ilMailBoxQuery\$orderColumn, ilMailBoxQuery\$orderDirection, $result, $user, ilMailBoxQuery\$userId, ilMailBoxQuery\_getMailBoxListData(), ilTable2GUI\determineOffsetAndOrder(), formatActionsDropDown(), ilDatePresentation\formatDate(), ilUtil\getImagePath(), ilTable2GUI\getLimit(), ilTable2GUI\getOffset(), ilTableGUI\getOrderDirection(), ilTable2GUI\getOrderField(), ilTable2GUI\getParentObject(), getSelectedItems(), ilMailUserCache\getUserObjectById(), ilUtil\htmlencodePlainString(), IL_CAL_DATETIME, isDraftFolder(), isSentFolder(), ilMailUserCache\preloadUserObjects(), ilTable2GUI\resetOffset(), ilTable2GUI\setData(), ilTableGUI\setMaxCount(), setNumberOfMails(), setTitleData(), shouldUseLuceneSearch(), and user().

Referenced by prepareHTML().

422  : self
423  {
424  if ($this->_folderNode['m_type'] === 'user_folder') {
425  $txt_folder = $this->_folderNode['title'];
426  $img_folder = 'icon_user_folder.png';
427  } else {
428  $txt_folder = $this->lng->txt('mail_' . $this->_folderNode['title']);
429  $img_folder = 'icon' . substr($this->_folderNode['title'], 1) . '.png';
430  }
431 
432  try {
433  if ($this->shouldUseLuceneSearch()) {
434  $query_parser = new ilMailLuceneQueryParser($this->filter['mail_filter']);
435  $query_parser->setFields([
436  'title' => (bool) $this->filter['mail_filter_subject'],
437  'content' => (bool) $this->filter['mail_filter_body'],
438  'mattachment' => (bool) $this->filter['mail_filter_attach'],
439  'msender' => (bool) $this->filter['mail_filter_sender'],
440  'mrcp' => (bool) $this->filter['mail_filter_recipients']
441  ]);
442  $query_parser->parse();
443 
444  $result = new ilMailSearchResult();
445  $searcher = new ilMailLuceneSearcher($query_parser, $result);
446  $searcher->search($this->user->getId(), $this->_currentFolderId);
447 
448  if (!$result->getIds()) {
449  throw new ilException('mail_search_empty_result');
450  }
451 
454  'mail_filter_only_unread' => $this->filter['mail_filter_only_unread'],
455  'mail_filter_only_with_attachments' => $this->filter['mail_filter_only_with_attachments'],
456  ];
457  } else {
458  ilMailBoxQuery::$filter = (array) $this->filter;
459  }
460 
461  if (
462  isset(ilMailBoxQuery::$filter['mail_filter_only_unread']) &&
463  ($this->isDraftFolder() || $this->isSentFolder())
464  ) {
465  unset(ilMailBoxQuery::$filter['mail_filter_only_unread']);
466  }
467 
468  if (isset(ilMailBoxQuery::$filter['mail_filter_only_with_attachments']) && $this->isDraftFolder()) {
469  unset(ilMailBoxQuery::$filter['mail_filter_only_with_attachments']);
470  }
471 
472  $this->determineOffsetAndOrder();
473 
475  ilMailBoxQuery::$userId = $this->user->getId();
476  ilMailBoxQuery::$limit = $this->getLimit();
481 
482  if (!count($data['set']) && $this->getOffset() > 0) {
483  $this->resetOffset();
484 
485  ilMailBoxQuery::$limit = $this->getLimit();
488  }
489  } catch (Exception $e) {
490  if ('mail_search_empty_result' === $e->getMessage()) {
491  $data['set'] = [];
492  $data['cnt'] = 0;
493  $data['cnt_unread'] = 0;
494  } else {
495  throw $e;
496  }
497  }
498 
499  if (!$this->isDraftFolder() && !$this->isSentFolder()) {
500  $user_ids = [];
501  foreach ($data['set'] as $mail) {
502  if ($mail['sender_id'] && $mail['sender_id'] != ANONYMOUS_USER_ID) {
503  $user_ids[$mail['sender_id']] = $mail['sender_id'];
504  }
505  }
506 
508  }
509 
510  $counter = 0;
511  foreach ($data['set'] as $key => $mail) {
512  ++$counter;
513 
514  if (is_array($this->getSelectedItems()) && in_array($mail['mail_id'], $this->getSelectedItems(), false)) {
515  $mail['checked'] = ' checked="checked" ';
516  }
517 
518  if ($this->isDraftFolder() || $this->isSentFolder()) {
519  $mail['rcp_to'] = $mail['mail_login'] = ilUtil::htmlencodePlainString(
520  $this->_parentObject->umail->formatNamesForOutput((string) $mail['rcp_to']),
521  false
522  );
523  } else {
524  if ($mail['sender_id'] == ANONYMOUS_USER_ID) {
525  $mail['img_sender'] = ilUtil::getImagePath('HeaderIconAvatar.svg');
526  $mail['from'] = $mail['mail_login'] = $mail['alt_sender'] = htmlspecialchars(ilMail::_getIliasMailerName());
527  } else {
528  $user = ilMailUserCache::getUserObjectById($mail['sender_id']);
529 
530  if ($user) {
531  $mail['img_sender'] = $user->getPersonalPicturePath('xxsmall');
532  $mail['from'] = $mail['mail_login'] = $mail['alt_sender'] = htmlspecialchars($user->getPublicName());
533  } else {
534  $mail['img_sender'] = '';
535  $mail['from'] = $mail['mail_login'] = $mail['import_name'] . ' (' . $this->lng->txt('user_deleted') . ')';
536  }
537  }
538  }
539 
540  if ($this->isDraftFolder()) {
541  $this->ctrl->setParameterByClass('ilmailformgui', 'mail_id', $mail['mail_id']);
542  $this->ctrl->setParameterByClass('ilmailformgui', 'mobj_id', $this->_currentFolderId);
543  $this->ctrl->setParameterByClass('ilmailformgui', 'type', 'draft');
544  $link_mark_as_read = $this->ctrl->getLinkTargetByClass('ilmailformgui');
545  $this->ctrl->clearParametersByClass('ilmailformgui');
546  } else {
547  $this->ctrl->setParameter($this->getParentObject(), 'mail_id', $mail['mail_id']);
548  $this->ctrl->setParameter($this->getParentObject(), 'mobj_id', $this->_currentFolderId);
549  $link_mark_as_read = $this->ctrl->getLinkTarget($this->getParentObject(), 'showMail');
550  $this->ctrl->clearParameters($this->getParentObject());
551  }
552  $css_class = $mail['m_status'] === 'read' ? 'mailread' : 'mailunread';
553 
554  if ($this->shouldUseLuceneSearch()) {
555  $search_result = array();
556  foreach ($result->getFields($mail['mail_id']) as $content) {
557  if ('title' === $content[0]) {
558  $mail['msr_subject_link_read'] = $link_mark_as_read;
559  $mail['msr_subject_mailclass'] = $css_class;
560  $mail['msr_subject'] = $content[1];
561  } else {
562  $search_result[] = $content[1];
563  }
564  }
565  $mail['msr_data'] = implode('', array_map(function ($value) {
566  return '<p>' . $value . '</p>';
567  }, $search_result));
568 
569  if (!$mail['msr_subject']) {
570  $mail['msr_subject_link_read'] = $link_mark_as_read;
571  $mail['msr_subject_mailclass'] = $css_class;
572  $mail['msr_subject'] = htmlspecialchars($mail['m_subject']);
573  }
574  } else {
575  $mail['mail_link_read'] = $link_mark_as_read;
576  $mail['mailclass'] = $css_class;
577  $mail['mail_subject'] = htmlspecialchars($mail['m_subject']);
578  }
579 
580  $mail['mail_date'] = ilDatePresentation::formatDate(new ilDateTime($mail['send_time'], IL_CAL_DATETIME));
581 
582  $mail['attachment_indicator'] = '';
583  if (is_array($mail['attachments']) && count($mail['attachments']) > 0) {
584  $this->ctrl->setParameter($this->getParentObject(), 'mail_id', (int) $mail['mail_id']);
585  if ($this->isDraftFolder()) {
586  $this->ctrl->setParameter($this->getParentObject(), 'type', 'draft');
587  }
588  $this->ctrl->setParameter($this->getParentObject(), 'mobj_id', $this->_currentFolderId);
589  $mail['attachment_indicator'] = $this->uiRenderer->render(
590  $this->uiFactory->symbol()->glyph()->attachment(
591  $this->ctrl->getLinkTarget($this->getParentObject(), 'deliverAttachments')
592  )
593  );
594  $this->ctrl->clearParameters($this->getParentObject());
595  }
596 
597  $mail['actions'] = $this->formatActionsDropDown($mail);
598 
599  $data['set'][$key] = $mail;
600  }
601 
602  $this->setData($data['set']);
603  $this->setMaxCount((int) $data['cnt']);
604  $this->setNumberOfMails((int) $data['cnt']);
605 
606  $this->setTitleData($txt_folder, (int) $data['cnt'], (int) $data['cnt_unread'], $img_folder);
607 
608  return $this;
609  }
const IL_CAL_DATETIME
$result
setTitleData(string $folderLabel, int $mailCount, int $unreadCount, string $imgFolder)
static _getMailBoxListData()
_getMailBoxListData
resetOffset($a_in_determination=false)
Reset offset.
getOrderDirection()
Get order direction.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
getParentObject()
Get parent object.
user()
Definition: user.php:4
getOffset()
Get offset.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static preloadUserObjects(array $usr_ids)
static getUserObjectById($usr_id)
setNumberOfMails(int $a_number_of_mails)
determineOffsetAndOrder($a_omit_offset=false)
Determine offset and order.
getLimit()
Get limit.
static htmlencodePlainString($a_str, $a_make_links_clickable, $a_detect_goto_links=false)
Encodes a plain text string into HTML for display in a browser.
setMaxCount($a_max_count)
set max.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillRow()

ilMailFolderTableGUI::fillRow (   $a_set)
finalprotected

Definition at line 153 of file class.ilMailFolderTableGUI.php.

References removeInvisibleFields().

154  {
155  foreach ($this->removeInvisibleFields($a_set) as $key => $value) {
156  $this->tpl->setVariable(strtoupper($key), $value);
157  }
158  }
+ Here is the call graph for this function:

◆ formatActionsDropDown()

ilMailFolderTableGUI::formatActionsDropDown ( array  $mail)
protected
Parameters
array$mail
Returns
string

Definition at line 792 of file class.ilMailFolderTableGUI.php.

References addForwardRowAction(), addPrintRowAction(), addReplyRowAction(), and addViewRowAction().

Referenced by fetchTableData().

792  : string
793  {
794  $buttons = [];
795 
796  $this->addViewRowAction($mail, $buttons);
797  $this->addReplyRowAction($mail, $buttons);
798  $this->addForwardRowAction($mail, $buttons);
799  $this->addPrintRowAction($mail, $buttons);
800 
801  $dropDown = $this->uiFactory
802  ->dropdown()
803  ->standard($buttons)
804  ->withLabel($this->lng->txt('actions'));
805 
806  return $this->uiRenderer->render([$dropDown]);
807  }
addForwardRowAction(array $mail, array &$buttons)
addReplyRowAction(array $mail, array &$buttons)
addViewRowAction(array $mail, array &$buttons)
addPrintRowAction(array $mail, array &$buttons)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getColumnDefinition()

ilMailFolderTableGUI::getColumnDefinition ( )
protected
Returns
array

Definition at line 182 of file class.ilMailFolderTableGUI.php.

References $column_definition, $columns, $i, isDraftFolder(), isSentFolder(), and shouldUseLuceneSearch().

Referenced by getSelectableColumns(), isColumnVisible(), and prepareHTML().

182  : array
183  {
184  if ($this->column_definition !== null) {
186  }
187 
188  $i = 0;
189 
190  $columns = [];
191 
192  $columns[++$i] = [
193  'field' => 'chb',
194  'txt' => '',
195  'default' => true,
196  'optional' => false,
197  'sortable' => false,
198  'is_checkbox' => true,
199  'width' => '1%'
200  ];
201 
202  $columns[++$i] = [
203  'field' => 'attachments',
204  'txt' => $this->lng->txt('mail_tbl_head_attachments'),
205  'default' => false,
206  'optional' => true,
207  'sortable' => false,
208  'width' => '5%'
209  ];
210 
211  if (!$this->isDraftFolder() && !$this->isSentFolder()) {
212  $columns[++$i] = [
213  'field' => 'personal_picture',
214  'txt' => $this->lng->txt('personal_picture'),
215  'default' => true,
216  'optional' => true,
217  'sortable' => false,
218  'width' => '5%'
219  ];
220  }
221 
222  if ($this->isDraftFolder() || $this->isSentFolder()) {
223  $columns[++$i] = [
224  'field' => 'rcp_to',
225  'txt' => $this->lng->txt('recipient'),
226  'default' => true,
227  'optional' => false,
228  'sortable' => true,
229  'width' => '35%'
230  ];
231  } else {
232  $columns[++$i] = [
233  'field' => 'from',
234  'txt' => $this->lng->txt('sender'),
235  'default' => true,
236  'optional' => false,
237  'sortable' => true,
238  'width' => '20%'
239  ];
240  }
241 
242  if ($this->shouldUseLuceneSearch()) {
243  $columns[++$i] = [
244  'field' => 'search_content',
245  'txt' => $this->lng->txt('search_content'),
246  'default' => true,
247  'optional' => false,
248  'sortable' => false,
249  'width' => '35%'
250  ];
251  } else {
252  $columns[++$i] = [
253  'field' => 'm_subject',
254  'txt' => $this->lng->txt('subject'),
255  'default' => true,
256  'optional' => false,
257  'sortable' => true,
258  'width' => '35%'
259  ];
260  }
261 
262  $columns[++$i] = [
263  'field' => 'send_time',
264  'txt' => $this->lng->txt('date'),
265  'default' => true,
266  'optional' => false,
267  'sortable' => true,
268  'width' => '20%'
269  ];
270 
271  $columns[++$i] = [
272  'field' => 'actions',
273  'txt' => $this->lng->txt('actions'),
274  'default' => true,
275  'optional' => false,
276  'sortable' => false,
277  'width' => '5%'
278  ];
279 
280  $this->column_definition = $columns;
282  }
if(! $in) $columns
Definition: Utf8Test.php:45
$i
Definition: metadata.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHTML()

ilMailFolderTableGUI::getHTML ( )

Definition at line 911 of file class.ilMailFolderTableGUI.php.

References ilTable2GUI\getParentObject().

912  {
913  $this->ctrl->setParameter($this->getParentObject(), 'mobj_id', $this->_currentFolderId);
914  $html = parent::getHTML();
915  $this->ctrl->clearParameters($this->getParentObject());
916 
917  return $html;
918  }
getParentObject()
Get parent object.
+ Here is the call graph for this function:

◆ getNumberOfMails()

ilMailFolderTableGUI::getNumberOfMails ( )
Returns
int

Definition at line 647 of file class.ilMailFolderTableGUI.php.

References $_number_of_mails.

Referenced by initCommandButtons().

647  : int
648  {
650  }
+ Here is the caller graph for this function:

◆ getSelectableColumns()

ilMailFolderTableGUI::getSelectableColumns ( )
Returns
array

Definition at line 114 of file class.ilMailFolderTableGUI.php.

References $columns, $index, $optionalColumns, and getColumnDefinition().

Referenced by prepareHTML().

115  {
116  $optionalColumns = array_filter($this->getColumnDefinition(), function ($column) {
117  return isset($column['optional']) && $column['optional'];
118  });
119 
120  $columns = array();
121  foreach ($optionalColumns as $index => $column) {
122  $columns[$column['field']] = $column;
123  }
124 
125  return $columns;
126  }
$index
Definition: metadata.php:128
if(! $in) $columns
Definition: Utf8Test.php:45
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelectedItems()

ilMailFolderTableGUI::getSelectedItems ( )
Returns
array

Definition at line 388 of file class.ilMailFolderTableGUI.php.

References $_selectedItems.

Referenced by fetchTableData().

388  : array
389  {
390  return $this->_selectedItems;
391  }
+ Here is the caller graph for this function:

◆ initCommandButtons()

ilMailFolderTableGUI::initCommandButtons ( )
private
Returns
ilMailFolderTableGUI

Definition at line 335 of file class.ilMailFolderTableGUI.php.

References ilTable2GUI\addCommandButton(), and getNumberOfMails().

Referenced by prepareHTML().

335  : self
336  {
337  if ($this->_folderNode['m_type'] === 'trash' && $this->getNumberOfMails() > 0) {
338  $this->addCommandButton('confirmEmptyTrash', $this->lng->txt('mail_empty_trash'));
339  }
340 
341  return $this;
342  }
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFilter()

ilMailFolderTableGUI::initFilter ( )

Definition at line 655 of file class.ilMailFolderTableGUI.php.

References ilTable2GUI\addFilterItem(), IL_CAL_UNIX, isDraftFolder(), isLuceneEnabled(), isSentFolder(), ilDateDurationInputGUI\setAllowOpenIntervals(), ilCheckboxInputGUI\setOptionTitle(), ilTextInputGUI\setSubmitFormOnEnter(), and ilCheckboxInputGUI\setValue().

Referenced by ilMailFolderGUI\getMailFolderTable().

656  {
657  $this->filter = [];
658 
659  $quickFilter = new ilMailQuickFilterInputGUI($this->lng->txt('mail_filter'), 'mail_filter');
660  $quickFilter->setSubmitFormOnEnter(false);
661  $this->addFilterItem($quickFilter);
662  $quickFilter->readFromSession();
663  $this->filter['mail_filter'] = $quickFilter->getValue();
664 
665  if ($this->isDraftFolder() || $this->isSentFolder()) {
666  $this->sub_filter[] = $subFilterInRecipients = new ilCheckboxInputGUI(
667  $this->lng->txt('mail_filter_recipients'),
668  'mail_filter_recipients'
669  );
670  $subFilterInRecipients->setOptionTitle($this->lng->txt('mail_filter_recipients'));
671  $subFilterInRecipients->setValue(1);
672  $quickFilter->addSubItem($subFilterInRecipients);
673  $subFilterInRecipients->setParent($this);
674  $subFilterInRecipients->readFromSession();
675  $this->filter['mail_filter_recipients'] = (int) $subFilterInRecipients->getChecked();
676  } else {
677  $this->sub_filter[] = $subFilterInSender = new ilCheckboxInputGUI(
678  $this->lng->txt('mail_filter_sender'),
679  'mail_filter_sender'
680  );
681  $subFilterInSender->setOptionTitle($this->lng->txt('mail_filter_sender'));
682  $subFilterInSender->setValue(1);
683  $quickFilter->addSubItem($subFilterInSender);
684  $subFilterInSender->setParent($this);
685  $subFilterInSender->readFromSession();
686  $this->filter['mail_filter_sender'] = (int) $subFilterInSender->getChecked();
687  }
688 
689  $this->sub_filter[] = $subFilterInSubject = new ilCheckboxInputGUI(
690  $this->lng->txt('mail_filter_subject'),
691  'mail_filter_subject'
692  );
693  $subFilterInSubject->setOptionTitle($this->lng->txt('mail_filter_subject'));
694  $subFilterInSubject->setValue(1);
695  $quickFilter->addSubItem($subFilterInSubject);
696  $subFilterInSubject->setParent($this);
697  $subFilterInSubject->readFromSession();
698  $this->filter['mail_filter_subject'] = (int) $subFilterInSubject->getChecked();
699 
700  $this->sub_filter[] = $subFilterInBody = new ilCheckboxInputGUI(
701  $this->lng->txt('mail_filter_body'),
702  'mail_filter_body'
703  );
704  $subFilterInBody->setOptionTitle($this->lng->txt('mail_filter_body'));
705  $subFilterInBody->setValue(1);
706  $quickFilter->addSubItem($subFilterInBody);
707  $subFilterInBody->setParent($this);
708  $subFilterInBody->readFromSession();
709  $this->filter['mail_filter_body'] = (int) $subFilterInBody->getChecked();
710 
711  if ($this->isLuceneEnabled()) {
712  $this->sub_filter[] = $subFilterInAttachments = new ilCheckboxInputGUI(
713  $this->lng->txt('mail_filter_attach'),
714  'mail_filter_attach'
715  );
716  $subFilterInAttachments->setOptionTitle($this->lng->txt('mail_filter_attach'));
717  $subFilterInAttachments->setValue(1);
718  $quickFilter->addSubItem($subFilterInAttachments);
719  $subFilterInAttachments->setParent($this);
720  $subFilterInAttachments->readFromSession();
721  $this->filter['mail_filter_attach'] = (int) $subFilterInAttachments->getChecked();
722  }
723 
724  if (!$this->isDraftFolder() && !$this->isSentFolder()) {
725  $onlyUnread = new ilCheckboxInputGUI(
726  $this->lng->txt('mail_filter_only_unread'),
727  'mail_filter_only_unread'
728  );
729  $onlyUnread->setValue(1);
730  $this->addFilterItem($onlyUnread);
731  $onlyUnread->readFromSession();
732  $this->filter['mail_filter_only_unread'] = (int) $onlyUnread->getChecked();
733  }
734 
735  if (!$this->isDraftFolder()) {
736  $onlyWithAttachments = new ilCheckboxInputGUI(
737  $this->lng->txt('mail_filter_only_with_attachments'),
738  'mail_filter_only_with_attachments'
739  );
740  $onlyWithAttachments->setValue(1);
741  $this->addFilterItem($onlyWithAttachments);
742  $onlyWithAttachments->readFromSession();
743  $this->filter['mail_filter_only_with_attachments'] = (int) $onlyWithAttachments->getChecked();
744  }
745 
746  $duration = new ilDateDurationInputGUI($this->lng->txt('mail_filter_period'), 'period');
747  $duration->setAllowOpenIntervals(true);
748  $duration->setStartText($this->lng->txt('mail_filter_period_from'));
749  $duration->setEndText($this->lng->txt('mail_filter_period_until'));
750  $duration->setStart(new ilDateTime(null, IL_CAL_UNIX));
751  $duration->setEnd(new ilDateTime(null, IL_CAL_UNIX));
752  $duration->setShowTime(false);
753  $this->addFilterItem($duration);
754  $duration->readFromSession();
755  $this->filter['period'] = $duration->getValue();
756  }
setSubmitFormOnEnter($a_val)
Set submit form on enter.
setAllowOpenIntervals(bool $allowOpenInterval)
This class represents a checkbox property in a property form.
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
const IL_CAL_UNIX
input GUI for a time span (start and end date)
setValue($a_value)
Set Value.
setOptionTitle($a_optiontitle)
Set Option Title (optional).
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initMultiCommands()

ilMailFolderTableGUI::initMultiCommands ( array  $actions)
private
Parameters
$actions
Returns
ilMailFolderTableGUI

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

References ilTable2GUI\addMultiCommand(), and isTrashFolder().

Referenced by prepareHTML().

348  : self
349  {
350  foreach ($actions as $key => $action) {
351  if ($key === 'moveMails') {
352  $folders = $this->_parentObject->mbox->getSubFolders();
353  foreach ($folders as $folder) {
354  if ($folder['type'] !== 'trash' || !$this->isTrashFolder()) {
355  if ($folder['type'] !== 'user_folder') {
356  $label = $action . ' ' . $this->lng->txt('mail_' . $folder['title']) .
357  ($folder['type'] === 'trash' ? ' (' . $this->lng->txt('delete') . ')' : '');
358  $this->addMultiCommand($key . '_' . $folder['obj_id'], $label);
359  } else {
360  $this->addMultiCommand($key . '_' . $folder['obj_id'], $action . ' ' . $folder['title']);
361  }
362  }
363  }
364  } else {
365  if ($key !== 'deleteMails' || $this->isTrashFolder()) {
366  $this->addMultiCommand($key, $action);
367  }
368  }
369  }
370 
371  return $this;
372  }
addMultiCommand($a_cmd, $a_text)
Add Command button.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isColumnVisible()

ilMailFolderTableGUI::isColumnVisible ( int  $index)
protected
Parameters
int$index
Returns
bool

Definition at line 132 of file class.ilMailFolderTableGUI.php.

References $index, and getColumnDefinition().

Referenced by prepareHTML().

132  : bool
133  {
134  $columnDefinition = $this->getColumnDefinition();
135  if (array_key_exists($index, $columnDefinition)) {
136  $column = $columnDefinition[$index];
137  if (isset($column['optional']) && !$column['optional']) {
138  return true;
139  }
140  if (
141  is_array($this->visibleOptionalColumns) &&
142  array_key_exists($column['field'], $this->visibleOptionalColumns)
143  ) {
144  return true;
145  }
146  }
147 
148  return false;
149  }
$index
Definition: metadata.php:128
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isDraftFolder()

ilMailFolderTableGUI::isDraftFolder ( )

Definition at line 317 of file class.ilMailFolderTableGUI.php.

References $_isDraftsFolder.

Referenced by addForwardRowAction(), addPrintRowAction(), addReplyRowAction(), addViewRowAction(), fetchTableData(), getColumnDefinition(), and initFilter().

317  : bool
318  {
319  return $this->_isDraftsFolder;
320  }
+ Here is the caller graph for this function:

◆ isLuceneEnabled()

ilMailFolderTableGUI::isLuceneEnabled ( )
private
Returns
bool

Definition at line 413 of file class.ilMailFolderTableGUI.php.

References ilSearchSettings\getInstance().

Referenced by initFilter(), and shouldUseLuceneSearch().

413  : bool
414  {
415  return ilSearchSettings::getInstance()->enabledLucene();
416  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isSentFolder()

ilMailFolderTableGUI::isSentFolder ( )

Definition at line 322 of file class.ilMailFolderTableGUI.php.

References $_isSentFolder.

Referenced by fetchTableData(), getColumnDefinition(), and initFilter().

322  : bool
323  {
324  return $this->_isSentFolder;
325  }
+ Here is the caller graph for this function:

◆ isTrashFolder()

ilMailFolderTableGUI::isTrashFolder ( )

Definition at line 327 of file class.ilMailFolderTableGUI.php.

References $_isTrashFolder.

Referenced by initMultiCommands().

327  : bool
328  {
329  return $this->_isTrashFolder;
330  }
+ Here is the caller graph for this function:

◆ prepareHTML()

ilMailFolderTableGUI::prepareHTML ( )
final

Call this before using getHTML()

Returns
ilMailFolderTableGUI
Exceptions
Exception

Definition at line 289 of file class.ilMailFolderTableGUI.php.

References $columns, $index, ilTable2GUI\addColumn(), fetchTableData(), getColumnDefinition(), getSelectableColumns(), ilTable2GUI\getSelectedColumns(), initCommandButtons(), initMultiCommands(), isColumnVisible(), and user().

289  : self
290  {
291  $columns = $this->getColumnDefinition();
292  $this->optionalColumns = (array) $this->getSelectableColumns();
293  $this->visibleOptionalColumns = (array) $this->getSelectedColumns();
294  foreach ($columns as $index => $column) {
295  if ($this->isColumnVisible($index)) {
296  $this->addColumn(
297  $column['txt'],
298  isset($column['sortable']) && $column['sortable'] ? $column['field'] : '',
299  $column['width'] ?? '',
300  isset($column['is_checkbox']) ? (bool) $column['is_checkbox'] : false
301  );
302  }
303  }
304 
305  $mtree = new ilTree($this->user->getId());
306  $mtree->setTableNames('mail_tree', 'mail_obj_data');
307  $this->_folderNode = $mtree->getNodeData($this->_currentFolderId);
308 
309  $this->fetchTableData();
310 
311  $this->initCommandButtons();
312  $this->initMultiCommands($this->_parentObject->mbox->getActions($this->_currentFolderId));
313 
314  return $this;
315  }
user()
Definition: user.php:4
$index
Definition: metadata.php:128
getSelectedColumns()
Get selected columns.
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.
if(! $in) $columns
Definition: Utf8Test.php:45
+ Here is the call graph for this function:

◆ removeInvisibleFields()

ilMailFolderTableGUI::removeInvisibleFields ( array  $row)
protected
Parameters
array$row
Returns
array

Definition at line 164 of file class.ilMailFolderTableGUI.php.

Referenced by fillRow().

164  : array
165  {
166  if (is_array($this->visibleOptionalColumns)) {
167  if (!array_key_exists('attachments', $this->visibleOptionalColumns)) {
168  unset($row['attachment_indicator']);
169  }
170 
171  if (!array_key_exists('personal_picture', $this->visibleOptionalColumns)) {
172  unset($row['img_sender'], $row['alt_sender']);
173  }
174  }
175 
176  return $row;
177  }
+ Here is the caller graph for this function:

◆ resetFilter()

ilMailFolderTableGUI::resetFilter ( )

Definition at line 776 of file class.ilMailFolderTableGUI.php.

References $_POST.

777  {
778  parent::resetFilter();
779 
780  foreach ($this->sub_filter as $item) {
781  if ($item->checkInput()) {
782  $item->setValueByArray($_POST);
783  $item->clearFromSession();
784  }
785  }
786  }
$_POST["username"]

◆ setNumberOfMails()

ilMailFolderTableGUI::setNumberOfMails ( int  $a_number_of_mails)
Parameters
int$a_number_of_mails
Returns
$this

Definition at line 637 of file class.ilMailFolderTableGUI.php.

Referenced by fetchTableData().

637  : self
638  {
639  $this->_number_of_mails = $a_number_of_mails;
640 
641  return $this;
642  }
+ Here is the caller graph for this function:

◆ setSelectedItems()

ilMailFolderTableGUI::setSelectedItems ( array  $a_selected_items)
Parameters
array$a_selected_items
Returns
ilMailFolderTableGUI

Definition at line 378 of file class.ilMailFolderTableGUI.php.

378  : self
379  {
380  $this->_selectedItems = $a_selected_items;
381 
382  return $this;
383  }

◆ setTitleData()

ilMailFolderTableGUI::setTitleData ( string  $folderLabel,
int  $mailCount,
int  $unreadCount,
string  $imgFolder 
)
protected
Parameters
string$folderLabel
int$mailCount
int$unreadCount
string$imgFolder
Returns
ilMailFolderTableGUI
Exceptions
ilTemplateException

Definition at line 619 of file class.ilMailFolderTableGUI.php.

Referenced by fetchTableData().

619  : self
620  {
621  $titleTemplate = new ilTemplate('tpl.mail_folder_title.html', true, true, 'Services/Mail');
622  $titleTemplate->setVariable('TXT_FOLDER', $folderLabel);
623  $titleTemplate->setVariable('MAIL_COUNT', $mailCount);
624  $titleTemplate->setVariable('TXT_MAIL_S', $this->lng->txt('mail_s'));
625  $titleTemplate->setVariable('MAIL_COUNT_UNREAD', $unreadCount);
626  $titleTemplate->setVariable('TXT_UNREAD', $this->lng->txt('unread'));
627 
628  parent::setTitle($titleTemplate->get(), $imgFolder);
629 
630  return $this;
631  }
+ Here is the caller graph for this function:

◆ shouldUseLuceneSearch()

ilMailFolderTableGUI::shouldUseLuceneSearch ( )
protected
Returns
bool

Definition at line 396 of file class.ilMailFolderTableGUI.php.

References isLuceneEnabled().

Referenced by fetchTableData(), and getColumnDefinition().

396  : bool
397  {
398  if (
399  isset($this->filter['mail_filter']) &&
400  is_string($this->filter['mail_filter']) &&
401  $this->filter['mail_filter'] !== '' &&
402  $this->isLuceneEnabled()
403  ) {
404  return true;
405  }
406 
407  return false;
408  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeFilterToSession()

ilMailFolderTableGUI::writeFilterToSession ( )

Definition at line 761 of file class.ilMailFolderTableGUI.php.

References $_POST.

762  {
763  parent::writeFilterToSession();
764 
765  foreach ($this->sub_filter as $item) {
766  if ($item->checkInput()) {
767  $item->setValueByArray($_POST);
768  $item->writeToSession();
769  }
770  }
771  }
$_POST["username"]

Field Documentation

◆ $_currentFolderId

ilMailFolderTableGUI::$_currentFolderId = 0
protected

Definition at line 17 of file class.ilMailFolderTableGUI.php.

Referenced by fetchTableData().

◆ $_folderNode

ilMailFolderTableGUI::$_folderNode = []
protected

Definition at line 15 of file class.ilMailFolderTableGUI.php.

◆ $_isDraftsFolder

ilMailFolderTableGUI::$_isDraftsFolder = false
protected

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

Referenced by isDraftFolder().

◆ $_isSentFolder

ilMailFolderTableGUI::$_isSentFolder = false
protected

Definition at line 22 of file class.ilMailFolderTableGUI.php.

Referenced by isSentFolder().

◆ $_isTrashFolder

ilMailFolderTableGUI::$_isTrashFolder = false
protected

Definition at line 20 of file class.ilMailFolderTableGUI.php.

Referenced by isTrashFolder().

◆ $_number_of_mails

ilMailFolderTableGUI::$_number_of_mails = 0
protected

Definition at line 18 of file class.ilMailFolderTableGUI.php.

Referenced by getNumberOfMails().

◆ $_parentObject

ilMailFolderTableGUI::$_parentObject = null
protected

Definition at line 16 of file class.ilMailFolderTableGUI.php.

◆ $_selectedItems

ilMailFolderTableGUI::$_selectedItems = []
protected

Definition at line 19 of file class.ilMailFolderTableGUI.php.

Referenced by getSelectedItems().

◆ $column_definition

ilMailFolderTableGUI::$column_definition = null
private

Definition at line 49 of file class.ilMailFolderTableGUI.php.

Referenced by getColumnDefinition().

◆ $filter

ilMailFolderTableGUI::$filter = []
protected

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

◆ $optional_filter

ilMailFolderTableGUI::$optional_filter = []
protected

Definition at line 40 of file class.ilMailFolderTableGUI.php.

◆ $optionalColumns

ilMailFolderTableGUI::$optionalColumns = []
protected

Definition at line 37 of file class.ilMailFolderTableGUI.php.

Referenced by getSelectableColumns().

◆ $sub_filter

ilMailFolderTableGUI::$sub_filter = []
protected

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

◆ $uiFactory

ilMailFolderTableGUI::$uiFactory
private

Definition at line 43 of file class.ilMailFolderTableGUI.php.

Referenced by __construct().

◆ $uiRenderer

ilMailFolderTableGUI::$uiRenderer
private

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

Referenced by __construct().

◆ $user

ilMailFolderTableGUI::$user
protected

Definition at line 25 of file class.ilMailFolderTableGUI.php.

Referenced by fetchTableData().

◆ $visibleOptionalColumns

ilMailFolderTableGUI::$visibleOptionalColumns = []
protected

Definition at line 34 of file class.ilMailFolderTableGUI.php.


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