ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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='', Factory $uiFactory=null, Renderer $uiRenderer=null)
 Constructor. More...
 
 getSelectableColumns ()
 
 prepareHTML ()
 Call this before using getHTML() More...
 
 isDraftFolder (bool $a_bool=null)
 Setter/Getter for folder status. More...
 
 isSentFolder (bool $a_bool=null)
 Setter/Getter for folder status. More...
 
 isTrashFolder (bool $a_bool=null)
 Setter/Getter for folder status. More...
 
 setSelectedItems (array $a_selected_items)
 
 getSelectedItems ()
 
 setNumberOfMails (int $a_number_of_mails)
 
 getNumberOfMails ()
 
 initFilter ()
 Init filter. More...
 
 writeFilterToSession ()
 Write filter values to session. More...
 
 resetFilter ()
 Reset filter. More...
 
 getHTML ()
 @inheritDoc More...
 
- 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)
 set table data @access public More...
 
 getData ()
 
 dataExists ()
 
 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) @access public More...
 
 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 @access 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)
 set max. More...
 
- Public Member Functions inherited from ilTableGUI
 __construct ($a_data=0, $a_global_tpl=true)
 Constructor. More...
 
 setTemplate ($a_tpl)
 set template @access public More...
 
getTemplateObject ()
 
 setData ($a_data)
 set table data @access public More...
 
 getData ()
 
 setTitle ($a_title, $a_icon=0, $a_icon_alt=0)
 set table title @access public More...
 
 setHelp ($a_help_page, $a_help_icon, $a_help_icon_alt=0)
 set table help page @access public More...
 
 setHeaderNames ($a_header_names)
 set table header names @access public More...
 
 getColumnCount ()
 Returns the column count based on the number of the header row columns @access public. More...
 
 setHeaderVars ($a_header_vars, $a_header_params=0)
 set table header vars @access public More...
 
 setColumnWidth ($a_column_width)
 set table column widths @access public More...
 
 setOneColumnWidth ($a_column_width, $a_column_number)
 set one table column width @access 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) @access public More...
 
 setOffset ($a_offset)
 set dataset offset @access public More...
 
 getOffset ()
 Get offset. More...
 
 setOrderColumn ($a_order_column=0, $a_default_column=0)
 set order column @access public More...
 
 getOrderColumn ()
 Get order column. More...
 
 setOrderDirection ($a_order_direction)
 set order direction @access public More...
 
 getOrderDirection ()
 Get order direction. More...
 
 setFooter ($a_style, $a_previous=0, $a_next=0)
 set order direction @access 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 @access 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)
 Standard Version of Fill Row.Most likely to be overwritten by derived class.
Parameters
array$a_setdata array
More...
 
 removeInvisibleFields (array $row)
 
 getColumnDefinition ()
 
 isLuceneSearchEnabled ()
 
 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)
 

Private Attributes

 $uiFactory
 
 $uiRenderer
 

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 = '',
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 55 of file class.ilMailFolderTableGUI.php.

61 {
62 global $DIC;
63
64 $this->user = $DIC->user();
65
66 if (null === $uiFactory) {
67 $uiFactory = $DIC->ui()->factory();
68 }
69 if (null === $uiRenderer) {
70 $uiRenderer = $DIC->ui()->renderer();
71 }
72 $this->uiFactory = $uiFactory;
73 $this->uiRenderer = $uiRenderer;
74
75 $this->_currentFolderId = $a_current_folder_id;
76 $this->_parentObject = $a_parent_obj;
77 if (null === $uiFactory) {
78 $uiFactory = $DIC->ui()->factory();
79 }
80 if (null === $uiRenderer) {
81 $uiRenderer = $DIC->ui()->renderer();
82 }
83 $this->uiFactory = $uiFactory;
84 $this->uiRenderer = $uiRenderer;
85
86 $this->setId('mail_folder_tbl_' . $a_current_folder_id);
87 $this->setPrefix('mtable');
88
89 $this->setExternalSorting(true);
90 $this->setExternalSegmentation(true);
91 $this->setDefaultOrderField('send_time');
92 $this->setDefaultOrderDirection('desc');
93
94 parent::__construct($a_parent_obj, $a_parent_cmd);
95
96 $this->ctrl->setParameter($this->getParentObject(), 'mobj_id', $this->_currentFolderId);
97 $this->setFormAction($this->ctrl->getFormAction($this->getParentObject(), 'showFolder'));
98 $this->ctrl->clearParameters($this->getParentObject());
99
100 $this->setEnableTitle(true);
101 $this->setSelectAllCheckbox('mail_id[]');
102 $this->setRowTemplate('tpl.mail_folder_row.html', 'Services/Mail');
103
104 $this->setFilterCommand('applyFilter');
105 $this->setResetCommand('resetFilter');
106 }
user()
Definition: user.php:4
setExternalSorting($a_val)
Set external sorting.
getParentObject()
Get parent object.
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...
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.
setResetCommand($a_val, $a_caption=null)
Set reset filter command.
setEnableTitle($a_enabletitle)
Set Enable Title.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
setExternalSegmentation($a_val)
Set external segmentation.
setId($a_val)
Set id.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setFilterCommand($a_val, $a_caption=null)
Set filter command.
global $DIC
Definition: saml.php:7

