49 protected function str(
string $key): string
51 $t = $this->
refinery->kindlyTo()->string();
52 return \ilUtil::stripSlashes((
string) ($this->
get($key, $t) ??
""));
56 protected function int(
string $key):
int 58 $t = $this->
refinery->kindlyTo()->int();
59 return (
int) ($this->
get($key, $t) ?? 0);
63 protected function intArray(
string $key): array
68 $t = $this->
refinery->custom()->transformation(
69 static function (array $arr): array {
73 static function ($k, $v): array {
74 return [$k, (
int) $v];
84 return (array) ($this->
get($key, $t) ?? []);
93 $t = $this->
refinery->custom()->transformation(
112 return (array) ($this->
get($key, $t) ?? []);
120 $no_transform = $this->
refinery->identity();
121 $w = $this->
http->wrapper();
122 if ($w->post()->has($key)) {
123 return is_array($w->post()->retrieve($key, $no_transform));
125 if ($w->query()->has($key)) {
126 return is_array($w->query()->retrieve($key, $no_transform));
134 protected function get(
string $key, Refinery\Transformation $t)
136 $w = $this->
http->wrapper();
137 if ($w->post()->has($key)) {
138 return $w->post()->retrieve($key, $t);
140 if ($w->query()->has($key)) {
141 return $w->query()->retrieve($key, $t);
149 $badge_ids = $this->
intArray(
"badge_id");
150 if (count($badge_ids) === 0 && $this->
int(
"badge_id") > 0) {
151 $badge_ids = [$this->
int(
"badge_id")];
159 $query = $this->
http->wrapper()->query();
160 if ($query->has(self::ACTION_PARAMETER_TOKEN)) {
161 $tmpl_ids = $query->retrieve(
162 self::ACTION_PARAMETER_TOKEN,
165 if (count($tmpl_ids) === 1) {
166 $id = (
int) array_pop($tmpl_ids);
179 $query = $this->
http->wrapper()->query();
180 if ($query->has(self::ACTION_PARAMETER_TOKEN)) {
181 $tmpl_ids = $query->retrieve(
182 self::ACTION_PARAMETER_TOKEN,
196 $query = $this->
http->wrapper()->post();
197 if ($query->has(self::ACTION_PARAMETER_TOKEN_ID)) {
198 $tmpl_ids = $query->retrieve(
199 self::ACTION_PARAMETER_TOKEN_ID,
210 return $this->
int(
"bid");
215 return $this->
int(
"id");
226 return $this->
str(
"type");
231 return $this->
str(
"tgt");
236 return $this->
int(
"tid");
241 return $this->
int(
"pid");
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Refinery Factory $refinery
getBadgeAssignableUsers()
const ACTION_PARAMETER_TOKEN_ID
initRequest(HTTP\Services $http, Refinery\Factory $refinery)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
isArray(string $key)
Check if parameter is an array.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static http()
Fetches the global http state from ILIAS.
const ACTION_PARAMETER_TOKEN
getMultiActionBadgeIdsFromPost()
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
getMultiActionBadgeIdsFromUrl()
__construct(HTTP\Services $http, Refinery\Factory $refinery)