ILIAS
release_8 Revision v8.24
◀ ilDoc Overview
class.ilSumOfFileSizesTooLargeInteraction.php
Go to the documentation of this file.
1
<?php
2
19
use
ILIAS\BackgroundTasks\Bucket
;
20
use
ILIAS\BackgroundTasks\Implementation\Tasks\AbstractUserInteraction
;
21
use
ILIAS\BackgroundTasks\Implementation\Tasks\UserInteraction\UserInteractionOption
;
22
use
ILIAS\BackgroundTasks\Task\UserInteraction\Option
;
23
use
ILIAS\BackgroundTasks\Types\SingleType
;
24
use
ILIAS\BackgroundTasks\Types\Type
;
25
use
ILIAS\BackgroundTasks\Value
;
26
32
class
ilSumOfFileSizesTooLargeInteraction
extends
AbstractUserInteraction
33
{
34
private
const
OPTION_OK
=
'ok'
;
35
36
protected
ilLanguage
$lng
;
37
38
public
function
__construct
()
39
{
40
global
$DIC
;
41
$this->
lng
= $DIC->language();
42
$this->
lng
->loadLanguageModule(
'background_tasks'
);
43
}
44
48
public
function
getInputTypes
(): array
49
{
50
return
[
51
new
SingleType
(ilCopyDefinition::class),
52
];
53
}
54
55
public
function
getOutputType
():
Type
56
{
57
return
new
SingleType
(ilCopyDefinition::class);
58
}
59
60
public
function
getRemoveOption
():
Option
61
{
62
return
new
UserInteractionOption
(
'ok'
, self::OPTION_OK);
63
}
64
65
public
function
interaction
(array
$input
,
Option
$user_selected_option,
Bucket
$bucket):
Value
66
{
67
if
($user_selected_option->
getValue
() == self::OPTION_OK) {
68
// Set state to finished to stop the BackgroundTask and remove it from the popover.
69
$bucket->
setState
(3);
70
}
71
72
return
$input
[0];
73
}
74
78
public
function
getOptions
(array
$input
): array
79
{
80
return
array();
81
}
82
83
public
function
getMessage
(array
$input
): string
84
{
85
return
$this->
lng
->txt(
'ui_msg_files_violate_maxsize'
);
86
}
87
88
public
function
canBeSkipped
(array
$input
): bool
89
{
90
$copy_definition =
$input
[0];
91
if
($copy_definition->getAdheresToLimit()->getValue()) {
92
// skip the user interaction if the adherence to the global limit for the sum of file sizes
93
// hasn't been violated (as this interaction is used as an error message and mustn't be
94
// shown when everything is fine))
95
96
return
true
;
97
}
else
{
98
return
false
;
99
}
100
}
101
102
public
function
getSkippedValue
(array
$input
):
Value
103
{
104
return
$input
[0];
105
}
106
107
public
function
isFinal
(): bool
108
{
109
return
false
;
110
}
111
}
ILIAS\BackgroundTasks\Implementation\Tasks\AbstractTask\$input
array $input
Definition:
AbstractTask.php:44
ILIAS\BackgroundTasks\Implementation\Tasks\AbstractUserInteraction
Definition:
AbstractUserInteraction.php:30
ILIAS\BackgroundTasks\Implementation\Tasks\UserInteraction\UserInteractionOption
Definition:
UserInteractionOption.php:24
ILIAS\BackgroundTasks\Types\SingleType
Definition:
SingleType.php:22
ilLanguage
language handling
Definition:
class.ilLanguage.php:44
ilSumOfFileSizesTooLargeInteraction
Class ilSumOfFileSizesTooLargeInteraction.
Definition:
class.ilSumOfFileSizesTooLargeInteraction.php:33
ilSumOfFileSizesTooLargeInteraction\__construct
__construct()
Definition:
class.ilSumOfFileSizesTooLargeInteraction.php:38
ilSumOfFileSizesTooLargeInteraction\getRemoveOption
getRemoveOption()
Option An Option to remove the current task and do some cleanup if possible. This Option is displayed...
Definition:
class.ilSumOfFileSizesTooLargeInteraction.php:60
ilSumOfFileSizesTooLargeInteraction\getOptions
getOptions(array $input)
Definition:
class.ilSumOfFileSizesTooLargeInteraction.php:78
ilSumOfFileSizesTooLargeInteraction\getSkippedValue
getSkippedValue(array $input)
Definition:
class.ilSumOfFileSizesTooLargeInteraction.php:102
ilSumOfFileSizesTooLargeInteraction\getOutputType
getOutputType()
Definition:
class.ilSumOfFileSizesTooLargeInteraction.php:55
ilSumOfFileSizesTooLargeInteraction\$lng
ilLanguage $lng
Definition:
class.ilSumOfFileSizesTooLargeInteraction.php:36
ilSumOfFileSizesTooLargeInteraction\getMessage
getMessage(array $input)
@inheritDoc
Definition:
class.ilSumOfFileSizesTooLargeInteraction.php:83
ilSumOfFileSizesTooLargeInteraction\canBeSkipped
canBeSkipped(array $input)
@inheritDoc
Definition:
class.ilSumOfFileSizesTooLargeInteraction.php:88
ilSumOfFileSizesTooLargeInteraction\interaction
interaction(array $input, Option $user_selected_option, Bucket $bucket)
Definition:
class.ilSumOfFileSizesTooLargeInteraction.php:65
ilSumOfFileSizesTooLargeInteraction\isFinal
isFinal()
Definition:
class.ilSumOfFileSizesTooLargeInteraction.php:107
ilSumOfFileSizesTooLargeInteraction\OPTION_OK
const OPTION_OK
Definition:
class.ilSumOfFileSizesTooLargeInteraction.php:34
ilSumOfFileSizesTooLargeInteraction\getInputTypes
getInputTypes()
Definition:
class.ilSumOfFileSizesTooLargeInteraction.php:48
$DIC
global $DIC
Definition:
feed.php:28
ILIAS\BackgroundTasks\Bucket
Definition:
Bucket.php:30
ILIAS\BackgroundTasks\Bucket\setState
setState(int $state)
ILIAS\BackgroundTasks\Task\UserInteraction\Option
Definition:
Option.php:28
ILIAS\BackgroundTasks\Task\UserInteraction\Option\getValue
getValue()
ILIAS\BackgroundTasks\Types\Type
Definition:
Type.php:22
ILIAS\BackgroundTasks\Value
Definition:
Value.php:30
ILIAS\Repository\lng
lng()
Definition:
trait.GlobalDICDomainServices.php:56
Services
BackgroundTasks
classes
UserInteractions
class.ilSumOfFileSizesTooLargeInteraction.php
Generated on Sun Nov 2 2025 22:01:29 for ILIAS by
1.9.4 (using
Doxyfile
)