ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilMailAttachmentGUI Class Reference
+ Inheritance diagram for ilMailAttachmentGUI:
+ Collaboration diagram for ilMailAttachmentGUI:

Public Member Functions

 __construct ()
 ilUIDemoFileUploadHandlerGUI constructor. More...
 
 getUnsafeGetCommands ()
 This method must return a list of unsafe GET commands. More...
 
 getSafePostCommands ()
 This method must return a list of safe POST commands. More...
 
 manage ()
 
 consume ()
 
 executeCommand ()
 Since this is a ilCtrl aware UploadHandler executeCommand MUST be implemented. More...
 
 getInfoResult (string $identifier)
 
 getInfoForExistingFiles (array $file_ids)
 
 getFileIdentifierParameterName ()
 @inheritDoc More...
 
- Public Member Functions inherited from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler
 __construct ()
 ilUIDemoFileUploadHandlerGUI constructor. More...
 
 getFileIdentifierParameterName ()
 @inheritDoc More...
 
 getUploadURL ()
 @inheritDoc More...
 
 getExistingFileInfoURL ()
 @inheritDoc More...
 
 getFileRemovalURL ()
 @inheritDoc More...
 
 executeCommand ()
 Since this is a ilCtrl aware UploadHandler executeCommand MUST be implemented. More...
 
 getInfoResult (string $identifier)
 
 getInfoForExistingFiles (array $file_ids)
 
 supportsChunkedUploads ()
 
 executeCommand ()
 Since this is a ilCtrl aware UploadHandler executeCommand MUST be implemented. More...
 
 getFileIdentifierParameterName ()
 
 getUploadURL ()
 
 getFileRemovalURL ()
 
 getExistingFileInfoURL ()
 
 getInfoForExistingFiles (array $file_ids)
 
 getInfoResult (string $identifier)
 
 supportsChunkedUploads ()
 
 getUnsafeGetCommands ()
 This method must return a list of unsafe GET commands. More...
 
 getSafePostCommands ()
 This method must return a list of safe POST commands. More...
 

Protected Member Functions

 getUploadResult ()
 
 getRemoveResult (string $identifier)
 
- Protected Member Functions inherited from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler
 readChunkedInformation ()
 
 getUploadResult ()
 
 getRemoveResult (string $identifier)
 

Private Member Functions

 saveAttachments ()
 
 cancelSaveAttachmentsCommand ()
 
 confirmDeleteAttachments ()
 
 deleteAttachmentsCommand ()
 
 showAttachmentsCommand ()
 
 handleTableActionsCommand ()
 

Private Attributes

readonly ilGlobalTemplateInterface $tpl
 
readonly ilLanguage $lng
 
readonly ilObjUser $user
 
readonly ilFormatMail $umail
 
readonly ilFileDataMail $fdm
 
readonly Refinery $refinery
 
readonly ILIAS UI Factory $ui_factory
 
readonly ILIAS UI Renderer $ui_renderer
 
readonly ilTabsGUI $tabs
 
AttachmentManagement $mode = AttachmentManagement::MANAGE
 
readonly ILIAS ResourceStorage Services $storage
 

Additional Inherited Members

- Data Fields inherited from ILIAS\UI\Component\Input\Field\UploadHandler
const DEFAULT_FILE_ID_PARAMETER = 'file_id'
 
- Data Fields inherited from ILIAS\Mail\Attachments\MailAttachmentCommands
const string CMD_SHOW_ATTACHMENTS = 'showAttachments'
 
const string CMD_CANCEL_SAVE_ATTACHMENTS = 'cancelSaveAttachments'
 
const string CMD_DELETE_ATTACHMENTS = 'deleteAttachments'
 
const string CMD_HANDLE_TABLE_ACTIONS = 'handleTableActions'
 
const string DEFAULT_CMD = self::CMD_SHOW_ATTACHMENTS
 
const string TABLE_CONFIRM_DELETE_ATTACHMENTS = 'confirmDeleteAttachments'
 
const string TABLE_ACTION_SAVE_ATTACHMENTS = 'saveAttachments'
 
- Protected Attributes inherited from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler
const CMD_UPLOAD = 'upload'
 
const CMD_REMOVE = 'remove'
 
