ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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.
global $DIC
Definition: goto.php:24
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)
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 876 of file class.ilMailFolderTableGUI.php.

References isDraftFolder().

Referenced by formatActionsDropDown().

876  : void
877  {
878  if (!$this->isDraftFolder()) {
879  $this->ctrl->setParameterByClass('ilmailformgui', 'mobj_id', $this->_currentFolderId);
880  $this->ctrl->setParameterByClass('ilmailformgui', 'mail_id', (int) $mail['mail_id']);
881  $this->ctrl->setParameterByClass('ilmailformgui', 'type', 'forward');
882  $forwardButton = $this->uiFactory
883  ->link()
884  ->standard(
885  $this->lng->txt('forward'),
886  $this->ctrl->getLinkTargetByClass('ilmailformgui')
887  );
888  $this->ctrl->clearParametersByClass('ilmailformgui');
889 
890  $buttons[] = $forwardButton;
891  }
892  }
+ 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 898 of file class.ilMailFolderTableGUI.php.

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

Referenced by formatActionsDropDown().

898  : void
899  {
900  if (!$this->isDraftFolder()) {
901  $this->ctrl->setParameter($this->getParentObject(), 'mobj_id', $this->_currentFolderId);
902  $this->ctrl->setParameter($this->getParentObject(), 'mail_id', (int) $mail['mail_id']);
903  $printButton = $this->uiFactory
904  ->link()
905  ->standard(
906  $this->lng->txt('print'),
907  $this->ctrl->getLinkTarget($this->getParentObject(), 'printMail')
908  )->withOpenInNewViewport(true);
909  $this->ctrl->clearParameters($this->getParentObject());
910 
911  $buttons[] = $printButton;
912  }
913  }
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 852 of file class.ilMailFolderTableGUI.php.

References ANONYMOUS_USER_ID, and isDraftFolder().

Referenced by formatActionsDropDown().

852  : void
853  {
854  if (!$this->isDraftFolder()) {
855  if (isset($mail['sender_id']) && $mail['sender_id'] > 0 && $mail['sender_id'] != ANONYMOUS_USER_ID) {
856  $this->ctrl->setParameterByClass('ilmailformgui', 'mobj_id', $this->_currentFolderId);
857  $this->ctrl->setParameterByClass('ilmailformgui', 'mail_id', (int) $mail['mail_id']);
858  $this->ctrl->setParameterByClass('ilmailformgui', 'type', 'reply');
859  $replyButton = $this->uiFactory
860  ->link()
861  ->standard(
862  $this->lng->txt('reply'),
863  $this->ctrl->getLinkTargetByClass('ilmailformgui')
864  );
865  $this->ctrl->clearParametersByClass('ilmailformgui');
866 
867  $buttons[] = $replyButton;
868  }
869  }
870  }
const ANONYMOUS_USER_ID
Definition: constants.php:25
+ 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 820 of file class.ilMailFolderTableGUI.php.

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

Referenced by formatActionsDropDown().