References $DIC, $uiFactory, $uiRenderer, 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().

+ 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 877 of file class.ilMailFolderTableGUI.php.

878 {
879 if (!$this->isDraftFolder()) {
880 $this->ctrl->setParameterByClass('ilmailformgui', 'mobj_id', $this->_currentFolderId);
881 $this->ctrl->setParameterByClass('ilmailformgui', 'mail_id', (int) $mail['mail_id']);
882 $this->ctrl->setParameterByClass('ilmailformgui', 'type', 'forward');
883 $forwardButton = $this->uiFactory
884 ->button()
885 ->shy(
886 $this->lng->txt('forward'),
887 $this->ctrl->getLinkTargetByClass('ilmailformgui')
888 );
889 $this->ctrl->clearParametersByClass('ilmailformgui');
890
891 $buttons[] = $forwardButton;
892 }
893 }
isDraftFolder(bool $a_bool=null)
Setter/Getter for folder status.

References isDraftFolder().

Referenced by formatActionsDropDown().

+ 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 899 of file class.ilMailFolderTableGUI.php.

900 {
901 if (!$this->isDraftFolder()) {
902 $this->ctrl->setParameter($this->getParentObject(), 'mobj_id', $this->_currentFolderId);
903 $this->ctrl->setParameter($this->getParentObject(), 'mail_id', (int) $mail['mail_id']);
904 $printButton = $this->uiFactory
905 ->button()
906 ->shy(
907 $this->lng->txt('print'),
908 $this->ctrl->getLinkTarget($this->getParentObject(), 'printMail')
909 );
910 $this->ctrl->clearParameters($this->getParentObject());
911
912 $buttons[] = $printButton;
913 }
914 }

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

Referenced by formatActionsDropDown().

+ 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 853 of file class.ilMailFolderTableGUI.php.

854 {
855 if (!$this->isDraftFolder()) {
856 if (isset($mail['sender_id']) && $mail['sender_id'] > 0 && $mail['sender_id'] != ANONYMOUS_USER_ID) {
857 $this->ctrl->setParameterByClass('ilmailformgui', 'mobj_id', $this->_currentFolderId);
858 $this->ctrl->setParameterByClass('ilmailformgui', 'mail_id', (int) $mail['mail_id']);
859 $this->ctrl->setParameterByClass('ilmailformgui', 'type', 'reply');
860 $replyButton = $this->uiFactory
861 ->button()
862 ->shy(
863 $this->lng->txt('reply'),
864 $this->ctrl->getLinkTargetByClass('ilmailformgui')
865 );
866 $this->ctrl->clearParametersByClass('ilmailformgui');
867
868 $buttons[] = $replyButton;
869 }
870 }
871 }

References isDraftFolder().

Referenced by formatActionsDropDown().

+ 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 821 of file class.ilMailFolderTableGUI.php.

822 {
823 if ($this->isDraftFolder()) {
824 $this->ctrl->setParameterByClass('ilmailformgui', 'mail_id', (int) $mail['mail_id']);
825 $this->ctrl->setParameterByClass('ilmailformgui', 'mobj_id', $this->_currentFolderId);
826 $this->ctrl->setParameterByClass('ilmailformgui', 'type', 'draft');
827 $viewButton = $this->uiFactory
828 ->button()
829 ->shy(
830 $this->lng->txt('view'),
831 $this->ctrl->getLinkTargetByClass('ilmailformgui')
832 );
833 $this->ctrl->clearParametersByClass('ilmailformgui');
834 } else {
835 $this->ctrl->setParameter($this->getParentObject(), 'mail_id', (int) $mail['mail_id']);
836 $this->ctrl->setParameter($this->getParentObject(), 'mobj_id', $this->_currentFolderId);
837 $viewButton = $this->uiFactory
838 ->button()
839 ->shy(
840 $this->lng->txt('view'),
841 $this->ctrl->getLinkTarget($this->getParentObject(), 'showMail')
842 );
843 $this->ctrl->clearParameters($this->getParentObject());
844 }
845
846 $buttons[] = $viewButton;
847 }

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

Referenced by formatActionsDropDown().

+ 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 435 of file class.ilMailFolderTableGUI.php.

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

References $_currentFolderId, ilTableGUI\$data, ilMailBoxQuery\$filter, ilMailBoxQuery\$filtered_ids, ilMailBoxQuery\$folderId, $key, 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(), isLuceneSearchEnabled(), isSentFolder(), ilMailUserCache\preloadUserObjects(), ilTable2GUI\resetOffset(), ilTable2GUI\setData(), ilTableGUI\setMaxCount(), setNumberOfMails(), setTitleData(), and user().

Referenced by prepareHTML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillRow()

ilMailFolderTableGUI::fillRow (   $a_set)
finalprotected

Standard Version of Fill Row.Most likely to be overwritten by derived class.

Parameters
array$a_setdata array

Reimplemented from ilTable2GUI.

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

151 {
152 foreach ($this->removeInvisibleFields($a_set) as $key => $value) {
153 $this->tpl->setVariable(strtoupper($key), $value);
154 }
155 }

References $key, and removeInvisibleFields().

+ Here is the call graph for this function:

◆ formatActionsDropDown()

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

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

800 : string
801 {
802 $buttons = [];
803
804 $this->addViewRowAction($mail, $buttons);
805 $this->addReplyRowAction($mail, $buttons);
806 $this->addForwardRowAction($mail, $buttons);
807 $this->addPrintRowAction($mail, $buttons);
808
809 $dropDown = $this->uiFactory
810 ->dropdown()
811 ->standard($buttons)
812 ->withLabel($this->lng->txt('actions'));
813
814 return $this->uiRenderer->render([$dropDown]);
815 }
addForwardRowAction(array $mail, array &$buttons)
addViewRowAction(array $mail, array &$buttons)
addReplyRowAction(array $mail, array &$buttons)
addPrintRowAction(array $mail, array &$buttons)

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

Referenced by fetchTableData().

+ 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 180 of file class.ilMailFolderTableGUI.php.

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

References $columns, $i, isDraftFolder(), isLuceneSearchEnabled(), and isSentFolder().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHTML()

ilMailFolderTableGUI::getHTML ( )

@inheritDoc

Reimplemented from ilTable2GUI.

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

920 {
921 $this->ctrl->setParameter($this->getParentObject(), 'mobj_id', $this->_currentFolderId);
922 $html = parent::getHTML();
923 $this->ctrl->clearParameters($this->getParentObject());
924
925 return $html;
926 }
$html
Definition: example_001.php:87

References $html, and ilTable2GUI\getParentObject().

+ Here is the call graph for this function:

◆ getNumberOfMails()

ilMailFolderTableGUI::getNumberOfMails ( )
Returns
int

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

657 : int
658 {
660 }

References $_number_of_mails.

Referenced by initCommandButtons().

+ Here is the caller graph for this function:

◆ getSelectableColumns()

ilMailFolderTableGUI::getSelectableColumns ( )
Returns
array

Reimplemented from ilTable2GUI.

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

112 {
113 $optionalColumns = array_filter($this->getColumnDefinition(), function ($column) {
114 return isset($column['optional']) && $column['optional'];
115 });
116
117 $columns = array();
118 foreach ($optionalColumns as $index => $column) {
119 $columns[$column['field']] = $column;
120 }
121
122 return $columns;
123 }
$index
Definition: metadata.php:60

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

Referenced by prepareHTML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelectedItems()

ilMailFolderTableGUI::getSelectedItems ( )
Returns
array

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

414 : array
415 {
417 }

References $_selectedItems.

Referenced by fetchTableData().

+ Here is the caller graph for this function:

◆ initCommandButtons()

ilMailFolderTableGUI::initCommandButtons ( )
private
Returns
ilMailFolderTableGUI

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

361 : self
362 {
363 if ($this->_folderNode['m_type'] === 'trash' && $this->getNumberOfMails() > 0) {
364 $this->addCommandButton('confirmEmptyTrash', $this->lng->txt('mail_empty_trash'));
365 }
366
367 return $this;
368 }
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.

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

Referenced by prepareHTML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFilter()

ilMailFolderTableGUI::initFilter ( )

Init filter.

Overwrite this to initialize all filter input property objects.

Reimplemented from ilTable2GUI.

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

666 {
667 $this->filter = [];
668
669 $quickFilter = new ilMailQuickFilterInputGUI($this->lng->txt('mail_filter'), 'mail_filter');
670 $quickFilter->setSubmitFormOnEnter(false);
671 $this->addFilterItem($quickFilter);
672 $quickFilter->readFromSession();
673 $this->filter['mail_filter'] = $quickFilter->getValue();
674
675 if ($this->isDraftFolder() || $this->isSentFolder()) {
676 $this->sub_filter[] = $subFilterInRecipients = new ilCheckboxInputGUI(
677 $this->lng->txt('mail_filter_recipients'),
678 'mail_filter_recipients'
679 );
680 $subFilterInRecipients->setOptionTitle($this->lng->txt('mail_filter_recipients'));
681 $subFilterInRecipients->setValue(1);
682 $quickFilter->addSubItem($subFilterInRecipients);
683 $subFilterInRecipients->setParent($this);
684 $subFilterInRecipients->readFromSession();
685 $this->filter['mail_filter_recipients'] = (int) $subFilterInRecipients->getChecked();
686 } else {
687 $this->sub_filter[] = $subFilterInSender = new ilCheckboxInputGUI(
688 $this->lng->txt('mail_filter_sender'),
689 'mail_filter_sender'
690 );
691 $subFilterInSender->setOptionTitle($this->lng->txt('mail_filter_sender'));
692 $subFilterInSender->setValue(1);
693 $quickFilter->addSubItem($subFilterInSender);
694 $subFilterInSender->setParent($this);
695 $subFilterInSender->readFromSession();
696 $this->filter['mail_filter_sender'] = (int) $subFilterInSender->getChecked();
697 }
698
699 $this->sub_filter[] = $subFilterInSubject = new ilCheckboxInputGUI(
700 $this->lng->txt('mail_filter_subject'),
701 'mail_filter_subject'
702 );
703 $subFilterInSubject->setOptionTitle($this->lng->txt('mail_filter_subject'));
704 $subFilterInSubject->setValue(1);
705 $quickFilter->addSubItem($subFilterInSubject);
706 $subFilterInSubject->setParent($this);
707 $subFilterInSubject->readFromSession();
708 $this->filter['mail_filter_subject'] = (int) $subFilterInSubject->getChecked();
709
710 $this->sub_filter[] = $subFilterInBody = new ilCheckboxInputGUI(
711 $this->lng->txt('mail_filter_body'),
712 'mail_filter_body'
713 );
714 $subFilterInBody->setOptionTitle($this->lng->txt('mail_filter_body'));
715 $subFilterInBody->setValue(1);
716 $quickFilter->addSubItem($subFilterInBody);
717 $subFilterInBody->setParent($this);
718 $subFilterInBody->readFromSession();
719 $this->filter['mail_filter_body'] = (int) $subFilterInBody->getChecked();
720
721 $this->sub_filter[] = $subFilterInAttachments = new ilCheckboxInputGUI(
722 $this->lng->txt('mail_filter_attach'),
723 'mail_filter_attach'
724 );
725 $subFilterInAttachments->setOptionTitle($this->lng->txt('mail_filter_attach'));
726 $subFilterInAttachments->setValue(1);
727 $quickFilter->addSubItem($subFilterInAttachments);
728 $subFilterInAttachments->setParent($this);
729 $subFilterInAttachments->readFromSession();
730 $this->filter['mail_filter_attach'] = (int) $subFilterInAttachments->getChecked();
731
732 if (!$this->isDraftFolder() && !$this->isSentFolder()) {
733 $onlyUnread = new ilCheckboxInputGUI(
734 $this->lng->txt('mail_filter_only_unread'),
735 'mail_filter_only_unread'
736 );
737 $onlyUnread->setValue(1);
738 $this->addFilterItem($onlyUnread);
739 $onlyUnread->readFromSession();
740 $this->filter['mail_filter_only_unread'] = (int) $onlyUnread->getChecked();
741 }
742
743 if (!$this->isDraftFolder()) {
744 $onlyWithAttachments = new ilCheckboxInputGUI(
745 $this->lng->txt('mail_filter_only_with_attachments'),
746 'mail_filter_only_with_attachments'
747 );
748 $onlyWithAttachments->setValue(1);
749 $this->addFilterItem($onlyWithAttachments);
750 $onlyWithAttachments->readFromSession();
751 $this->filter['mail_filter_only_with_attachments'] = (int) $onlyWithAttachments->getChecked();
752 }
753
754 $duration = new \ilDateDurationInputGUI($this->lng->txt('mail_filter_period'), 'period');
755 $duration->setAllowOpenIntervals(true);
756 $duration->setStartText($this->lng->txt('mail_filter_period_from'));
757 $duration->setEndText($this->lng->txt('mail_filter_period_until'));
758 $duration->setStart(new ilDateTime(null, IL_CAL_UNIX));
759 $duration->setEnd(new ilDateTime(null, IL_CAL_UNIX));
760 $duration->setShowTime(false);
761 $this->addFilterItem($duration);
762 $duration->readFromSession();
763 $this->filter['period'] = $duration->getValue();
764 }
const IL_CAL_UNIX
This class represents a checkbox property in a property form.
addFilterItem($a_input_item, $a_optional=false)
Add filter item.