const CMD_INFO = 'info'
 
HttpServices $http
 
ilCtrl $ctrl
 
FileUpload $upload
 
bool $is_chunked = false
 
int $chunk_index = 0
 
int $amount_of_chunks = 0
 
string $chunk_id = null
 
int $chunk_total_size = 0
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilMailAttachmentGUI::__construct ( )

ilUIDemoFileUploadHandlerGUI constructor.

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

50 {
51 global $DIC;
52
54 $this->tpl = $DIC->ui()->mainTemplate();
55 $this->lng = $DIC->language();
56 $this->user = $DIC->user();
57 $this->tabs = $DIC->tabs();
58 $this->refinery = $DIC->refinery();
59 $this->ui_factory = $DIC->ui()->factory();
60 $this->ui_renderer = $DIC->ui()->renderer();
61 $this->storage = $DIC->resourceStorage();
62
63 $this->ctrl->saveParameter($this, 'mobj_id');
64
65 $this->umail = new ilFormatMail($DIC->user()->getId());
66 $this->fdm = new ilFileDataMail($DIC->user()->getId());
67 }
Every resource of the mail stakeholder belongs to exactly one collection (pool, compose stage,...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), ILIAS\Repository\tabs(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ cancelSaveAttachmentsCommand()

ilMailAttachmentGUI::cancelSaveAttachmentsCommand ( )
private

Definition at line 166 of file class.ilMailAttachmentGUI.php.

166 : void
167 {
168 $this->ctrl->setParameter($this, 'type', ilMailFormGUI::MAIL_FORM_TYPE_ATTACH);
169 $this->ctrl->returnToParent($this);
170 }
final const string MAIL_FORM_TYPE_ATTACH

References ILIAS\Repository\ctrl(), and ilMailFormGUI\MAIL_FORM_TYPE_ATTACH.

+ Here is the call graph for this function:

◆ confirmDeleteAttachments()

ilMailAttachmentGUI::confirmDeleteAttachments ( )
private

Definition at line 172 of file class.ilMailAttachmentGUI.php.

172 : void
173 {
174 $files = $this->http->wrapper()->query()->retrieve(
175 'mail_attachments_filename',
176 $this->refinery->byTrying([
177 $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->string()),
178 $this->refinery->always([])
179 ])
180 );
181
182 if ($files !== [] && $files[0] === 'ALL_OBJECTS') {
183 $files = array_map(static fn(array $file): string => $file['rid'], $this->fdm->getUserPoolFilesData());
184 }
185
186 if ($files === []) {
187 $this->tpl->setOnScreenMessage($this->tpl::MESSAGE_TYPE_INFO, $this->lng->txt('select_one'), true);
188 $this->ctrl->redirect($this);
189 }
190
191 $this->tpl->setTitle($this->lng->txt('mail_attachments'));
192
193 $confirmation = new ilConfirmationGUI();
194 $confirmation->setFormAction($this->ctrl->getFormAction($this, self::CMD_DELETE_ATTACHMENTS));
195 $confirmation->setConfirm($this->lng->txt('confirm'), self::CMD_DELETE_ATTACHMENTS);
196 $confirmation->setCancel($this->lng->txt('cancel'), self::CMD_SHOW_ATTACHMENTS);
197 $confirmation->setHeaderText($this->lng->txt('mail_sure_delete_file'));
198
199 foreach ($files as $rid_string) {
200 $title = (string) $rid_string;
201 $rid = $this->storage->manage()->find($title);
202 if ($rid !== null && $this->fdm->isInUserPool($rid)) {
203 $title = $this->storage->manage()->getCurrentRevision($rid)->getInformation()->getTitle();
204 }
205
206 $confirmation->addItem(
207 'filename[]',
208 ilUtil::stripSlashes((string) $rid_string),
210 );
211 }
212
213 $this->tpl->setContent($confirmation->getHTML());
214 $this->tpl->printToStdout();
215 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static http()
Fetches the global http state from ILIAS.

References $files, ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ilUtil\stripSlashes().

Referenced by handleTableActionsCommand().

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

◆ consume()

ilMailAttachmentGUI::consume ( )

Definition at line 87 of file class.ilMailAttachmentGUI.php.

87 : self
88 {
90 return $this;
91 }

References ILIAS\Mail\Attachments\CONSUME.

◆ deleteAttachmentsCommand()

ilMailAttachmentGUI::deleteAttachmentsCommand ( )
private

Definition at line 217 of file class.ilMailAttachmentGUI.php.

217 : void
218 {
219 $files = $this->http->wrapper()->post()->retrieve(
220 'filename',
221 $this->refinery->byTrying([
222 $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->string()),
223 $this->refinery->always([])
224 ])
225 );
226
227 if ($files === []) {
228 $this->tpl->setOnScreenMessage($this->tpl::MESSAGE_TYPE_INFO, $this->lng->txt('mail_select_one_mail'));
229 $this->showAttachmentsCommand();
230 return;
231 }
232
233 foreach ($files as $rid_string) {
234 $rid_string = (string) $rid_string;
235 if ($this->fdm->isLegacyPoolItemIdentifier($rid_string)) {
236 $this->fdm->unlinkFile($this->fdm->legacyPoolFilenameFromIdentifier($rid_string));
237 continue;
238 }
239
240 $rid = $this->storage->manage()->find($rid_string);
241 if ($rid !== null) {
242 $this->fdm->removeFromPool($rid);
243 }
244 }
245
246 $this->tpl->setOnScreenMessage($this->tpl::MESSAGE_TYPE_SUCCESS, $this->lng->txt('mail_files_deleted'), true);
247
248 $this->ctrl->redirect($this);
249 }

References $files, ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and showAttachmentsCommand().

+ Here is the call graph for this function:

◆ executeCommand()

ilMailAttachmentGUI::executeCommand ( )

Since this is a ilCtrl aware UploadHandler executeCommand MUST be implemented.

The Implementation MUST make sure, the Upload and the Removal Command are handled correctly

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Definition at line 93 of file class.ilMailAttachmentGUI.php.

93 : void
94 {
95 $cmd = $this->ctrl->getCmd();
96 switch ($cmd) {
97 case AbstractCtrlAwareUploadHandler::CMD_UPLOAD:
98 case AbstractCtrlAwareUploadHandler::CMD_INFO:
99 case AbstractCtrlAwareUploadHandler::CMD_REMOVE:
100 parent::executeCommand();
101 break;
102
103 default:
104 if ($cmd === null || $cmd === '' || !method_exists($this, $cmd . 'Command')) {
105 $cmd = self::DEFAULT_CMD;
106 }
107 $verified_command = $cmd . 'Command';
108 $this->$verified_command();
109 break;
110 }
111 }

References ILIAS\Repository\ctrl(), and ILIAS\Mail\Attachments\MailAttachmentCommands\DEFAULT_CMD.

+ Here is the call graph for this function:

◆ getFileIdentifierParameterName()

ilMailAttachmentGUI::getFileIdentifierParameterName ( )

@inheritDoc

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Definition at line 426 of file class.ilMailAttachmentGUI.php.

426 : string
427 {
428 return 'userfile';
429 }

Referenced by getInfoResult(), getRemoveResult(), and getUploadResult().

+ Here is the caller graph for this function:

◆ getInfoForExistingFiles()

ilMailAttachmentGUI::getInfoForExistingFiles ( array  $file_ids)
Parameters
array$file_ids
Returns
BasicFileInfoResult[]

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

413 : array
414 {
415 $infos = [];
416 foreach ($file_ids as $file_id) {
417 $info = $this->getInfoResult($file_id);
418 if ($info !== null) {
419 $infos[] = $info;
420 }
421 }
422
423 return $infos;
424 }
getInfoResult(string $identifier)
$info
Definition: entry_point.php:21

References $info, and getInfoResult().

+ Here is the call graph for this function:

◆ getInfoResult()

ilMailAttachmentGUI::getInfoResult ( string  $identifier)
Returns
null|FileInfoResult for the file with the given identifier or null if the file does not exist.

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Definition at line 395 of file class.ilMailAttachmentGUI.php.