820  : void
821  {
822  if ($this->isDraftFolder()) {
823  $this->ctrl->setParameterByClass('ilmailformgui', 'mail_id', (int) $mail['mail_id']);
824  $this->ctrl->setParameterByClass('ilmailformgui', 'mobj_id', $this->_currentFolderId);
825  $this->ctrl->setParameterByClass('ilmailformgui', 'type', 'draft');
826  $viewButton = $this->uiFactory
827  ->link()
828  ->standard(
829  $this->lng->txt('view'),
830  $this->ctrl->getLinkTargetByClass('ilmailformgui')
831  );
832  $this->ctrl->clearParametersByClass('ilmailformgui');
833  } else {
834  $this->ctrl->setParameter($this->getParentObject(), 'mail_id', (int) $mail['mail_id']);
835  $this->ctrl->setParameter($this->getParentObject(), 'mobj_id', $this->_currentFolderId);
836  $viewButton = $this->uiFactory
837  ->link()
838  ->standard(
839  $this->lng->txt('view'),
840  $this->ctrl->getLinkTarget($this->getParentObject(), 'showMail')
841  );
842  $this->ctrl->clearParameters($this->getParentObject());
843  }
844 
845  $buttons[] = $viewButton;
846  }
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(), ANONYMOUS_USER_ID, ilTable2GUI\determineOffsetAndOrder(), filter(), 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  $mail['txt_select_mail_with_subject'] = sprintf(
519  $this->lng->txt('select_mail_with_subject_x'),
520  htmlspecialchars($mail['m_subject'] ?? '')
521  );
522 
523  if ($this->isDraftFolder() || $this->isSentFolder()) {
524  $mail['rcp_to'] = $mail['mail_login'] = ilUtil::htmlencodePlainString(
525  $this->_parentObject->umail->formatNamesForOutput((string) $mail['rcp_to']),
526  false
527  );
528  } else {
529  if ($mail['sender_id'] == ANONYMOUS_USER_ID) {
530  $mail['img_sender'] = ilUtil::getImagePath('HeaderIconAvatar.svg');
531  $mail['from'] = $mail['mail_login'] = $mail['alt_sender'] = htmlspecialchars(ilMail::_getIliasMailerName());
532  } else {
533  $user = ilMailUserCache::getUserObjectById($mail['sender_id']);
534 
535  if ($user) {
536  $mail['img_sender'] = $user->getPersonalPicturePath('xxsmall');
537  $mail['from'] = $mail['mail_login'] = $mail['alt_sender'] = htmlspecialchars($user->getPublicName());
538  } else {
539  $mail['img_sender'] = '';
540  $mail['from'] = $mail['mail_login'] = $mail['import_name'] . ' (' . $this->lng->txt('user_deleted') . ')';
541  }
542  }
543  }
544 
545  if ($this->isDraftFolder()) {
546  $this->ctrl->setParameterByClass('ilmailformgui', 'mail_id', $mail['mail_id']);
547  $this->ctrl->setParameterByClass('ilmailformgui', 'mobj_id', $this->_currentFolderId);
548  $this->ctrl->setParameterByClass('ilmailformgui', 'type', 'draft');
549  $link_mark_as_read = $this->ctrl->getLinkTargetByClass('ilmailformgui');
550  $this->ctrl->clearParametersByClass('ilmailformgui');
551  } else {
552  $this->ctrl->setParameter($this->getParentObject(), 'mail_id', $mail['mail_id']);
553  $this->ctrl->setParameter($this->getParentObject(), 'mobj_id', $this->_currentFolderId);
554  $link_mark_as_read = $this->ctrl->getLinkTarget($this->getParentObject(), 'showMail');
555  $this->ctrl->clearParameters($this->getParentObject());
556  }
557  $css_class = $mail['m_status'] === 'read' ? 'mailread' : 'mailunread';
558 
559  if ($this->shouldUseLuceneSearch()) {
560  $search_result = array();
561  foreach ($result->getFields($mail['mail_id']) as $content) {
562  if ('title' === $content[0]) {
563  $mail['msr_subject_link_read'] = $link_mark_as_read;
564  $mail['msr_subject_mailclass'] = $css_class;
565  $mail['msr_subject'] = $content[1];
566  } else {
567  $search_result[] = $content[1];
568  }
569  }
570  $mail['msr_data'] = implode('', array_map(function ($value) {
571  return '<p>' . $value . '</p>';
572  }, $search_result));
573 
574  if (!$mail['msr_subject']) {
575  $mail['msr_subject_link_read'] = $link_mark_as_read;
576  $mail['msr_subject_mailclass'] = $css_class;
577  $mail['msr_subject'] = htmlspecialchars($mail['m_subject'] ?? '');
578  }
579  $mail['msr_subject_read_unread'] = $mail['m_status'] === 'read' ? $this->lng->txt('mail_is_read') : $this->lng->txt('mail_is_unread');
580  } else {
581  $mail['mail_link_read'] = $link_mark_as_read;
582  $mail['mailclass'] = $css_class;
583  $mail['mail_subject'] = htmlspecialchars($mail['m_subject'] ?? '');
584  $mail['mail_subject_read_unread'] = $mail['m_status'] === 'read' ? $this->lng->txt('mail_is_read') : $this->lng->txt('mail_is_unread');
585  }
586 
587  $mail['mail_date'] = ilDatePresentation::formatDate(new ilDateTime($mail['send_time'], IL_CAL_DATETIME));
588 
589  $mail['attachment_indicator'] = '';
590  if (is_array($mail['attachments']) && count($mail['attachments']) > 0) {
591  $this->ctrl->setParameter($this->getParentObject(), 'mail_id', (int) $mail['mail_id']);
592  if ($this->isDraftFolder()) {
593  $this->ctrl->setParameter($this->getParentObject(), 'type', 'draft');
594  }
595  $this->ctrl->setParameter($this->getParentObject(), 'mobj_id', $this->_currentFolderId);
596  $mail['attachment_indicator'] = $this->uiRenderer->render(
597  $this->uiFactory->symbol()->glyph()->attachment(
598  $this->ctrl->getLinkTarget($this->getParentObject(), 'deliverAttachments')
599  )
600  );
601  $this->ctrl->clearParameters($this->getParentObject());
602  }
603 
604  $mail['actions'] = $this->formatActionsDropDown($mail);
605 
606  $data['set'][$key] = $mail;
607  }
608 
609  $this->setData($data['set']);
610  $this->setMaxCount((int) $data['cnt']);
611  $this->setNumberOfMails((int) $data['cnt']);
612 
613  $this->setTitleData($txt_folder, (int) $data['cnt'], (int) $data['cnt_unread'], $img_folder);
614 
615  return $this;
616  }
const IL_CAL_DATETIME
const ANONYMOUS_USER_ID
Definition: constants.php:25
$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.
filter()
Definition: filter.php:2
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 799 of file class.ilMailFolderTableGUI.php.

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

