ILIAS  release_8 Revision v8.24
ilSumOfFileSizesTooLargeInteraction Class Reference

Class ilSumOfFileSizesTooLargeInteraction. More...

+ Inheritance diagram for ilSumOfFileSizesTooLargeInteraction:
+ Collaboration diagram for ilSumOfFileSizesTooLargeInteraction:

Public Member Functions

 __construct ()
 
 getInputTypes ()
 
 getOutputType ()
 
 getRemoveOption ()
 
Returns
Option An Option to remove the current task and do some cleanup if possible. This Option is displayed if the Bucket is completed. You do not have to provide an additional Option to remove in your UserInteraction, the remove-Option is added to the list of Options (last position)
See also
self::getAbortOption();
More...
 
 interaction (array $input, Option $user_selected_option, Bucket $bucket)
 
 getOptions (array $input)
 
 getMessage (array $input)
 @inheritDoc More...
 
 canBeSkipped (array $input)
 @inheritDoc More...
 
 getSkippedValue (array $input)
 
 isFinal ()
 
 getMessage (array $input)
 @inheritDoc More...
 
 canBeSkipped (array $input)
 @inheritDoc More...
 
 getSkippedValue (array $input)
 
 isFinal ()
 
- Public Member Functions inherited from ILIAS\BackgroundTasks\Implementation\Tasks\AbstractTask
 setInput (array $values)
 
 getOutput ()
 
 getInput ()
 
 getType ()
 
 unfoldTask ()
 Unfold the task. More...
 
 getRemoveOption ()
 
Returns
Option An Option to remove the current task and do some cleanup if possible. This Option is displayed if the Bucket is completed. You do not have to provide an additional Option to remove in your UserInteraction, the remove-Option is added to the list of Options (last position)
See also
self::getAbortOption();
More...
 
 getAbortOption ()
 
Returns
Option In case a Job is failed or did not respond for some time, an Abort-Option is displayed. There is already a Standard-Abort-Option registered, you can override with your own and do some cleanup if possible.
More...
 
 getType ()
 
 getInputTypes ()
 
 getOutputType ()
 
 getOutput ()
 
 setInput (array $values)
 
 getInput ()
 
 unfoldTask ()
 
 getRemoveOption ()
 
 getAbortOption ()
 
 getOptions (array $input)
 
 canBeSkipped (array $input)
 Decide whether the UserInteraction is presented to the user and he has to decide or user UserInteraction is skipped by the TaskManager. More...
 
 getSkippedValue (array $input)
 
 isFinal ()
 
 interaction (array $input, Option $user_selected_option, Bucket $bucket)
 
 getMessage (array $input)
 

Protected Attributes

ilLanguage $lng
 
- Protected Attributes inherited from ILIAS\BackgroundTasks\Implementation\Tasks\AbstractTask
array $input = []
 
ILIAS BackgroundTasks Value $output
 

Private Attributes

const OPTION_OK = 'ok'
 

Additional Inherited Members

- Data Fields inherited from ILIAS\BackgroundTasks\Implementation\Tasks\AbstractTask
const MAIN_REMOVE = 'bt_main_remove'
 
const MAIN_ABORT = 'bt_main_abort'
 
- Protected Member Functions inherited from ILIAS\BackgroundTasks\Implementation\Tasks\AbstractTask
 checkTypes ($values)
 
 extractType ($value)
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilSumOfFileSizesTooLargeInteraction::__construct ( )

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

39 {
40 global $DIC;
41 $this->lng = $DIC->language();
42 $this->lng->loadLanguageModule('background_tasks');
43 }
global $DIC
Definition: feed.php:28

References $DIC, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Member Function Documentation

◆ canBeSkipped()

ilSumOfFileSizesTooLargeInteraction::canBeSkipped ( array  $input)

@inheritDoc

Reimplemented from ILIAS\BackgroundTasks\Implementation\Tasks\AbstractUserInteraction.

Definition at line 88 of file class.ilSumOfFileSizesTooLargeInteraction.php.

88 : 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 }

References ILIAS\BackgroundTasks\Implementation\Tasks\AbstractTask\$input.

◆ getInputTypes()