396 {
397 $rid = $this->storage->manage()->find($identifier);
398 if ($rid === null || !$this->fdm->isInUserPool($rid)) {
399 return new BasicFileInfoResult($this->getFileIdentifierParameterName(), 'unknown', 'unknown', 0, 'unknown');
400 }
401
402 $info = $this->storage->manage()->getCurrentRevision($rid)->getInformation();
403
404 return new BasicFileInfoResult(
406 $identifier,
407 $info->getTitle(),
408 $info->getSize(),
409 $info->getMimeType()
410 );
411 }

References $info, and getFileIdentifierParameterName().

Referenced by getInfoForExistingFiles().

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

◆ getRemoveResult()

ilMailAttachmentGUI::getRemoveResult ( string  $identifier)
protected

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Definition at line 385 of file class.ilMailAttachmentGUI.php.

386 {
387 return new BasicHandlerResult(
389 HandlerResult::STATUS_OK,
390 $identifier,
391 'file deleted'
392 );
393 }

References getFileIdentifierParameterName().

+ Here is the call graph for this function:

◆ getSafePostCommands()

ilMailAttachmentGUI::getSafePostCommands ( )

This method must return a list of safe POST commands.

Safe post commands returned by this method will no longer be CSRF protected and will NOT be appended by an ilCtrlToken.

Returns
string[]

Implements ilCtrlSecurityInterface.

Definition at line 76 of file class.ilMailAttachmentGUI.php.

76 : array
77 {
78 return [];
79 }

◆ getUnsafeGetCommands()

ilMailAttachmentGUI::getUnsafeGetCommands ( )

This method must return a list of unsafe GET commands.

Unsafe get commands returned by this method will now be CSRF protected, which means an ilCtrlToken is appended each time a link-target is generated to the class implementing this interface with a command from that list.

Tokens will be validated in

See also
ilCtrlInterface::getCmd(), whereas the fallback command will be used if the CSRF validation fails.
Returns
string[]

Implements ilCtrlSecurityInterface.

Definition at line 69 of file class.ilMailAttachmentGUI.php.

69 : array
70 {
71 return [
73 ];
74 }

References ILIAS\Mail\Attachments\MailAttachmentCommands\CMD_HANDLE_TABLE_ACTIONS.

◆ getUploadResult()

ilMailAttachmentGUI::getUploadResult ( )
protected

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Definition at line 364 of file class.ilMailAttachmentGUI.php.

365 {
366 $this->upload->process();
367 $array = $this->upload->getResults();
368 $result = end($array);
369
370 if ($result instanceof UploadResult && $result->isOK()) {
371 $rid = $this->fdm->uploadToPool($result);
372 $status = HandlerResult::STATUS_OK;
373 $identifier = $rid->serialize();
374 $message = $this->lng->txt('saved_successfully');
375 $this->tpl->setOnScreenMessage($this->tpl::MESSAGE_TYPE_SUCCESS, $this->lng->txt('saved_successfully'), true);
376 } else {
377 $status = HandlerResult::STATUS_FAILED;
378 $identifier = '';
379 $message = $result instanceof UploadResult ? $result->getStatus()->getMessage() : '';
380 }
381
382 return new BasicHandlerResult($this->getFileIdentifierParameterName(), $status, $identifier, $message);
383 }

References $message, getFileIdentifierParameterName(), ILIAS\FileUpload\DTO\UploadResult\getStatus(), ILIAS\FileUpload\DTO\UploadResult\isOK(), ILIAS\Repository\lng(), and ILIAS\Repository\upload().

+ Here is the call graph for this function:

◆ handleTableActionsCommand()

ilMailAttachmentGUI::handleTableActionsCommand ( )
private

Definition at line 343 of file class.ilMailAttachmentGUI.php.

343 : void
344 {
345 $query = $this->http->wrapper()->query();
346 if (!$query->has('mail_attachments_table_action')) {
347 $this->tpl->setOnScreenMessage(
348 $this->tpl::MESSAGE_TYPE_FAILURE,
349 $this->lng->txt('select_one'),
350 true
351 );
352 $this->showAttachmentsCommand();
353 return;
354 }
355
356 $action = $query->retrieve('mail_attachments_table_action', $this->refinery->to()->string());
357 match ($action) {
358 self::TABLE_ACTION_SAVE_ATTACHMENTS => $this->saveAttachments(),
359 self::TABLE_CONFIRM_DELETE_ATTACHMENTS => $this->confirmDeleteAttachments(),
360 default => $this->showAttachmentsCommand(),
361 };
362 }