References ilTable2GUI\addFilterItem(), IL_CAL_UNIX, isDraftFolder(), and isSentFolder().

+ Here is the call graph for this function:

◆ initMultiCommands()

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

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

374 : self
375 {
376 foreach ($actions as $key => $action) {
377 if ($key === 'moveMails') {
378 $folders = $this->_parentObject->mbox->getSubFolders();
379 foreach ($folders as $folder) {
380 if ($folder['type'] !== 'trash' || !$this->isTrashFolder()) {
381 if ($folder['type'] !== 'user_folder') {
382 $label = $action . ' ' . $this->lng->txt('mail_' . $folder['title']) .
383 ($folder['type'] === 'trash' ? ' (' . $this->lng->txt('delete') . ')' : '');
384 $this->addMultiCommand($key . '_' . $folder['obj_id'], $label);
385 } else {
386 $this->addMultiCommand($key . '_' . $folder['obj_id'], $action . ' ' . $folder['title']);
387 }
388 }
389 }
390 } else {
391 if ($key !== 'deleteMails' || $this->isTrashFolder()) {
393 }
394 }
395 }
396
397 return $this;
398 }
isTrashFolder(bool $a_bool=null)
Setter/Getter for folder status.
addMultiCommand($a_cmd, $a_text)
Add Command button.
$action

References $action, $key, ilTable2GUI\addMultiCommand(), and isTrashFolder().

Referenced by prepareHTML().

+ 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 129 of file class.ilMailFolderTableGUI.php.

129 : bool
130 {
131 $columnDefinition = $this->getColumnDefinition();
132 if (array_key_exists($index, $columnDefinition)) {
133 $column = $columnDefinition[$index];
134 if (isset($column['optional']) && !$column['optional']) {
135 return true;
136 }
137 if (
138 is_array($this->visibleOptionalColumns) &&
139 array_key_exists($column['field'], $this->visibleOptionalColumns)
140 ) {
141 return true;
142 }
143 }
144
145 return false;
146 }

References $index, and getColumnDefinition().

Referenced by prepareHTML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isDraftFolder()

ilMailFolderTableGUI::isDraftFolder ( bool  $a_bool = null)

Setter/Getter for folder status.

Parameters
mixed$a_boolBoolean folder status or null
Returns
bool|ilMailFolderTableGUI Either an object of type ilMailFolderTableGUI or the boolean folder status

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

316 {
317 if (null === $a_bool) {
319 }
320
321 $this->_isDraftsFolder = $a_bool;
322
323 return $this;
324 }

References $_isDraftsFolder.

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

+ Here is the caller graph for this function:

◆ isLuceneSearchEnabled()

ilMailFolderTableGUI::isLuceneSearchEnabled ( )
protected
Returns
bool

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

422 : bool
423 {
424 if (ilSearchSettings::getInstance()->enabledLucene() && strlen($this->filter['mail_filter'])) {
425 return true;
426 }
427
428 return false;
429 }

References ilSearchSettings\getInstance().

Referenced by fetchTableData(), and getColumnDefinition().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isSentFolder()

ilMailFolderTableGUI::isSentFolder ( bool  $a_bool = null)

Setter/Getter for folder status.

Parameters
mixed$a_boolBoolean folder status or null
Returns
bool|ilMailFolderTableGUI Either an object of type ilMailFolderTableGUI or the boolean folder status

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

332 {
333 if (null === $a_bool) {
335 }
336
337 $this->_isSentFolder = $a_bool;
338
339 return $this;
340 }

References $_isSentFolder.

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

+ Here is the caller graph for this function:

◆ isTrashFolder()

ilMailFolderTableGUI::isTrashFolder ( bool  $a_bool = null)

Setter/Getter for folder status.

Parameters
mixed$a_boolBoolean folder status or null
Returns
bool|ilMailFolderTableGUI Either an object of type ilMailFolderTableGUI or the boolean folder status

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

348 {
349 if (null === $a_bool) {
351 }
352
353 $this->_isTrashFolder = $a_bool;
354
355 return $this;
356 }

References $_isTrashFolder.

Referenced by initMultiCommands().

+ Here is the caller graph for this function:

◆ prepareHTML()

ilMailFolderTableGUI::prepareHTML ( )
final

Call this before using getHTML()

Returns
ilMailFolderTableGUI
Exceptions
Exception

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

282 : self
283 {
284 $columns = $this->getColumnDefinition();
285 $this->optionalColumns = (array) $this->getSelectableColumns();
286 $this->visibleOptionalColumns = (array) $this->getSelectedColumns();
287 foreach ($columns as $index => $column) {
288 if ($this->isColumnVisible($index)) {
289 $this->addColumn(
290 $column['txt'],
291 isset($column['sortable']) && $column['sortable'] ? $column['field'] : '',
292 isset($column['width']) ? $column['width'] : '',
293 isset($column['is_checkbox']) ? (bool) $column['is_checkbox'] : false
294 );
295 }
296 }
297
298 $mtree = new \ilTree($this->user->getId());
299 $mtree->setTableNames('mail_tree', 'mail_obj_data');
300 $this->_folderNode = $mtree->getNodeData($this->_currentFolderId);
301
302 $this->fetchTableData();
303
304 $this->initCommandButtons();
305 $this->initMultiCommands($this->_parentObject->mbox->getActions($this->_currentFolderId));
306
307 return $this;
308 }
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.

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

+ Here is the call graph for this function:

◆ removeInvisibleFields()

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

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

161 : array
162 {
163 if (is_array($this->visibleOptionalColumns)) {
164 if (!array_key_exists('attachments', $this->visibleOptionalColumns)) {
165 unset($row['attachment_indicator']);
166 }
167
168 if (!array_key_exists('personal_picture', $this->visibleOptionalColumns)) {
169 unset($row['img_sender']);
170 unset($row['alt_sender']);
171 }
172 }
173
174 return $row;
175 }
$row

