19 declare(strict_types=1);
35 private readonly
string $target_url,
36 private readonly
bool $lucene_enabled,
38 private readonly
Factory $ui_factory,
44 if ($this->folder->hasIncomingMails()) {
45 $inputs[
'sender'] = $this->ui_factory->input()->field()->text($this->
lng->txt(
'mail_filter_sender'));
47 $inputs[
'recipients'] = $this->ui_factory->input()->field()->text(
48 $this->
lng->txt(
'mail_filter_recipients')
52 $inputs[
'subject'] = $this->ui_factory->input()->field()->text($this->
lng->txt(
'mail_filter_subject'));
53 $inputs[
'body'] = $this->ui_factory->input()->field()->text($this->
lng->txt(
'mail_filter_body'));
55 if ($this->lucene_enabled) {
56 $inputs[
'attachment'] = $this->ui_factory->input()->field()->text($this->
lng->txt(
'mail_filter_attach'));
59 $inputs[
'display'] = $this->ui_factory->input()->field()->multiSelect($this->
lng->txt(
'mail_filter_display'), [
60 'read' => $this->
lng->txt(
'mail_filter_show_read'),
61 'unread' => $this->
lng->txt(
'mail_filter_show_unread'),
62 'user' => $this->
lng->txt(
'mail_filter_show_user_mails'),
63 'system' => $this->
lng->txt(
'mail_filter_show_system_mails'),
64 'with_attachment' => $this->
lng->txt(
'mail_filter_show_with_attachments'),
65 'without_attachment' => $this->
lng->txt(
'mail_filter_show_without_attachment')
67 $inputs[
'period'] = $this->ui_factory
68 ->input()->field()->duration($this->
lng->txt(
'mail_filter_period'))
69 ->withTimezone($this->user_time_zone->getName());
71 $this->
filter = $this->filter_service->standard(
96 $data = $this->filter_service->getData($this->
filter);
100 $has_attachment =
null;
103 if (\is_array($display =
$data[
'display'] ??
null)) {
104 if (\in_array(
'read', $display,
true) xor \in_array(
'unread', $display,
true)) {
105 $is_unread = \in_array(
'unread', $display,
true);
107 if (\in_array(
'system', $display,
true) xor \in_array(
'user', $display,
true)) {
108 $is_system = \in_array(
'system', $display,
true);
110 if (\in_array(
'with_attachment', $display,
true) xor \in_array(
'without_attachment', $display,
true)) {
111 $has_attachment = \in_array(
'with_attachment', $display,
true);
116 if ((
$data[
'period'][0] ??
'') !==
'') {
120 if ((
$data[
'period'][1] ??
'') !==
'') {
125 (
$data[
'sender'] ??
'') ===
'' ? null : (
string)
$data[
'sender'],
126 ($data[
'recipients'] ??
'') ===
'' ? null : (
string) $data[
'recipients'],
127 ($data[
'subject'] ??
'') ===
'' ? null : (
string) $data[
'subject'],
128 ($data[
'body'] ??
'') ===
'' ? null : $data[
'body'],
129 ($data[
'attachment'] ??
'') ===
'' ? null : (
string) $data[
'attachment'],
readonly FilterComponent $filter
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
This is how the factory for UI elements looks.
getData()
Get the user entered filter data.
Filter data for display of mail records Properties with null value will not be applied as a filter...
getComponent()
Get the filter UI component.
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
__construct(private readonly string $target_url, private readonly bool $lucene_enabled, private readonly MailFolderData $folder, private readonly Factory $ui_factory, private readonly ilUIFilterService $filter_service, private readonly ilLanguage $lng, private readonly DateTimeZone $user_time_zone)