Referenced by fetchTableData().

799  : string
800  {
801  $buttons = [];
802 
803  $this->addViewRowAction($mail, $buttons);
804  $this->addReplyRowAction($mail, $buttons);
805  $this->addForwardRowAction($mail, $buttons);
806  $this->addPrintRowAction($mail, $buttons);
807 
808  $dropDown = $this->uiFactory
809  ->dropdown()
810  ->standard($buttons)
811  ->withLabel($this->lng->txt('actions'));
812 
813  return $this->uiRenderer->render([$dropDown]);
814  }
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 918 of file class.ilMailFolderTableGUI.php.

References ilTable2GUI\getParentObject().

919  {
920  $this->ctrl->setParameter($this->getParentObject(), 'mobj_id', $this->_currentFolderId);
921  $html = parent::getHTML();
922  $this->ctrl->clearParameters($this->getParentObject());
923 
924  return $html;
925  }
getParentObject()
Get parent object.
+ Here is the call graph for this function:

◆ getNumberOfMails()

ilMailFolderTableGUI::getNumberOfMails ( )
Returns
int

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

References $_number_of_mails.

Referenced by initCommandButtons().

654  : int
655  {
657  }
+ 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 662 of file class.ilMailFolderTableGUI.php.

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

Referenced by ilMailFolderGUI\getMailFolderTable().

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

References $_POST.

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

◆ setNumberOfMails()

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

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

Referenced by fetchTableData().

644  : self
645  {
646  $this->_number_of_mails = $a_number_of_mails;
647 
648  return $this;
649  }
+ 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 626 of file class.ilMailFolderTableGUI.php.

Referenced by fetchTableData().

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

◆ shouldUseLuceneSearch()

ilMailFolderTableGUI::shouldUseLuceneSearch ( )
protected
Returns
bool

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

References filter(), and 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  }
filter()
Definition: filter.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeFilterToSession()

ilMailFolderTableGUI::writeFilterToSession ( )

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

References $_POST.

769  {
770  parent::writeFilterToSession();
771 
772  foreach ($this->sub_filter as $item) {
773  if ($item->checkInput()) {
774  $item->setValueByArray($_POST);
775  $item->writeToSession();
776  }
777  }
778  }
$_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: