ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilMailFolderTableGUI Class Reference
+ Inheritance diagram for ilMailFolderTableGUI:
+ Collaboration diagram for ilMailFolderTableGUI:

Public Member Functions

 __construct (protected ilMailFolderGUI $_parentObject, protected int $_currentFolderId, string $a_parent_cmd, protected bool $_isTrashFolder, protected bool $_isSentFolder, protected bool $_isDraftsFolder, Factory $uiFactory=null, Renderer $uiRenderer=null)
 
 getSelectableColumns ()
 
 prepareHTML ()
 
 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 (?object $a_parent_obj, string $a_parent_cmd="", string $a_template_context="")
 
 setOpenFormTag (bool $a_val)
 
 getOpenFormTag ()
 
 setCloseFormTag (bool $a_val)
 
 getCloseFormTag ()
 
 determineLimit ()
 
 getSelectableColumns ()
 Get selectable columns. More...
 
 determineSelectedColumns ()
 
 isColumnSelected (string $col)
 
 getSelectedColumns ()
 
 resetOffset (bool $a_in_determination=false)
 
 initFilter ()
 
 getParentObject ()
 
 getParentCmd ()
 
 setTopAnchor (string $a_val)
 
 getTopAnchor ()
 
 setNoEntriesText (string $a_text)
 
 getNoEntriesText ()
 
 setIsDataTable (bool $a_val)
 
 getIsDataTable ()
 
 setEnableTitle (bool $a_enabletitle)
 
 getEnableTitle ()
 
 setEnableHeader (bool $a_enableheader)
 
 getEnableHeader ()
 
 setEnableNumInfo (bool $a_val)
 
 getEnableNumInfo ()
 
 setTitle (string $a_title, string $a_icon="", string $a_icon_alt="")
 
 setDescription (string $a_val)
 
 getDescription ()
 
 setOrderField (string $a_order_field)
 
 getOrderField ()
 
 setData (array $a_data)
 
 getData ()
 
 dataExists ()
 
 setPrefix (string $a_prefix)
 
 getPrefix ()
 
 addFilterItem (ilTableFilterItem $a_input_item, bool $a_optional=false)
 
 addFilterItemByMetaType (string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
 Add filter by standard type. More...
 
 getFilterItems (bool $a_optionals=false)
 
 getFilterItemByPostVar (string $a_post_var)
 
 setFilterCols (int $a_val)
 
 getFilterCols ()
 
 setDisableFilterHiding (bool $a_val=true)
 
 getDisableFilterHiding ()
 
 isFilterSelected (string $a_col)
 Is given filter selected? More...
 
 getSelectedFilters ()
 
 determineSelectedFilters ()
 
 setCustomPreviousNext (string $a_prev_link, string $a_next_link)
 
 setFormAction (string $a_form_action, bool $a_multipart=false)
 
 getFormAction ()
 
 setFormName (string $a_name="")
 
 getFormName ()
 
 setId (string $a_val)
 
 getId ()
 
 setDisplayAsBlock (bool $a_val)
 
 getDisplayAsBlock ()
 
 setSelectAllCheckbox (string $a_select_all_checkbox, bool $a_select_all_on_top=false)
 
 setExternalSorting (bool $a_val)
 
 getExternalSorting ()
 
 setFilterCommand (string $a_val, string $a_caption="")
 
 getFilterCommand ()
 
 setResetCommand (string $a_val, string $a_caption="")
 
 getResetCommand ()
 
 setExternalSegmentation (bool $a_val)
 
 getExternalSegmentation ()
 
 setRowTemplate (string $a_template, string $a_template_dir="")
 Set row template. More...
 
 setDefaultOrderField (string $a_defaultorderfield)
 
 getDefaultOrderField ()
 
 setDefaultOrderDirection (string $a_defaultorderdirection)
 
 getDefaultOrderDirection ()
 
 setDefaultFilterVisiblity (bool $a_status)
 
 getDefaultFilterVisibility ()
 
 clearCommandButtons ()
 
 addCommandButton (string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
 
 addCommandButtonInstance (ilButtonBase $a_button)
 
 addMultiItemSelectionButton (string $a_sel_var, array $a_options, string $a_cmd, string $a_text, string $a_default_selection='')
 
 setCloseCommand (string $a_link)
 
 addMultiCommand (string $a_cmd, string $a_text)
 
 addHiddenInput (string $a_name, string $a_value)
 
 addHeaderCommand (string $a_href, string $a_text, string $a_target="", string $a_img="")
 
 setTopCommands (bool $a_val)
 
 getTopCommands ()
 
 addColumn (string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
 
 getNavParameter ()
 
 setOrderLink (string $key, string $order_dir)
 
 fillHeader ()
 
 determineOffsetAndOrder (bool $a_omit_offset=false)
 
 storeNavParameter ()
 
 getHTML ()
 Get HTML. More...
 
 numericOrdering (string $a_field)
 Should this field be sorted numeric? More...
 
 render ()
 
 writeFilterToSession ()
 
 resetFilter ()
 
 fillFooter ()
 
 getLinkbar (string $a_num)
 
 fillHiddenRow ()
 
 fillActionRow ()
 
 setHeaderHTML (string $html)
 
 storeProperty (string $type, string $value)
 
 loadProperty (string $type)
 
 getCurrentState ()
 get current settings for order, limit, columns and filter More...
 
 setContext (string $id)
 
 getContext ()
 
 setShowRowsSelector (bool $a_value)
 Toggle rows-per-page selector. More...
 
 getShowRowsSelector ()
 
 setShowTemplates (bool $a_value)
 
 getShowTemplates ()
 
 restoreTemplate (string $a_name)
 Restore state from template. More...
 
 saveTemplate (string $a_name)
 Save current state as template. More...
 
 deleteTemplate (string $a_name)
 
 getLimit ()
 
 getOffset ()
 
 setExportFormats (array $formats)
 Set available export formats. More...
 
 setPrintMode (bool $a_value=false)
 
 getPrintMode ()
 
 getExportMode ()
 
 exportData (int $format, bool $send=false)
 Export and optionally send current table data. More...
 
 setEnableAllCommand (bool $a_value)
 
 setRowSelectorLabel (string $row_selector_label)
 
 getRowSelectorLabel ()
 
 setPreventDoubleSubmission (bool $a_val)
 
 getPreventDoubleSubmission ()
 
 setLimit (int $a_limit=0, int $a_default_limit=0)
 
- Public Member Functions inherited from ilTableGUI
 __construct (array $a_data=[], bool $a_global_tpl=true)
 
 setTemplate (ilTemplate $a_tpl)
 
 getTemplateObject ()
 
 setData (array $a_data)
 Set table data. More...
 
 getData ()
 
 setTitle (string $a_title, string $a_icon="", string $a_icon_alt="")
 
 setHelp (string $a_help_page, string $a_help_icon, string $a_help_icon_alt="")
 
 setHeaderNames (array $a_header_names)
 
 getColumnCount ()
 
 setHeaderVars (array $a_header_vars, array $a_header_params=[])
 
 setColumnWidth (array $a_column_width)
 set table column widths More...
 
 setOneColumnWidth (string $a_column_width, int $a_column_number)
 
 setMaxCount (int $a_max_count)
 set max. More...
 
 setLimit (int $a_limit=0, int $a_default_limit=0)
 set max. More...
 
 getLimit ()
 
 setPrefix (string $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) More...
 
 setOffset (int $a_offset)
 set dataset offset More...
 
 getOffset ()
 
 setOrderColumn (string $a_order_column="", string $a_default_column="")
 
 getOrderColumn ()
 
 setOrderDirection (string $a_order_direction)
 
 getOrderDirection ()
 
 setFooter (string $a_style, string $a_previous="", string $a_next="")
 
 enable (string $a_module_name)
 
 disable (string $a_module_name)
 
 sortData ()
 
 render ()
 
 renderHeader ()
 
 setOrderLink (string $key, string $order_dir)
 
 setStyle (string $a_element, string $a_style)
 
 getStyle (string $a_element)
 
 setBase (string $a_base)
 
 getBase ()
 
 getFormName ()
 get the name of the parent form More...
 
 setFormName (string $a_name="cmd")
 
 getSelectAllCheckbox ()
 get the name of the checkbox that should be toggled with a select all button More...
 
 setSelectAllCheckbox (string $a_select_all_checkbox)
 
 clearActionButtons ()
 
 addActionButton (string $btn_name, string $btn_value)
 

Protected Member Functions

 isColumnVisible (int $index)
 
 fillRow (array $a_set)
 
 removeInvisibleFields (array $row)
 
 getColumnDefinition (bool $use_cached_result=true)
 
 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
 getRequestedValues ()
 
 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, ilTableFilterItem $a_element)
 Check if filter element is based on adv md. More...
 
 fillRow (array $a_set)
 Standard Version of Fill Row. More...
 
 getFilterValue (ilTableFilterItem $a_item)
 Get current filter value. More...
 
 setFilterValue (ilTableFilterItem $a_item, $a_value)
 
 fillMetaExcel (ilExcel $a_excel, int &$a_row)
 Add meta information to excel export. More...
 
 fillHeaderExcel (ilExcel $a_excel, int &$a_row)
 Excel Version of Fill Header. More...
 
 fillRowExcel (ilExcel $a_excel, int &$a_row, array $a_set)
 Excel Version of Fill Row. More...
 
 fillMetaCSV (ilCSVWriter $a_csv)
 Add meta information to csv export. More...
 
 fillHeaderCSV (ilCSVWriter $a_csv)
 CSV Version of Fill Header. More...
 
 fillRowCSV (ilCSVWriter $a_csv, array $a_set)
 CSV Version of Fill Row. More...
 

Protected Attributes

array $_folderNode = []
 
int $_number_of_mails = 0
 
array $_selectedItems = []
 
ilObjUser $user
 
array $filter = []
 
array $sub_filter = []
 
array $visibleOptionalColumns = []
 
array $optionalColumns = []
 
array $optional_filter = []
 
- Protected Attributes inherited from ilTable2GUI
string $requested_tmpl_delete
 
string $requested_tmpl_create
 
string $requested_nav_par2 = ""
 
string $requested_nav_par = ""
 
string $requested_nav_par1 = ""
 
ILIAS Table TableGUIRequest $table_request = null
 
array $selected_columns = []
 
ilCtrl $ctrl
 
object $parent_obj = null
 
string $parent_cmd = ""
 
string $close_command = ""
 
string $top_anchor = "il_table_top"
 
array $filters = array()
 
array $optional_filters = array()
 
string $filter_cmd = 'applyFilter'
 
string $reset_cmd = 'resetFilter'
 
int $filter_cols = 5
 
bool $ext_sort = false
 
bool $ext_seg = false
 
string $context = ""
 
array $mi_sel_buttons = []
 
bool $disable_filter_hiding = false
 
bool $top_commands = true
 
array $selectable_columns = array()
 
array $selected_column = array()
 
bool $show_templates = false
 
bool $show_rows_selector = true
 
bool $rows_selector_off = false
 
bool $nav_determined = false
 
bool $limit_determined = false
 
bool $filters_determined = false
 
bool $columns_determined = false
 
bool $open_form_tag = true
 
bool $close_form_tag = true
 
array $export_formats = []
 
int $export_mode = 0
 
bool $print_mode = false
 
bool $enable_command_for_all = false
 
bool $restore_filter = false
 
array $restore_filter_values = []
 
bool $default_filter_visibility = false
 
array $sortable_fields = array()
 
bool $prevent_double_submission = true
 
string $row_selector_label = ""
 
bool $select_all_on_top = false
 
array $sel_buttons = []
 
string $nav_value = ''
 
string $noentriestext = ''
 
string $css_row = ''
 
bool $display_as_block = false
 
string $description = ''
 
string $id = ""
 
bool $custom_prev_next = false
 
string $reset_cmd_txt = ""
 
string $defaultorderfield = ""
 
string $defaultorderdirection = ""
 
array $column = []
 
bool $datatable = false
 
bool $num_info = false
 
bool $form_multipart = false
 
array $row_data = []
 
string $order_field = ""
 
array $selected_filter = []
 
string $form_action = ""
 
string $formname = ""
 
string $sort_order = ""
 
array $buttons = []
 
array $multi = []
 
array $hidden_inputs = []
 
array $header_commands = []
 
string $row_template = ""
 
string $row_template_dir = ""
 
string $filter_cmd_txt = ""
 
string $custom_prev = ""
 
string $custom_next = ""
 
array $raw_post_data = null
 
ilGlobalTemplateInterface $main_tpl
 
- Protected Attributes inherited from ilTableGUI
string $sort_order
 
string $link_params
 
array $header_params
 
 $tpl
 
ilLanguage $lng
 

Private Member Functions

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

Private Attributes

readonly GlobalHttpState $http
 
readonly Factory $uiFactory
 
readonly Renderer $uiRenderer
 
array $column_definition = null
 

Additional Inherited Members

- Static Public Member Functions inherited from ilTable2GUI
static getAllCommandLimit ()
 
- Static Public Member Functions inherited from ilTableGUI
static linkbar (string $AScript, int $AHits, int $ALimit, int $AOffset, array $AParams=array(), array $ALayout=array(), string $prefix='')
 
- 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
string $title = ""
 
string $icon = ""
 
string $icon_alt = ""
 
string $help_page = ""
 
string $help_icon = ""
 
string $help_icon_alt = ""
 
array $header_names = []
 
array $header_vars = []
 
array $linkbar_vars = []
 
array $data = []
 
int $column_count = 0
 
array $column_width = []
 
int $max_count = 0
 
int $limit = 0
 
bool $max_limit = false
 
int $offset = 0
 
string $order_column = ""
 
string $order_direction = ""
 
string $footer_style = ""
 
string $footer_previous = ""
 
string $footer_next = ""
 
bool $lang_support = true
 
bool $global_tpl = false
 
string $form_name = ""
 
string $select_all_checkbox = ""
 
array $action_buttons = []
 
string $prefix = ""
 
string $base = ""
 
array $enabled
 
array $styles
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilMailFolderTableGUI::__construct ( protected ilMailFolderGUI  $_parentObject,
protected int  $_currentFolderId,
string  $a_parent_cmd,
protected bool  $_isTrashFolder,
protected bool  $_isSentFolder,
protected bool  $_isDraftsFolder,
Factory  $uiFactory = null,
Renderer  $uiRenderer = null 
)

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

References ilTable2GUI\$column, $DIC, ILIAS\MetaData\Repository\Validation\Data\__construct(), ilTable2GUI\addColumn(), ILIAS\Repository\ctrl(), getColumnDefinition(), ilTable2GUI\getParentObject(), getSelectableColumns(), ilTable2GUI\getSelectedColumns(), ILIAS\FileDelivery\http(), initFilter(), isColumnVisible(), 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 ILIAS\Repository\user().

55  {
56  global $DIC;
57  $this->user = $DIC->user();
58  $this->uiFactory = $uiFactory ?? $DIC->ui()->factory();
59  $this->uiRenderer = $uiRenderer ?? $DIC->ui()->renderer();
60  $this->http = $DIC->http();
61 
62  $this->setId('mail_folder_tbl_' . $_currentFolderId);
63  $this->setPrefix('mtable');
64 
65  $this->setExternalSorting(true);
66  $this->setExternalSegmentation(true);
67  $this->setDefaultOrderField('send_time');
68  $this->setDefaultOrderDirection('desc');
69 
70  parent::__construct($_parentObject, $a_parent_cmd);
71 
72  $this->ctrl->setParameter($this->getParentObject(), 'mobj_id', $this->_currentFolderId);
73  $this->setFormAction($this->ctrl->getFormAction($this->getParentObject(), 'showFolder'));
74  $this->ctrl->clearParameters($this->getParentObject());
75 
76  $this->setEnableTitle(true);
77  $this->setSelectAllCheckbox('mail_id[]');
78  $this->setRowTemplate('tpl.mail_folder_row.html', 'Services/Mail');
79 
80  $this->setFilterCommand('applyFilter');
81  $this->setResetCommand('resetFilter');
82 
83  $this->initFilter();
84 
85  $columns = $this->getColumnDefinition(false);
86  $this->optionalColumns = $this->getSelectableColumns();
87  $this->visibleOptionalColumns = $this->getSelectedColumns();
88  foreach ($columns as $index => $column) {
89  if ($this->isColumnVisible($index)) {
90  $this->addColumn(
91  $column['txt'],
92  isset($column['sortable']) && $column['sortable'] ? $column['field'] : '',
93  $column['width'] ?? '',
94  isset($column['is_checkbox']) && $column['is_checkbox']
95  );
96  }
97  }
98  }
setFormAction(string $a_form_action, bool $a_multipart=false)
setEnableTitle(bool $a_enabletitle)
setResetCommand(string $a_val, string $a_caption="")
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
setId(string $a_val)
global $DIC
Definition: feed.php:28
setExternalSorting(bool $a_val)
static http()
Fetches the global http state from ILIAS.
__construct(VocabulariesInterface $vocabularies)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setFilterCommand(string $a_val, string $a_caption="")
setDefaultOrderDirection(string $a_defaultorderdirection)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
setExternalSegmentation(bool $a_val)
getColumnDefinition(bool $use_cached_result=true)
setPrefix(string $a_prefix)
+ Here is the call graph for this function:

Member Function Documentation

◆ addForwardRowAction()

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

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

References ILIAS\Repository\ctrl(), isDraftFolder(), ILIAS\Repository\lng(), and ilMailFormGUI\MAIL_FORM_TYPE_FORWARD.

Referenced by formatActionsDropDown().

829  : void
830  {
831  if (!$this->isDraftFolder()) {
832  $this->ctrl->setParameterByClass(
833  ilMailFormGUI::class,
834  'mobj_id',
835  $this->_currentFolderId
836  );
837  $this->ctrl->setParameterByClass(
838  ilMailFormGUI::class,
839  'mail_id',
840  (int) $mail['mail_id']
841  );
842  $this->ctrl->setParameterByClass(
843  ilMailFormGUI::class,
844  'type',
846  );
847  $forwardButton = $this->uiFactory
848  ->link()
849  ->standard(
850  $this->lng->txt('forward'),
851  $this->ctrl->getLinkTargetByClass(ilMailFormGUI::class)
852  );
853  $this->ctrl->clearParametersByClass(ilMailFormGUI::class);
854 
855  $buttons[] = $forwardButton;
856  }
857  }
final const MAIL_FORM_TYPE_FORWARD
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addPrintRowAction()

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

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

References ILIAS\Repository\ctrl(), ilTable2GUI\getParentObject(), isDraftFolder(), and ILIAS\Repository\lng().

Referenced by formatActionsDropDown().

859  : void
860  {
861  if (!$this->isDraftFolder()) {
862  $this->ctrl->setParameter($this->getParentObject(), 'mobj_id', $this->_currentFolderId);
863  $this->ctrl->setParameter($this->getParentObject(), 'mail_id', (int) $mail['mail_id']);
864  $printButton = $this->uiFactory
865  ->link()
866  ->standard(
867  $this->lng->txt('print'),
868  $this->ctrl->getLinkTarget($this->getParentObject(), 'printMail')
869  )->withOpenInNewViewport(true);
870  $this->ctrl->clearParameters($this->getParentObject());
871 
872  $buttons[] = $printButton;
873  }
874  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addReplyRowAction()

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

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

References ANONYMOUS_USER_ID, ILIAS\Repository\ctrl(), isDraftFolder(), ILIAS\Repository\lng(), and ilMailFormGUI\MAIL_FORM_TYPE_REPLY.

Referenced by formatActionsDropDown().

796  : void
797  {
798  if (
799  isset($mail['sender_id']) && $mail['sender_id'] > 0 && $mail['sender_id'] !== ANONYMOUS_USER_ID &&
800  !$this->isDraftFolder()
801  ) {
802  $this->ctrl->setParameterByClass(
803  ilMailFormGUI::class,
804  'mobj_id',
805  $this->_currentFolderId
806  );
807  $this->ctrl->setParameterByClass(
808  ilMailFormGUI::class,
809  'mail_id',
810  (int) $mail['mail_id']
811  );
812  $this->ctrl->setParameterByClass(
813  ilMailFormGUI::class,
814  'type',
816  );
817  $replyButton = $this->uiFactory
818  ->link()
819  ->standard(
820  $this->lng->txt('reply'),
821  $this->ctrl->getLinkTargetByClass(ilMailFormGUI::class)
822  );
823  $this->ctrl->clearParametersByClass(ilMailFormGUI::class);
824 
825  $buttons[] = $replyButton;
826  }
827  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
final const MAIL_FORM_TYPE_REPLY
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addViewRowAction()

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

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

References ILIAS\Repository\ctrl(), ilTable2GUI\getParentObject(), isDraftFolder(), ILIAS\Repository\lng(), and ilMailFormGUI\MAIL_FORM_TYPE_DRAFT.

Referenced by formatActionsDropDown().

756  : void
757  {
758  if ($this->isDraftFolder()) {
759  $this->ctrl->setParameterByClass(
760  ilMailFormGUI::class,
761  'mail_id',
762  (int) $mail['mail_id']
763  );
764  $this->ctrl->setParameterByClass(
765  ilMailFormGUI::class,
766  'mobj_id',
767  $this->_currentFolderId
768  );
769  $this->ctrl->setParameterByClass(
770  ilMailFormGUI::class,
771  'type',
773  );
774  $viewButton = $this->uiFactory
775  ->link()
776  ->standard(
777  $this->lng->txt('view'),
778  $this->ctrl->getLinkTargetByClass(ilMailFormGUI::class)
779  );
780  $this->ctrl->clearParametersByClass(ilMailFormGUI::class);
781  } else {
782  $this->ctrl->setParameter($this->getParentObject(), 'mail_id', (int) $mail['mail_id']);
783  $this->ctrl->setParameter($this->getParentObject(), 'mobj_id', $this->_currentFolderId);
784  $viewButton = $this->uiFactory
785  ->link()
786  ->standard(
787  $this->lng->txt('view'),
788  $this->ctrl->getLinkTarget($this->getParentObject(), 'showMail')
789  );
790  $this->ctrl->clearParameters($this->getParentObject());
791  }
792 
793  $buttons[] = $viewButton;
794  }
final const MAIL_FORM_TYPE_DRAFT
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fetchTableData()

ilMailFolderTableGUI::fetchTableData ( )
protected
Exceptions
Exception

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

References ilTableGUI\$data, Vendor\Package\$e, ilMailBoxQuery\$filter, $filter, ilMailBoxQuery\$filtered_ids, ilMailBoxQuery\$folderId, ILIAS\LTI\ToolProvider\$key, ilMailBoxQuery\$limit, ilMailBoxQuery\$offset, ilMailBoxQuery\$orderColumn, ilMailBoxQuery\$orderDirection, ilMailBoxQuery\$userId, ilMail\_getIliasMailerName(), ilMailBoxQuery\_getMailBoxListData(), ANONYMOUS_USER_ID, ILIAS\Repository\ctrl(), ilTable2GUI\determineOffsetAndOrder(), ILIAS\Repository\filter(), formatActionsDropDown(), ilDatePresentation\formatDate(), ilUtil\getImagePath(), ilTable2GUI\getLimit(), ilTable2GUI\getOffset(), ilTableGUI\getOrderDirection(), ilTable2GUI\getOrderField(), ilTable2GUI\getParentObject(), ilObjUser\getPersonalPicturePath(), ilObjUser\getPublicName(), getSelectedItems(), ilMailUserCache\getUserObjectById(), ilUtil\htmlencodePlainString(), IL_CAL_DATETIME, isDraftFolder(), isSentFolder(), ILIAS\Repository\lng(), ilMailFormGUI\MAIL_FORM_TYPE_DRAFT, ilMailUserCache\preloadUserObjects(), ilTable2GUI\resetOffset(), ilTable2GUI\setData(), ilTableGUI\setMaxCount(), setNumberOfMails(), setTitleData(), shouldUseLuceneSearch(), and ILIAS\Repository\user().

Referenced by prepareHTML().

348  : self
349  {
350  $data = [];
351  if ($this->_folderNode['m_type'] === 'user_folder') {
352  $txt_folder = $this->_folderNode['title'];
353  $img_folder = 'icon_user_folder.png';
354  } else {
355  $txt_folder = $this->lng->txt('mail_' . $this->_folderNode['title']);
356  $img_folder = 'icon' . substr($this->_folderNode['title'], 1) . '.png';
357  }
358 
359  $result = null;
360 
361  try {
362  if ($this->shouldUseLuceneSearch()) {
363  $query_parser = new ilMailLuceneQueryParser($this->filter['mail_filter'] ?? '');
364  $query_parser->setFields([
365  'title' => (bool) ($this->filter['mail_filter_subject'] ?? false),
366  'content' => (bool) ($this->filter['mail_filter_body'] ?? false),
367  'mattachment' => (bool) ($this->filter['mail_filter_attach'] ?? false),
368  'msender' => (bool) ($this->filter['mail_filter_sender'] ?? false),
369  'mrcp' => (bool) ($this->filter['mail_filter_recipients'] ?? false)
370  ]);
371  $query_parser->parse();
372 
373  $result = new ilMailSearchResult();
374  $searcher = new ilMailLuceneSearcher($query_parser, $result);
375  $searcher->search($this->user->getId(), $this->_currentFolderId);
376 
377  if (!$result->getIds()) {
378  throw new ilMailException('mail_search_empty_result');
379  }
380 
381  ilMailBoxQuery::$filtered_ids = $result->getIds();
383  'mail_filter_only_unread' => $this->filter['mail_filter_only_unread'] ?? false,
384  'mail_filter_only_with_attachments' => $this->filter['mail_filter_only_with_attachments'] ?? false,
385  ];
386  } else {
388  }
389 
390  if (
391  isset(ilMailBoxQuery::$filter['mail_filter_only_unread']) &&
392  ($this->isDraftFolder() || $this->isSentFolder())
393  ) {
394  unset(ilMailBoxQuery::$filter['mail_filter_only_unread']);
395  }
396 
397  if (isset(ilMailBoxQuery::$filter['mail_filter_only_with_attachments']) && $this->isDraftFolder()) {
398  unset(ilMailBoxQuery::$filter['mail_filter_only_with_attachments']);
399  }
400 
401  $this->determineOffsetAndOrder();
402 
403  ilMailBoxQuery::$folderId = $this->_currentFolderId;
404  ilMailBoxQuery::$userId = $this->user->getId();
405  ilMailBoxQuery::$limit = $this->getLimit();
410 
411  if ($data['set'] === [] && $this->getOffset() > 0) {
412  $this->resetOffset();
413 
414  ilMailBoxQuery::$limit = $this->getLimit();
417  }
418  } catch (Exception $e) {
419  if ('mail_search_empty_result' === $e->getMessage()) {
420  $data['set'] = [];
421  $data['cnt'] = 0;
422  $data['cnt_unread'] = 0;
423  } else {
424  throw $e;
425  }
426  }
427 
428  if (!$this->isDraftFolder() && !$this->isSentFolder()) {
429  $user_ids = [];
430  foreach ($data['set'] as $mail) {
431  if ($mail['sender_id'] && $mail['sender_id'] !== ANONYMOUS_USER_ID) {
432  $user_ids[$mail['sender_id']] = $mail['sender_id'];
433  }
434  }
435 
437  }
438 
439 
440  foreach ($data['set'] as $key => $mail) {
441  if (is_array($this->getSelectedItems()) &&
442  in_array($mail['mail_id'], $this->getSelectedItems(), false)
443  ) {
444  $mail['checked'] = ' checked="checked" ';
445  }
446 
447  $mail['txt_select_mail_with_subject'] = sprintf(
448  $this->lng->txt('select_mail_with_subject_x'),
449  htmlspecialchars($mail['m_subject'] ?? '')
450  );
451 
452  if ($this->isDraftFolder() || $this->isSentFolder()) {
453  $mail['rcp_to'] = $mail['mail_login'] = ilUtil::htmlencodePlainString(
454  $this->_parentObject->umail->formatNamesForOutput((string) $mail['rcp_to']),
455  false
456  );
457  } elseif ($mail['sender_id'] === ANONYMOUS_USER_ID) {
458  $mail['img_sender'] = ilUtil::getImagePath('logo/HeaderIconAvatar.svg');
459  $mail['from'] =
460  $mail['mail_login'] =
461  $mail['alt_sender'] =
462  htmlspecialchars(ilMail::_getIliasMailerName());
463  } else {
464  $user = ilMailUserCache::getUserObjectById($mail['sender_id']);
465 
466  if ($user !== null) {
467  $mail['img_sender'] = $user->getPersonalPicturePath('xxsmall');
468  $mail['from'] = $mail['mail_login'] = $mail['alt_sender'] = htmlspecialchars(
470  );
471  } else {
472  $mail['img_sender'] = '';
473  $mail['from'] = $mail['mail_login'] = trim(($mail['import_name'] ?? '') . ' ('
474  . $this->lng->txt('user_deleted') . ')');
475  }
476  }
477 
478  if ($this->isDraftFolder()) {
479  $this->ctrl->setParameterByClass(
480  ilMailFormGUI::class,
481  'mail_id',
482  $mail['mail_id']
483  );
484  $this->ctrl->setParameterByClass(
485  ilMailFormGUI::class,
486  'mobj_id',
487  $this->_currentFolderId
488  );
489  $this->ctrl->setParameterByClass(
490  ilMailFormGUI::class,
491  'type',
493  );
494  $link_mark_as_read = $this->ctrl->getLinkTargetByClass(ilMailFormGUI::class);
495  $this->ctrl->clearParametersByClass(ilMailFormGUI::class);
496  } else {
497  $this->ctrl->setParameter($this->getParentObject(), 'mail_id', $mail['mail_id']);
498  $this->ctrl->setParameter($this->getParentObject(), 'mobj_id', $this->_currentFolderId);
499  $link_mark_as_read = $this->ctrl->getLinkTarget($this->getParentObject(), 'showMail');
500  $this->ctrl->clearParameters($this->getParentObject());
501  }
502  $css_class = $mail['m_status'] === 'read' ? 'mailread' : 'mailunread';
503 
504  if ($result instanceof ilMailSearchResult) {
505  $search_result = [];
506  foreach ($result->getFields($mail['mail_id']) as $content) {
507  if ('title' === $content[0]) {
508  $mail['msr_subject_link_read'] = $link_mark_as_read;
509  $mail['msr_subject_mailclass'] = $css_class;
510  $mail['msr_subject'] = $content[1];
511  } else {
512  $search_result[] = $content[1];
513  }
514  }
515  $mail['msr_data'] = implode('', array_map(static function ($value): string {
516  return '<p>' . $value . '</p>';
517  }, $search_result));
518 
519  if (!isset($mail['msr_subject']) || !$mail['msr_subject']) {
520  $mail['msr_subject_link_read'] = $link_mark_as_read;
521  $mail['msr_subject_mailclass'] = $css_class;
522  $mail['msr_subject'] = htmlspecialchars($mail['m_subject'] ?? '');
523  }
524  $mail['msr_subject_read_unread'] = $mail['m_status'] === 'read' ? $this->lng->txt('mail_is_read') : $this->lng->txt('mail_is_unread');
525  } else {
526  $mail['mail_link_read'] = $link_mark_as_read;
527  $mail['mailclass'] = $css_class;
528  if ($mail['m_subject']) {
529  $mail['mail_subject'] = htmlspecialchars($mail['m_subject']);
530  } else {
531  $mail['mail_subject'] = $this->lng->txt('mail_no_subject');
532  }
533  $mail['mail_subject_read_unread'] = $mail['m_status'] === 'read' ? $this->lng->txt('mail_is_read') : $this->lng->txt('mail_is_unread');
534  }
535 
536  $mail['mail_date'] = ilDatePresentation::formatDate(
537  new ilDateTime($mail['send_time'], IL_CAL_DATETIME)
538  );
539 
540  $mail['attachment_indicator'] = '';
541  if (is_array($mail['attachments']) && $mail['attachments'] !== []) {
542  $this->ctrl->setParameter($this->getParentObject(), 'mail_id', (int) $mail['mail_id']);
543  if ($this->isDraftFolder()) {
544  $this->ctrl->setParameter($this->getParentObject(), 'type', ilMailFormGUI::MAIL_FORM_TYPE_DRAFT);
545  }
546  $this->ctrl->setParameter($this->getParentObject(), 'mobj_id', $this->_currentFolderId);
547  $mail['attachment_indicator'] = $this->uiRenderer->render(
548  $this->uiFactory->symbol()->glyph()->attachment(
549  $this->ctrl->getLinkTarget($this->getParentObject(), 'deliverAttachments')
550  )
551  );
552  $this->ctrl->clearParameters($this->getParentObject());
553  }
554 
555  $mail['actions'] = $this->formatActionsDropDown($mail);
556 
557  $data['set'][$key] = $mail;
558  }
559 
560  $this->setData($data['set']);
561  $this->setMaxCount((int) $data['cnt']);
562  $this->setNumberOfMails((int) $data['cnt']);
563 
564  $this->setTitleData($txt_folder, (int) $data['cnt'], (int) $data['cnt_unread'], $img_folder);
565 
566  return $this;
567  }
setData(array $a_data)
const IL_CAL_DATETIME
const ANONYMOUS_USER_ID
Definition: constants.php:27
static getUserObjectById(int $usr_id)
final const MAIL_FORM_TYPE_DRAFT
setTitleData(string $folderLabel, int $mailCount, int $unreadCount, string $imgFolder)
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
static string $orderDirection
static _getIliasMailerName()
getPublicName()
returns firstname lastname and login if profile is public, login otherwise
static string $orderColumn
static htmlencodePlainString(string $a_str, bool $a_make_links_clickable, bool $a_detect_goto_links=false)
Encodes a plain text string into HTML for display in a browser.
resetOffset(bool $a_in_determination=false)
static preloadUserObjects(array $usr_ids)
string $key
Consumer key/client ID value.
Definition: System.php:193
setNumberOfMails(int $a_number_of_mails)
getPersonalPicturePath(string $a_size="small", bool $a_force_pic=false)
static array $filtered_ids
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
determineOffsetAndOrder(bool $a_omit_offset=false)
setMaxCount(int $a_max_count)
set max.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillRow()

ilMailFolderTableGUI::fillRow ( array  $a_set)
finalprotected

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

References ILIAS\LTI\ToolProvider\$key, and removeInvisibleFields().

130  : void
131  {
132  foreach ($this->removeInvisibleFields($a_set) as $key => $value) {
133  $this->tpl->setVariable(strtoupper($key), $value);
134  }
135  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:

◆ formatActionsDropDown()

ilMailFolderTableGUI::formatActionsDropDown ( array  $mail)
protected

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

References ilTable2GUI\$buttons, addForwardRowAction(), addPrintRowAction(), addReplyRowAction(), addViewRowAction(), and ILIAS\Repository\lng().

Referenced by fetchTableData().

739  : string
740  {
741  $buttons = [];
742 
743  $this->addViewRowAction($mail, $buttons);
744  $this->addReplyRowAction($mail, $buttons);
745  $this->addForwardRowAction($mail, $buttons);
746  $this->addPrintRowAction($mail, $buttons);
747 
748  $dropDown = $this->uiFactory
749  ->dropdown()
750  ->standard($buttons)
751  ->withLabel($this->lng->txt('actions'));
752 
753  return $this->uiRenderer->render([$dropDown]);
754  }
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 ( bool  $use_cached_result = true)
protected

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

References $column_definition, isDraftFolder(), isSentFolder(), ILIAS\Repository\lng(), and shouldUseLuceneSearch().

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

150  : array
151  {
152  if ($use_cached_result && $this->column_definition !== null) {
154  }
155 
156  $i = 0;
157 
158  $columns = [];
159 
160  $columns[++$i] = [
161  'field' => 'chb',
162  'txt' => '',
163  'default' => true,
164  'optional' => false,
165  'sortable' => false,
166  'is_checkbox' => true,
167  'width' => '1%'
168  ];
169 
170  $columns[++$i] = [
171  'field' => 'attachments',
172  'txt' => $this->lng->txt('mail_tbl_head_attachments'),
173  'default' => false,
174  'optional' => true,
175  'sortable' => false,
176  'width' => '5%'
177  ];
178 
179  if (!$this->isDraftFolder() && !$this->isSentFolder()) {
180  $columns[++$i] = [
181  'field' => 'personal_picture',
182  'txt' => $this->lng->txt('personal_picture'),
183  'default' => true,
184  'optional' => true,
185  'sortable' => false,
186  'width' => '5%'
187  ];
188  }
189 
190  if ($this->isDraftFolder() || $this->isSentFolder()) {
191  $columns[++$i] = [
192  'field' => 'rcp_to',
193  'txt' => $this->lng->txt('recipient'),
194  'default' => true,
195  'optional' => false,
196  'sortable' => true,
197  'width' => '35%'
198  ];
199  } else {
200  $columns[++$i] = [
201  'field' => 'from',
202  'txt' => $this->lng->txt('sender'),
203  'default' => true,
204  'optional' => false,
205  'sortable' => true,
206  'width' => '20%'
207  ];
208  }
209 
210  if ($this->shouldUseLuceneSearch()) {
211  $columns[++$i] = [
212  'field' => 'search_content',
213  'txt' => $this->lng->txt('search_content'),
214  'default' => true,
215  'optional' => false,
216  'sortable' => false,
217  'width' => '35%'
218  ];
219  } else {
220  $columns[++$i] = [
221  'field' => 'm_subject',
222  'txt' => $this->lng->txt('subject'),
223  'default' => true,
224  'optional' => false,
225  'sortable' => true,
226  'width' => '35%'
227  ];
228  }
229 
230  $columns[++$i] = [
231  'field' => 'send_time',
232  'txt' => $this->lng->txt('date'),
233  'default' => true,
234  'optional' => false,
235  'sortable' => true,
236  'width' => '20%'
237  ];
238 
239  $columns[++$i] = [
240  'field' => 'actions',
241  'txt' => $this->lng->txt('actions'),
242  'default' => true,
243  'optional' => false,
244  'sortable' => false,
245  'width' => '5%'
246  ];
247 
248  $this->column_definition = $columns;
250  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHTML()

ilMailFolderTableGUI::getHTML ( )

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

References ILIAS\Repository\ctrl(), and ilTable2GUI\getParentObject().

876  : string
877  {
878  $this->ctrl->setParameter($this->getParentObject(), 'mobj_id', $this->_currentFolderId);
879  $html = parent::getHTML();
880  $this->ctrl->clearParameters($this->getParentObject());
881 
882  return $html;
883  }
+ Here is the call graph for this function:

◆ getNumberOfMails()

ilMailFolderTableGUI::getNumberOfMails ( )

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

References $_number_of_mails.

Referenced by initCommandButtons().

598  : int
599  {
601  }
+ Here is the caller graph for this function:

◆ getSelectableColumns()

ilMailFolderTableGUI::getSelectableColumns ( )

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

References ilTable2GUI\$column, and getColumnDefinition().

Referenced by __construct().

100  : array
101  {
102  $optionalColumns = array_filter($this->getColumnDefinition(), static function (array $column): bool {
103  return isset($column['optional']) && $column['optional'];
104  });
105 
106  $columns = [];
107  foreach ($optionalColumns as $column) {
108  $columns[$column['field']] = $column;
109  }
110 
111  return $columns;
112  }
getColumnDefinition(bool $use_cached_result=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelectedItems()

ilMailFolderTableGUI::getSelectedItems ( )

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

References $_selectedItems.

Referenced by fetchTableData().

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

◆ initCommandButtons()

ilMailFolderTableGUI::initCommandButtons ( )
private

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

References ilTable2GUI\addCommandButton(), getNumberOfMails(), and ILIAS\Repository\lng().

Referenced by prepareHTML().

284  : self
285  {
286  if ($this->_folderNode['m_type'] === 'trash' && $this->getNumberOfMails() > 0) {
287  $this->addCommandButton('confirmEmptyTrash', $this->lng->txt('mail_empty_trash'));
288  }
289 
290  return $this;
291  }
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFilter()

ilMailFolderTableGUI::initFilter ( )

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

References $duration, ilTable2GUI\addFilterItem(), ILIAS\Repository\filter(), IL_CAL_UNIX, ILIAS\Repository\int(), isDraftFolder(), isLuceneEnabled(), isSentFolder(), ILIAS\Repository\lng(), and ilTextInputGUI\setSubmitFormOnEnter().

Referenced by __construct().

603  : void
604  {
605  $this->filter = [];
606 
607  $quickFilter = new ilMailQuickFilterInputGUI($this->lng->txt('mail_filter'), 'mail_filter');
608  $quickFilter->setSubmitFormOnEnter(false);
609  $this->addFilterItem($quickFilter);
610  $quickFilter->readFromSession();
611  $this->filter['mail_filter'] = $quickFilter->getValue();
612 
613  if ($this->isDraftFolder() || $this->isSentFolder()) {
614  $this->sub_filter[] = $subFilterInRecipients = new ilCheckboxInputGUI(
615  $this->lng->txt('mail_filter_recipients'),
616  'mail_filter_recipients'
617  );
618  $subFilterInRecipients->setOptionTitle($this->lng->txt('mail_filter_recipients'));
619  $subFilterInRecipients->setValue('1');
620  $quickFilter->addSubItem($subFilterInRecipients);
621  $subFilterInRecipients->setParentTable($this);
622  $subFilterInRecipients->readFromSession();
623  $this->filter['mail_filter_recipients'] = (int) $subFilterInRecipients->getChecked();
624  } else {
625  $this->sub_filter[] = $subFilterInSender = new ilCheckboxInputGUI(
626  $this->lng->txt('mail_filter_sender'),
627  'mail_filter_sender'
628  );
629  $subFilterInSender->setOptionTitle($this->lng->txt('mail_filter_sender'));
630  $subFilterInSender->setValue('1');
631  $quickFilter->addSubItem($subFilterInSender);
632  $subFilterInSender->setParentTable($this);
633  $subFilterInSender->readFromSession();
634  $this->filter['mail_filter_sender'] = (int) $subFilterInSender->getChecked();
635  }
636 
637  $this->sub_filter[] = $subFilterInSubject = new ilCheckboxInputGUI(
638  $this->lng->txt('mail_filter_subject'),
639  'mail_filter_subject'
640  );
641  $subFilterInSubject->setOptionTitle($this->lng->txt('mail_filter_subject'));
642  $subFilterInSubject->setValue('1');
643  $quickFilter->addSubItem($subFilterInSubject);
644  $subFilterInSubject->setParentTable($this);
645  $subFilterInSubject->readFromSession();
646  $this->filter['mail_filter_subject'] = (int) $subFilterInSubject->getChecked();
647 
648  $this->sub_filter[] = $subFilterInBody = new ilCheckboxInputGUI(
649  $this->lng->txt('mail_filter_body'),
650  'mail_filter_body'
651  );
652  $subFilterInBody->setOptionTitle($this->lng->txt('mail_filter_body'));
653  $subFilterInBody->setValue('1');
654  $quickFilter->addSubItem($subFilterInBody);
655  $subFilterInBody->setParentTable($this);
656  $subFilterInBody->readFromSession();
657  $this->filter['mail_filter_body'] = (int) $subFilterInBody->getChecked();
658 
659  if ($this->isLuceneEnabled()) {
660  $this->sub_filter[] = $subFilterInAttachments = new ilCheckboxInputGUI(
661  $this->lng->txt('mail_filter_attach'),
662  'mail_filter_attach'
663  );
664  $subFilterInAttachments->setOptionTitle($this->lng->txt('mail_filter_attach'));
665  $subFilterInAttachments->setValue('1');
666  $quickFilter->addSubItem($subFilterInAttachments);
667  $subFilterInAttachments->setParentTable($this);
668  $subFilterInAttachments->readFromSession();
669  $this->filter['mail_filter_attach'] = (int) $subFilterInAttachments->getChecked();
670  }
671 
672  if (!$this->isDraftFolder() && !$this->isSentFolder()) {
673  $onlyUnread = new ilCheckboxInputGUI(
674  $this->lng->txt('mail_filter_only_unread'),
675  'mail_filter_only_unread'
676  );
677  $onlyUnread->setValue('1');
678  $this->addFilterItem($onlyUnread);
679  $onlyUnread->readFromSession();
680  $this->filter['mail_filter_only_unread'] = (int) $onlyUnread->getChecked();
681 
682  $onlyUserMails = new ilCheckboxInputGUI(
683  $this->lng->txt('mail_filter_only_user_mails'),
684  'mail_filter_only_user_mails'
685  );
686  $onlyUserMails->setValue('1');
687  $this->addFilterItem($onlyUserMails);
688  $onlyUserMails->readFromSession();
689  $this->filter['mail_filter_only_user_mails'] = (int) $onlyUserMails->getChecked();
690  }
691 
692  if (!$this->isDraftFolder()) {
693  $onlyWithAttachments = new ilCheckboxInputGUI(
694  $this->lng->txt('mail_filter_only_with_attachments'),
695  'mail_filter_only_with_attachments'
696  );
697  $onlyWithAttachments->setValue('1');
698  $this->addFilterItem($onlyWithAttachments);
699  $onlyWithAttachments->readFromSession();
700  $this->filter['mail_filter_only_with_attachments'] = (int) $onlyWithAttachments->getChecked();
701  }
702 
703  $duration = new ilDateDurationInputGUI($this->lng->txt('mail_filter_period'), 'period');
704  $duration->setAllowOpenIntervals(true);
705  $duration->setStartText($this->lng->txt('mail_filter_period_from'));
706  $duration->setEndText($this->lng->txt('mail_filter_period_until'));
707  $duration->setStart(new ilDateTime(null, IL_CAL_UNIX));
708  $duration->setEnd(new ilDateTime(null, IL_CAL_UNIX));
709  $duration->setShowTime(false);
710  $this->addFilterItem($duration);
711  $duration->readFromSession();
712  $this->filter['period'] = $duration->getValue();
713  }
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
const IL_CAL_UNIX
$duration
setSubmitFormOnEnter(bool $a_val)
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initMultiCommands()

ilMailFolderTableGUI::initMultiCommands ( array  $actions)
private

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

References ILIAS\LTI\ToolProvider\$key, ilTable2GUI\addMultiCommand(), isTrashFolder(), and ILIAS\Repository\lng().

Referenced by prepareHTML().

293  : self
294  {
295  foreach ($actions as $key => $action) {
296  if ($key === 'moveMails') {
297  $folders = $this->_parentObject->mbox->getSubFolders();
298  foreach ($folders as $folder) {
299  if ($folder['type'] !== 'trash' || !$this->isTrashFolder()) {
300  if ($folder['type'] !== 'user_folder') {
301  $label = $action . ' ' . $this->lng->txt('mail_' . $folder['title']) .
302  ($folder['type'] === 'trash' ? ' (' . $this->lng->txt('delete') . ')' : '');
303  $this->addMultiCommand($key . '_' . $folder['obj_id'], $label);
304  } else {
305  $this->addMultiCommand(
306  $key . '_' . $folder['obj_id'],
307  $action . ' ' . $folder['title']
308  );
309  }
310  }
311  }
312  } elseif ($key !== 'deleteMails' || $this->isTrashFolder()) {
313  $this->addMultiCommand($key, $action);
314  }
315  }
316 
317  return $this;
318  }
string $key
Consumer key/client ID value.
Definition: System.php:193
addMultiCommand(string $a_cmd, string $a_text)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isColumnVisible()

ilMailFolderTableGUI::isColumnVisible ( int  $index)
protected

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

References ilTable2GUI\$column, and getColumnDefinition().

Referenced by __construct().

114  : bool
115  {
116  $columnDefinition = $this->getColumnDefinition();
117  if (array_key_exists($index, $columnDefinition)) {
118  $column = $columnDefinition[$index];
119  if (isset($column['optional']) && !$column['optional']) {
120  return true;
121  }
122  if (array_key_exists($column['field'], $this->visibleOptionalColumns)) {
123  return true;
124  }
125  }
126 
127  return false;
128  }
getColumnDefinition(bool $use_cached_result=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isDraftFolder()

ilMailFolderTableGUI::isDraftFolder ( )

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

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

269  : bool
270  {
271  return $this->_isDraftsFolder;
272  }
+ Here is the caller graph for this function:

◆ isLuceneEnabled()

ilMailFolderTableGUI::isLuceneEnabled ( )
private

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

References ilSearchSettings\getInstance().

Referenced by initFilter(), and shouldUseLuceneSearch().

340  : bool
341  {
342  return ilSearchSettings::getInstance()->enabledLucene();
343  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isSentFolder()

ilMailFolderTableGUI::isSentFolder ( )

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

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

274  : bool
275  {
276  return $this->_isSentFolder;
277  }
+ Here is the caller graph for this function:

◆ isTrashFolder()

ilMailFolderTableGUI::isTrashFolder ( )

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

Referenced by initMultiCommands().

279  : bool
280  {
281  return $this->_isTrashFolder;
282  }
+ Here is the caller graph for this function:

◆ prepareHTML()

ilMailFolderTableGUI::prepareHTML ( )
final
Exceptions
Exception

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

References fetchTableData(), initCommandButtons(), initMultiCommands(), and ILIAS\Repository\user().

255  : self
256  {
257  $mtree = new ilTree($this->user->getId());
258  $mtree->setTableNames('mail_tree', 'mail_obj_data');
259  $this->_folderNode = $mtree->getNodeData($this->_currentFolderId);
260 
261  $this->fetchTableData();
262 
263  $this->initCommandButtons();
264  $this->initMultiCommands($this->_parentObject->mbox->getActions($this->_currentFolderId));
265 
266  return $this;
267  }
+ Here is the call graph for this function:

◆ removeInvisibleFields()

ilMailFolderTableGUI::removeInvisibleFields ( array  $row)
protected

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

Referenced by fillRow().

137  : array
138  {
139  if (!array_key_exists('attachments', $this->visibleOptionalColumns)) {
140  unset($row['attachment_indicator']);
141  }
142 
143  if (!array_key_exists('personal_picture', $this->visibleOptionalColumns)) {
144  unset($row['img_sender'], $row['alt_sender']);
145  }
146 
147  return $row;
148  }
+ Here is the caller graph for this function:

◆ resetFilter()

ilMailFolderTableGUI::resetFilter ( )

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

References ILIAS\FileDelivery\http().

727  : void
728  {
729  parent::resetFilter();
730 
731  foreach ($this->sub_filter as $item) {
732  if ($item->checkInput()) {
733  $item->setValueByArray($this->http->request()->getParsedBody());
734  $item->clearFromSession();
735  }
736  }
737  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

◆ setNumberOfMails()

ilMailFolderTableGUI::setNumberOfMails ( int  $a_number_of_mails)

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

Referenced by fetchTableData().

591  : self
592  {
593  $this->_number_of_mails = $a_number_of_mails;
594 
595  return $this;
596  }
+ Here is the caller graph for this function:

◆ setSelectedItems()

ilMailFolderTableGUI::setSelectedItems ( array  $a_selected_items)

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

320  : self
321  {
322  $this->_selectedItems = $a_selected_items;
323 
324  return $this;
325  }

◆ setTitleData()

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

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

References ILIAS\Repository\lng(), and ilTable2GUI\setTitle().

Referenced by fetchTableData().

572  : self
573  {
574  $titleTemplate = new ilTemplate(
575  'tpl.mail_folder_title.html',
576  true,
577  true,
578  'Services/Mail'
579  );
580  $titleTemplate->setVariable('TXT_FOLDER', $folderLabel);
581  $titleTemplate->setVariable('MAIL_COUNT', $mailCount);
582  $titleTemplate->setVariable('TXT_MAIL_S', $this->lng->txt('mail_s'));
583  $titleTemplate->setVariable('MAIL_COUNT_UNREAD', $unreadCount);
584  $titleTemplate->setVariable('TXT_UNREAD', $this->lng->txt('unread'));
585 
586  $this->setTitle($titleTemplate->get(), $imgFolder);
587 
588  return $this;
589  }
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ shouldUseLuceneSearch()

ilMailFolderTableGUI::shouldUseLuceneSearch ( )
protected

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

References ILIAS\Repository\filter(), and isLuceneEnabled().

Referenced by fetchTableData(), and getColumnDefinition().

332  : bool
333  {
334  return isset($this->filter['mail_filter']) &&
335  is_string($this->filter['mail_filter']) &&
336  $this->filter['mail_filter'] !== '' &&
337  $this->isLuceneEnabled();
338  }
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeFilterToSession()

ilMailFolderTableGUI::writeFilterToSession ( )

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

References ILIAS\FileDelivery\http().

715  : void
716  {
717  parent::writeFilterToSession();
718 
719  foreach ($this->sub_filter as $item) {
720  if ($item->checkInput()) {
721  $item->setValueByArray($this->http->request()->getParsedBody());
722  $item->writeToSession();
723  }
724  }
725  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

Field Documentation

◆ $_folderNode

array ilMailFolderTableGUI::$_folderNode = []
protected

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

◆ $_number_of_mails

int ilMailFolderTableGUI::$_number_of_mails = 0
protected

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

Referenced by getNumberOfMails().

◆ $_selectedItems

array ilMailFolderTableGUI::$_selectedItems = []
protected

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

Referenced by getSelectedItems().

◆ $column_definition

array ilMailFolderTableGUI::$column_definition = null
private

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

Referenced by getColumnDefinition().

◆ $filter

array ilMailFolderTableGUI::$filter = []
protected

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

Referenced by fetchTableData().

◆ $http

readonly GlobalHttpState ilMailFolderTableGUI::$http
private

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

◆ $optional_filter

array ilMailFolderTableGUI::$optional_filter = []
protected

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

◆ $optionalColumns

array ilMailFolderTableGUI::$optionalColumns = []
protected

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

◆ $sub_filter

array ilMailFolderTableGUI::$sub_filter = []
protected

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

◆ $uiFactory

readonly Factory ilMailFolderTableGUI::$uiFactory
private

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

◆ $uiRenderer

readonly Renderer ilMailFolderTableGUI::$uiRenderer
private

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

◆ $user

ilObjUser ilMailFolderTableGUI::$user
protected

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

◆ $visibleOptionalColumns

array ilMailFolderTableGUI::$visibleOptionalColumns = []
protected

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


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