References confirmDeleteAttachments(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), saveAttachments(), and showAttachmentsCommand().

+ Here is the call graph for this function:

◆ manage()

ilMailAttachmentGUI::manage ( )

Definition at line 81 of file class.ilMailAttachmentGUI.php.

81 : self
82 {
83 $this->mode = AttachmentManagement::MANAGE;
84 return $this;
85 }

◆ saveAttachments()

ilMailAttachmentGUI::saveAttachments ( )
private

Definition at line 113 of file class.ilMailAttachmentGUI.php.

113 : void
114 {
115 $files_of_request = $this->http->wrapper()->query()->retrieve(
116 'mail_attachments_filename',
117 $this->refinery->byTrying([
118 $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->string()),
119 $this->refinery->always([])
120 ])
121 );
122
123 if ($files_of_request !== [] && $files_of_request[0] === 'ALL_OBJECTS') {
124 $files_of_request = array_map(static fn(array $file): string => $file['rid'], $this->fdm->getUserPoolFilesData());
125 }
126
127 $resource_identifications = $this->fdm->resolvePoolIdentifiersToResources($files_of_request);
128 $size_of_affected_files = 0;
129 foreach ($resource_identifications as $rid) {
130 $size_of_affected_files += $this->storage->manage()->getCurrentRevision($rid)->getInformation()->getSize();
131 }
132
133 if ($resource_identifications === []) {
134 $this->tpl->setOnScreenMessage($this->tpl::MESSAGE_TYPE_INFO, $this->lng->txt('select_one'), true);
135 $this->showAttachmentsCommand();
136 return;
137 }
138
139 if ($this->fdm->getAttachmentsTotalSizeLimit() !== null
140 && $size_of_affected_files > $this->fdm->getAttachmentsTotalSizeLimit()) {
141 $this->tpl->setOnScreenMessage(
142 $this->tpl::MESSAGE_TYPE_FAILURE,
143 $this->lng->txt('mail_max_size_attachments_total_error') . ' ' .
144 ilUtil::formatSize((int) $this->fdm->getAttachmentsTotalSizeLimit())
145 );
146 $this->showAttachmentsCommand();
147 return;
148 }
149
150 try {
151 $rcid = $this->fdm->applyPoolSelectionToStage($resource_identifications);
152 if ($rcid === null) {
153 throw new RuntimeException($this->lng->txt('mail_error_reading_attachment'));
154 }
155
156 $this->umail->saveAttachments(MailAttachments::fromIrss($rcid));
157 } catch (Throwable $e) {
158 $this->tpl->setOnScreenMessage($this->tpl::MESSAGE_TYPE_FAILURE, $e->getMessage(), true);
159 $this->showAttachmentsCommand();
160 return;
161 }
162
163 $this->ctrl->redirectByClass(ilMailFormGUI::class, 'returnFromAttachments');
164 }
static formatSize(int $size, string $a_mode='short', ?ilLanguage $a_lng=null)
Returns the specified file size value in a human friendly form.