References $row.

Referenced by fillRow().

+ Here is the caller graph for this function:

◆ resetFilter()

ilMailFolderTableGUI::resetFilter ( )

Reset filter.

Reimplemented from ilTable2GUI.

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

785 {
786 parent::resetFilter();
787
788 foreach ($this->sub_filter as $item) {
789 if ($item->checkInput()) {
790 $item->setValueByArray($_POST);
791 $item->clearFromSession();
792 }
793 }
794 }
$_POST["username"]

References $_POST.

◆ setNumberOfMails()

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

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

647 : self
648 {
649 $this->_number_of_mails = $a_number_of_mails;
650
651 return $this;
652 }

Referenced by fetchTableData().

+ 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 404 of file class.ilMailFolderTableGUI.php.

404 : self
405 {
406 $this->_selectedItems = $a_selected_items;
407
408 return $this;
409 }

◆ 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 629 of file class.ilMailFolderTableGUI.php.

629 : self
630 {
631 $titleTemplate = new ilTemplate('tpl.mail_folder_title.html', true, true, 'Services/Mail');
632 $titleTemplate->setVariable('TXT_FOLDER', $folderLabel);
633 $titleTemplate->setVariable('MAIL_COUNT', $mailCount);
634 $titleTemplate->setVariable('TXT_MAIL_S', $this->lng->txt('mail_s'));
635 $titleTemplate->setVariable('MAIL_COUNT_UNREAD', $unreadCount);
636 $titleTemplate->setVariable('TXT_UNREAD', $this->lng->txt('unread'));
637
638 parent::setTitle($titleTemplate->get(), $imgFolder);
639
640 return $this;
641 }
special template class to simplify handling of ITX/PEAR

Referenced by fetchTableData().

+ Here is the caller graph for this function:

◆ writeFilterToSession()

ilMailFolderTableGUI::writeFilterToSession ( )

Write filter values to session.

Reimplemented from ilTable2GUI.

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

770 {
771 parent::writeFilterToSession();
772
773 foreach ($this->sub_filter as $item) {
774 if ($item->checkInput()) {
775 $item->setValueByArray($_POST);
776 $item->writeToSession();
777 }
778 }
779 }

References $_POST.

Field Documentation

◆ $_currentFolderId

ilMailFolderTableGUI::$_currentFolderId = 0
protected

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

Referenced by fetchTableData().

◆ $_folderNode

ilMailFolderTableGUI::$_folderNode = []
protected

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

◆ $_isDraftsFolder

ilMailFolderTableGUI::$_isDraftsFolder = false
protected

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

Referenced by isDraftFolder().

◆ $_isSentFolder

ilMailFolderTableGUI::$_isSentFolder = false
protected

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

Referenced by isSentFolder().

◆ $_isTrashFolder

ilMailFolderTableGUI::$_isTrashFolder = false
protected

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

Referenced by isTrashFolder().

◆ $_number_of_mails

ilMailFolderTableGUI::$_number_of_mails = 0
protected

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

Referenced by getNumberOfMails().

◆ $_parentObject

ilMailFolderTableGUI::$_parentObject = null
protected

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

◆ $_selectedItems

ilMailFolderTableGUI::$_selectedItems = []
protected

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

Referenced by getSelectedItems().

◆ $filter

ilMailFolderTableGUI::$filter = []
protected

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

◆ $optional_filter

ilMailFolderTableGUI::$optional_filter = []
protected

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

◆ $optionalColumns

ilMailFolderTableGUI::$optionalColumns = []
protected

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

Referenced by getSelectableColumns().

◆ $sub_filter

ilMailFolderTableGUI::$sub_filter = []
protected

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

◆ $uiFactory

ilMailFolderTableGUI::$uiFactory
private

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

Referenced by __construct().

◆ $uiRenderer

ilMailFolderTableGUI::$uiRenderer
private

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

Referenced by __construct().

◆ $user

ilMailFolderTableGUI::$user
protected

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

Referenced by fetchTableData().

◆ $visibleOptionalColumns

ilMailFolderTableGUI::$visibleOptionalColumns = []
protected

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


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