ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.StandardGUIRequest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Container;
22
24
26{
28
29 public function __construct(
32 ) {
33 $this->initRequest(
34 $http,
36 );
37 }
38
39 public function getRefId(): int
40 {
41 return $this->int("ref_id");
42 }
43
44 public function getItemRefId(): int
45 {
46 return $this->int("item_ref_id");
47 }
48
49 public function getRedirectSource(): string
50 {
51 return $this->str("redirectSource");
52 }
53
54 public function getNewType(): string
55 {
56 return $this->str("new_type");
57 }
58
59 public function getType(): string
60 {
61 return $this->str("type");
62 }
63
64 public function getBaseClass(): string
65 {
66 return $this->str("baseClass");
67 }
68
70 public function getSelectedIds(): array
71 {
72 if ($this->int("item_ref_id") > 0) {
73 $ids = [$this->int("item_ref_id")];
74 } else {
75 $ids = $this->intArray("id");
76 }
77 return $ids;
78 }
79
80 public function getCloneSource(): int
81 {
82 return $this->int("clone_source");
83 }
84
85 public function getCmdRefId(): int
86 {
87 return $this->int("cmdrefid");
88 }
89
90 public function getChildRefId(): int
91 {
92 return $this->int("child_ref_id");
93 }
94
95 public function getParentRefId(): int
96 {
97 return $this->int("parent_ref_id");
98 }
99
100 public function getExpand(): int
101 {
102 return $this->int("expand");
103 }
104
105 public function getBlockAction(): string
106 {
107 return $this->str("act");
108 }
109
110 public function getBlockId(): string
111 {
112 return $this->str("cont_block_id");
113 }
114
115 public function getPreviousSession(): ?int
116 {
117 if ($this->http->wrapper()->query()->has('crs_prev_sess')) {
118 return $this->int("crs_prev_sess");
119 }
120 return null;
121 }
122
123 public function getNextSession(): ?int
124 {
125 if ($this->http->wrapper()->query()->has('crs_next_sess')) {
126 return $this->int("crs_next_sess");
127 }
128 return null;
129 }
130
131 public function getObjectiveId(): int
132 {
133 return $this->int("oobj");
134 }
135
137 public function getNodes(): array
138 {
139 if ($this->int("node") > 0) {
140 return [$this->int("node")];
141 }
142 return $this->intArray("nodes");
143 }
144
145 public function getCopyOptions(): array
146 {
147 return $this->arrayArray("cp_options");
148 }
149
150 public function getPositions(): array
151 {
152 // note: the position parameter is currently
153 // quite unstructured typewise, array of array|string
154 $body = $this->http->request()->getParsedBody();
155 return $body["position"] ?? [];
156 //return $this->arrayArray("position");
157 }
158
160 public function getTrashIds(): array
161 {
162 return $this->intArray("trash_id");
163 }
164
166 public function getAlreadyRenderedRefIds(): array
167 {
168 $ids = $this->strArray("ids");
169 $ref_ids = array_map(static function (string $i): int {
170 $parts = explode("_", $i);
171 return (int) $parts[2];
172 }, $ids);
173 return $ref_ids;
174 }
175
177 public function getStartObjIds(): array
178 {
179 return $this->intArray("starter");
180 }
181
182 public function getCmdClass(): string
183 {
184 return $this->str("cmdClass");
185 }
186}
__construct(\ILIAS\HTTP\Services $http, \ILIAS\Refinery\Factory $refinery)
Builds data types.
Definition: Factory.php:36
trait BaseGUIRequest
Base gui request wrapper.
$http
Definition: deliver.php:30
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61
static http()
Fetches the global http state from ILIAS.
initRequest(HTTP\Services $http, Refinery\Factory $refinery, ?array $passed_query_params=null, ?array $passed_post_data=null)
Query params and post data parameters are used for testing.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.