References Vendor\Package\$e, ILIAS\Repository\ctrl(), ilUtil\formatSize(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and showAttachmentsCommand().

Referenced by handleTableActionsCommand().

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

◆ showAttachmentsCommand()

ilMailAttachmentGUI::showAttachmentsCommand ( )
private

Definition at line 251 of file class.ilMailAttachmentGUI.php.

251 : void
252 {
253 $this->tpl->setTitle($this->lng->txt('mail_attachments'));
254
255 if ($this->mode === AttachmentManagement::CONSUME) {
256 $this->tabs->clearTargets();
257 $this->tabs->setBackTarget(
258 $this->lng->txt('mail_manage_attachments_back_to_compose'),
259 $this->ctrl->getLinkTarget($this, self::CMD_CANCEL_SAVE_ATTACHMENTS)
260 );
261 }
262
263 $components = [];
264 if ($this->mode === AttachmentManagement::MANAGE) {
265 $dropzone = $this->ui_factory
266 ->dropzone()
267 ->file()
268 ->standard(
269 $this->lng->txt('mail_manage_attachments'),
270 $this->lng->txt('mail_manage_attachments_drop_files_msg'),
271 '#',
272 $this->ui_factory->input()->field()->file(
273 $this,
274 $this->lng->txt('file')
275 )->withMaxFiles(42) // The answer to life, universe and the rest
276 )
277 ->withBulky(true)
278 ->withUploadButton(
279 $this->ui_factory->button()->shy(
280 $this->lng->txt('select_files_from_computer'),
281 '#'
282 )
283 );
284 $components[] = $dropzone;
285 }
286
287 $mail_data = $this->umail->retrieveFromStage();
288 $stage_attachments = $mail_data['attachments'] ?? null;
289 $adopted_pool_rids = [];
290 if ($stage_attachments instanceof MailAttachments && $stage_attachments->isIrss()) {
291 $adopted_pool_rids = array_flip($this->fdm->getPoolResourcesInStage($stage_attachments->rcid()));
292 }
293
294 $files = $this->fdm->getUserPoolFilesData();
295 $records = [];
296 $checked_items = [];
297 foreach ($files as $file) {
298 if (isset($adopted_pool_rids[$file['rid']])) {
299 $checked_items[] = $file['rid'];
300 }
301
302 $records[] = [
303 'rid' => $file['rid'],
304 'filename' => $file['name'],
305 'filesize' => (int) $file['size'],
306 'filecreatedate' => (int) $file['ctime'],
307 ];
308 }
309
310 $table = new MailAttachmentTableGUI(
311 $this,
312 $this->user,
313 $records,
314 $this->ui_factory,
315 $this->ui_renderer,
316 $this->lng,
317 $this->ctrl,
318 $this->http->request(),
319 new ILIAS\Data\Factory(),
320 self::CMD_HANDLE_TABLE_ACTIONS,
321 $this->mode
322 );
323 $components[] = $table->get();
324
325 $this->tpl->setContent($this->ui_renderer->render($components));
326
327 if ($this->mode === AttachmentManagement::CONSUME) {
328 // The table above has to be rendered first, because it deselects all checkboxes
329 $this->tpl->addOnLoadCode('
330 const checked_items = ' . json_encode($checked_items, JSON_THROW_ON_ERROR) . ';
331 for (const item of checked_items) {
332 const checkbox = document.querySelector("input[type=\'checkbox\'][value=\'" + item + "\']");
333 if (checkbox) {
334 checkbox.checked = true;
335 }
336 }
337 ');
338 }
339
340 $this->tpl->printToStdout();
341 }
$components
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.

References $components, $files, ILIAS\Mail\Attachments\CONSUME, ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\int(), ILIAS\Mail\Attachments\MailAttachments\isIrss(), ILIAS\Repository\lng(), ILIAS\Repository\tabs(), and ILIAS\Repository\user().

Referenced by deleteAttachmentsCommand(), handleTableActionsCommand(), and saveAttachments().

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

Field Documentation

◆ $fdm

readonly ilFileDataMail ilMailAttachmentGUI::$fdm
private

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

◆ $lng

readonly ilLanguage ilMailAttachmentGUI::$lng
private

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

◆ $mode

AttachmentManagement ilMailAttachmentGUI::$mode = AttachmentManagement::MANAGE
private

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

◆ $refinery

readonly Refinery ilMailAttachmentGUI::$refinery
private

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

◆ $storage

readonly ILIAS ResourceStorage Services ilMailAttachmentGUI::$storage
private

Definition at line 47 of file class.ilMailAttachmentGUI.php.

◆ $tabs

readonly ilTabsGUI ilMailAttachmentGUI::$tabs
private

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

◆ $tpl

readonly ilGlobalTemplateInterface ilMailAttachmentGUI::$tpl
private

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

◆ $ui_factory

readonly ILIAS UI Factory ilMailAttachmentGUI::$ui_factory
private

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

◆ $ui_renderer

readonly ILIAS UI Renderer ilMailAttachmentGUI::$ui_renderer
private

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

◆ $umail

readonly ilFormatMail ilMailAttachmentGUI::$umail
private

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

◆ $user

readonly ilObjUser ilMailAttachmentGUI::$user
private

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


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