ILIAS  release_7 Revision v7.30-3-g800a261c036
DownloadInteger.php
Go to the documentation of this file.
1<?php
2
4
12
13require_once("./Services/FileDelivery/classes/class.ilPHPOutputDelivery.php");
14
25{
26
32 public function getOptions(array $input)
33 {
34 return [
35 new UserInteractionOption("download", "download"),
36 ];
37 }
38
39
47 public function interaction(array $input, Option $user_selected_option, Bucket $bucket)
48 {
50 $integerValue = $input[0];
51 global $DIC;
52
53 if ($user_selected_option->getValue() == "download") {
54 $outputter = new \ilPHPOutputDelivery();
55 $outputter->start("IntegerFile");
56 echo $integerValue->getValue();
57 $outputter->stop();
58 }
59
60 return $integerValue;
61 }
62
63
67 public function getInputTypes()
68 {
69 return [
70 new SingleType(IntegerValue::class),
71 ];
72 }
73
74
78 public function getOutputType()
79 {
80 return new SingleType(IntegerValue::class);
81 }
82}
An exception for terminatinating execution or to throw for unit testing.
global $DIC
Definition: goto.php:24
interaction(array $input, Option $user_selected_option, Bucket $bucket)