ilSumOfFileSizesTooLargeInteraction::getInputTypes ( )
Returns
\ILIAS\BackgroundTasks\Types\SingleType[]

Implements ILIAS\BackgroundTasks\Task.

Definition at line 48 of file class.ilSumOfFileSizesTooLargeInteraction.php.

48 : array
49 {
50 return [
51 new SingleType(ilCopyDefinition::class),
52 ];
53 }

◆ getMessage()

ilSumOfFileSizesTooLargeInteraction::getMessage ( array  $input)

@inheritDoc

Reimplemented from ILIAS\BackgroundTasks\Implementation\Tasks\AbstractUserInteraction.

Definition at line 83 of file class.ilSumOfFileSizesTooLargeInteraction.php.

83 : string
84 {
85 return $this->lng->txt('ui_msg_files_violate_maxsize');
86 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getOptions()

ilSumOfFileSizesTooLargeInteraction::getOptions ( array  $input)
Returns
mixed[]

Implements ILIAS\BackgroundTasks\Task\UserInteraction.

Definition at line 78 of file class.ilSumOfFileSizesTooLargeInteraction.php.

78 : array
79 {
80 return array();
81 }

◆ getOutputType()

ilSumOfFileSizesTooLargeInteraction::getOutputType ( )

Implements ILIAS\BackgroundTasks\Task.

Definition at line 55 of file class.ilSumOfFileSizesTooLargeInteraction.php.

55 : Type
56 {
57 return new SingleType(ilCopyDefinition::class);
58 }

◆ getRemoveOption()

ilSumOfFileSizesTooLargeInteraction::getRemoveOption ( )

Returns
Option An Option to remove the current task and do some cleanup if possible. This Option is displayed if the Bucket is completed. You do not have to provide an additional Option to remove in your UserInteraction, the remove-Option is added to the list of Options (last position)
See also
self::getAbortOption();

Reimplemented from ILIAS\BackgroundTasks\Implementation\Tasks\AbstractTask.

Definition at line 60 of file class.ilSumOfFileSizesTooLargeInteraction.php.

◆ getSkippedValue()

ilSumOfFileSizesTooLargeInteraction::getSkippedValue ( array  $input)
Parameters
Value[]$input
See also
canBeSkipped, whenever you decide to skip the UserInteraction, you have to return a valid Value to proceed.

Reimplemented from ILIAS\BackgroundTasks\Implementation\Tasks\AbstractUserInteraction.

Definition at line 102 of file class.ilSumOfFileSizesTooLargeInteraction.php.

102 : Value
103 {
104 return $input[0];
105 }

References ILIAS\BackgroundTasks\Implementation\Tasks\AbstractTask\$input.

◆ interaction()

ilSumOfFileSizesTooLargeInteraction::interaction ( array  $input,
Option  $user_selected_option,
Bucket  $bucket 
)
Parameters
\ILIAS\BackgroundTasks\Value[]$inputThe input value of this task.
Option$user_selected_optionThe Option the user chose.
Bucket$bucketNotify the bucket about your progress!

Implements ILIAS\BackgroundTasks\Task\UserInteraction.

Definition at line 65 of file class.ilSumOfFileSizesTooLargeInteraction.php.

65 : 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 }

References ILIAS\BackgroundTasks\Implementation\Tasks\AbstractTask\$input, ILIAS\BackgroundTasks\Task\UserInteraction\Option\getValue(), and ILIAS\BackgroundTasks\Bucket\setState().

+ Here is the call graph for this function:

◆ isFinal()

ilSumOfFileSizesTooLargeInteraction::isFinal ( )
Returns
bool true if this is the last skippable interaction in your chain/bucket, defaults to true.

Reimplemented from ILIAS\BackgroundTasks\Implementation\Tasks\AbstractUserInteraction.

Definition at line 107 of file class.ilSumOfFileSizesTooLargeInteraction.php.

107 : bool
108 {
109 return false;
110 }

Field Documentation

◆ $lng

ilLanguage ilSumOfFileSizesTooLargeInteraction::$lng
protected

◆ OPTION_OK

const ilSumOfFileSizesTooLargeInteraction::OPTION_OK = 'ok'
private

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