ILIAS  release_7 Revision v7.30-3-g800a261c036
ilSumOfFileSizesTooLargeInteraction Class Reference

Class ilSumOfFileSizesTooLargeInteraction. More...

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

Public Member Functions

 __construct ()
 
 getInputTypes ()
 
Returns
Type[] A list of types that are taken as input.
More...
 
 getOutputType ()
 @inheritDoc 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...
 
 interaction (array $input, Option $user_selected_option, Bucket $bucket)
 @inheritDoc More...
 
 getOptions (array $input)
 
Parameters
Value[]$inputThe input value of this task.
Returns
Option[] Options are buttons the user can press on this interaction.
More...
 
 getMessage (array $input)
 @inheritDoc More...
 
 canBeSkipped (array $input)
 @inheritDoc More...
 
 getSkippedValue (array $input)
 
Parameters
array$input
Returns
Value
More...
 
 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)
 

Data Fields

const OPTION_OK = 'ok'
 
const OPTION_SKIP = 'skip'
 
- Data Fields inherited from ILIAS\BackgroundTasks\Implementation\Tasks\AbstractTask
const MAIN_REMOVE = 'bt_main_remove'
 
const MAIN_ABORT = 'bt_main_abort'
 

Protected Attributes

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

Private Attributes

 $logger = null
 

Additional Inherited Members

- 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 31 of file class.ilSumOfFileSizesTooLargeInteraction.php.

32 {
33 global $DIC;
34 $this->logger = $DIC->logger()->cal();
35 $this->lng = $DIC->language();
36 $this->lng->loadLanguageModule('background_tasks');
37 }
global $DIC
Definition: goto.php:24

References $DIC.

Member Function Documentation

◆ canBeSkipped()

ilSumOfFileSizesTooLargeInteraction::canBeSkipped ( array  $input)

@inheritDoc

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

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

104 : bool
105 {
106 $copy_definition = $input[0];
107 if ($copy_definition->getAdheresToLimit()->getValue()) {
108 // skip the user interaction if the adherence to the global limit for the sum of file sizes
109 // hasn't been violated (as this interaction is used as an error message and mustn't be
110 // shown when everything is fine))
111
112 return true;
113 } else {
114 return false;
115 }
116 }

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

◆ getInputTypes()

ilSumOfFileSizesTooLargeInteraction::getInputTypes ( )

Returns
Type[] A list of types that are taken as input.

Implements ILIAS\BackgroundTasks\Task.

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

44 {
45 return [
46 new SingleType(ilCopyDefinition::class),
47 ];
48 }

◆ getMessage()

ilSumOfFileSizesTooLargeInteraction::getMessage ( array  $input)

@inheritDoc

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

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

96 {
97 return $message = $this->lng->txt('ui_msg_files_violate_maxsize');
98 }
$message
Definition: xapiexit.php:14

References $message.

◆ getOptions()

ilSumOfFileSizesTooLargeInteraction::getOptions ( array  $input)

Parameters
Value[]$inputThe input value of this task.
Returns
Option[] Options are buttons the user can press on this interaction.

Implements ILIAS\BackgroundTasks\Task\UserInteraction.

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

87 {
88 return array();
89 }

◆ getOutputType()

ilSumOfFileSizesTooLargeInteraction::getOutputType ( )

@inheritDoc

Implements ILIAS\BackgroundTasks\Task.

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

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

◆ 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 63 of file class.ilSumOfFileSizesTooLargeInteraction.php.

◆ getSkippedValue()

ilSumOfFileSizesTooLargeInteraction::getSkippedValue ( array  $input)

◆ interaction()

ilSumOfFileSizesTooLargeInteraction::interaction ( array  $input,
Option  $user_selected_option,
Bucket  $bucket 
)

@inheritDoc

Implements ILIAS\BackgroundTasks\Task\UserInteraction.

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

73 {
74 if ($user_selected_option->getValue() == self::OPTION_OK) {
75 // Set state to finished to stop the BackgroundTask and remove it from the popover.
76 $bucket->setState(3);
77 }
78
79 return $definition = $input[0];
80 }

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 127 of file class.ilSumOfFileSizesTooLargeInteraction.php.

127 : bool
128 {
129 return false;
130 }

Field Documentation

◆ $lng

ilSumOfFileSizesTooLargeInteraction::$lng
protected

◆ $logger

ilSumOfFileSizesTooLargeInteraction::$logger = null
private

◆ OPTION_OK

const ilSumOfFileSizesTooLargeInteraction::OPTION_OK = 'ok'

◆ OPTION_SKIP

const ilSumOfFileSizesTooLargeInteraction::OPTION_SKIP = 'skip'

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