ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ILIAS\User\UserGUIRequest Class Reference
+ Collaboration diagram for ILIAS\User\UserGUIRequest:

Public Member Functions

 __construct (RequestServices $request, private Refinery $refinery)
 
 getRefId ()
 
 getLetter ()
 
 getBaseClass ()
 
 getSearch ()
 
 getJumpToUser ()
 
 getFieldId ()
 
 getFetchAll ()
 
 getTerm ()
 
 getStartingPointId ()
 
 getRoleId ()
 
 getActionActive ()
 
 getIds ()
 
 getChecked ()
 
 getFieldType ()
 
 getFields ()
 
 getSelectedAction ()
 
 getFrSearch ()
 
 getSelect ()
 
 getFiles ()
 
 getExportType ()
 
 getMailSalutation (string $gender, string $lang)
 
 getMailSubject (string $lang)
 
 getMailBody (string $lang)
 
 getMailAttDelete (string $lang)
 
 getSelectAll ()
 
 getRoleIds ()
 
 getPostedRoleIds ()
 
 getFilteredRoles ()
 
 getSendMail ()
 
 getPassword ()
 
 getUDFs ()
 
 getPositions ()
 
 getCurrentPassword ()
 
 getNewPassword ()
 
 getParsedBody ()
 
 getRequest ()
 
 isPost ()
 

Protected Member Functions

 strArray (string $key)
 
 intArray (string $key)
 

Private Member Functions

 int (string $key)
 
 bool (string $key)
 
 str (string $key)
 
 existsInPostOrQuery (string $key)
 
 getFromQueryOrPost (string $key, Transformation $transformation, string $source)
 

Private Attributes

WrapperFactory $wrapper
 
RequestInterface $request
 

Detailed Description

Definition at line 29 of file class.UserGUIRequest.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\User\UserGUIRequest::__construct ( RequestServices  $request,
private Refinery  $refinery 
)

Definition at line 34 of file class.UserGUIRequest.php.

37  {
38  $this->wrapper = $request->wrapper();
39  $this->request = $request->request();
40  }

Member Function Documentation

◆ bool()

ILIAS\User\UserGUIRequest::bool ( string  $key)
private

Definition at line 236 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\existsInPostOrQuery(), ILIAS\User\UserGUIRequest\getFromQueryOrPost(), and ILIAS\Repository\refinery().

Referenced by ILIAS\User\UserGUIRequest\getFrSearch().

236  : bool
237  {
238  $source = $this->existsInPostOrQuery($key);
239  if ($source === '') {
240  return false;
241  }
242 
243  $transformation = $this->refinery->kindlyTo()->bool();
244  return $this->getFromQueryOrPost($key, $transformation, $source);
245  }
getFromQueryOrPost(string $key, Transformation $transformation, string $source)
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ existsInPostOrQuery()

ILIAS\User\UserGUIRequest::existsInPostOrQuery ( string  $key)
private
Todo:
2023-06-05 sk: This is ugly and has to go, but right now, I have no idea, when I want to have information from $_POST or from $_GET.

Definition at line 336 of file class.UserGUIRequest.php.

Referenced by ILIAS\User\UserGUIRequest\bool(), ILIAS\User\UserGUIRequest\int(), ILIAS\User\UserGUIRequest\intArray(), ILIAS\User\UserGUIRequest\str(), and ILIAS\User\UserGUIRequest\strArray().

336  : string
337  {
338  if ($this->wrapper->post()->has($key)) {
339  return 'post';
340  }
341 
342  if ($this->wrapper->query()->has($key)) {
343  return 'query';
344  }
345 
346  return '';
347  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the caller graph for this function:

◆ getActionActive()

ILIAS\User\UserGUIRequest::getActionActive ( )

Definition at line 105 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\intArray().

105  : array
106  {
107  return $this->intArray('active');
108  }
+ Here is the call graph for this function:

◆ getBaseClass()

ILIAS\User\UserGUIRequest::getBaseClass ( )

Definition at line 52 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\str().

52  : string
53  {
54  return $this->str('baseClass');
55  }
+ Here is the call graph for this function:

◆ getChecked()

ILIAS\User\UserGUIRequest::getChecked ( )

Definition at line 115 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\intArray().

115  : array
116  {
117  return $this->intArray('chb');
118  }
+ Here is the call graph for this function:

◆ getCurrentPassword()

ILIAS\User\UserGUIRequest::getCurrentPassword ( )

Definition at line 215 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\str().

215  : string
216  {
217  return $this->str('current_password');
218  }
+ Here is the call graph for this function:

◆ getExportType()

ILIAS\User\UserGUIRequest::getExportType ( )

Definition at line 150 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\str().

150  : string
151  {
152  return $this->str('export_type');
153  }
+ Here is the call graph for this function:

◆ getFetchAll()

ILIAS\User\UserGUIRequest::getFetchAll ( )

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

References ILIAS\User\UserGUIRequest\int().

72  : bool
73  {
74  return (bool) $this->int('fetchall');
75  }
+ Here is the call graph for this function:

◆ getFieldId()

ILIAS\User\UserGUIRequest::getFieldId ( )

Definition at line 67 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\int().

67  : int
68  {
69  return $this->int('field_id');
70  }
+ Here is the call graph for this function:

◆ getFields()

ILIAS\User\UserGUIRequest::getFields ( )

Definition at line 125 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\intArray().

125  : array
126  {
127  return $this->intArray('fields');
128  }
+ Here is the call graph for this function:

◆ getFieldType()

ILIAS\User\UserGUIRequest::getFieldType ( )

Definition at line 120 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\int().

120  : int
121  {
122  return $this->int('field_type');
123  }
+ Here is the call graph for this function:

◆ getFiles()

ILIAS\User\UserGUIRequest::getFiles ( )

Definition at line 145 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\strArray().

145  : array
146  {
147  return $this->strArray('file');
148  }
+ Here is the call graph for this function:

◆ getFilteredRoles()

ILIAS\User\UserGUIRequest::getFilteredRoles ( )

Definition at line 190 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\int().

190  : int
191  {
192  return $this->int('filter');
193  }
+ Here is the call graph for this function:

◆ getFromQueryOrPost()

ILIAS\User\UserGUIRequest::getFromQueryOrPost ( string  $key,
Transformation  $transformation,
string  $source 
)
private

Definition at line 349 of file class.UserGUIRequest.php.

Referenced by ILIAS\User\UserGUIRequest\bool(), ILIAS\User\UserGUIRequest\int(), ILIAS\User\UserGUIRequest\intArray(), ILIAS\User\UserGUIRequest\str(), and ILIAS\User\UserGUIRequest\strArray().

349  : mixed
350  {
351  if ($source === 'query') {
352  return $this->wrapper->query()->retrieve($key, $transformation);
353  }
354 
355  return $this->wrapper->post()->retrieve($key, $transformation);
356  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the caller graph for this function:

◆ getFrSearch()

ILIAS\User\UserGUIRequest::getFrSearch ( )

Definition at line 135 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\bool().

135  : bool
136  {
137  return $this->bool('frsrch');
138  }
+ Here is the call graph for this function:

◆ getIds()

ILIAS\User\UserGUIRequest::getIds ( )

Definition at line 110 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\intArray().

110  : array
111  {
112  return $this->intArray('id');
113  }
+ Here is the call graph for this function:

◆ getJumpToUser()

ILIAS\User\UserGUIRequest::getJumpToUser ( )

Definition at line 62 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\int().

62  : int
63  {
64  return $this->int('jmpToUser');
65  }
+ Here is the call graph for this function:

◆ getLetter()

ILIAS\User\UserGUIRequest::getLetter ( )

Definition at line 47 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\str().

47  : string
48  {
49  return $this->str('letter');
50  }
+ Here is the call graph for this function:

◆ getMailAttDelete()

ILIAS\User\UserGUIRequest::getMailAttDelete ( string  $lang)

Definition at line 170 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\int().

170  : bool
171  {
172  return (bool) $this->int('att_' . $lang . '_delete');
173  }
$lang
Definition: xapiexit.php:26
+ Here is the call graph for this function:

◆ getMailBody()

ILIAS\User\UserGUIRequest::getMailBody ( string  $lang)

Definition at line 165 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\str().

165  : string
166  {
167  return $this->str('body_' . $lang);
168  }
$lang
Definition: xapiexit.php:26
+ Here is the call graph for this function:

◆ getMailSalutation()

ILIAS\User\UserGUIRequest::getMailSalutation ( string  $gender,
string  $lang 
)

Definition at line 155 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\str().

155  : string
156  {
157  return $this->str('sal_' . $gender . '_' . $lang);
158  }
$lang
Definition: xapiexit.php:26
+ Here is the call graph for this function:

◆ getMailSubject()

ILIAS\User\UserGUIRequest::getMailSubject ( string  $lang)

Definition at line 160 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\str().

160  : string
161  {
162  return $this->str('subject_' . $lang);
163  }
$lang
Definition: xapiexit.php:26
+ Here is the call graph for this function:

◆ getNewPassword()

ILIAS\User\UserGUIRequest::getNewPassword ( )

Definition at line 220 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\str().

220  : string
221  {
222  return $this->str('new_password');
223  }
+ Here is the call graph for this function:

◆ getParsedBody()

ILIAS\User\UserGUIRequest::getParsedBody ( )
Todo:
2023-06-05 sk: This is not what we want, but in order to avoid having a RequestInterface and a ProfileGUIRequest as class attributes

Definition at line 317 of file class.UserGUIRequest.php.

317  : array
318  {
319  return $this->request->getParsedBody();
320  }

◆ getPassword()

ILIAS\User\UserGUIRequest::getPassword ( )

Definition at line 200 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\str().

200  : string
201  {
202  return $this->str('passwd');
203  }
+ Here is the call graph for this function:

◆ getPositions()

ILIAS\User\UserGUIRequest::getPositions ( )

Definition at line 210 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\intArray().

210  : array
211  {
212  return $this->intArray('position');
213  }
+ Here is the call graph for this function:

◆ getPostedRoleIds()

ILIAS\User\UserGUIRequest::getPostedRoleIds ( )

Definition at line 185 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\intArray().

185  : array
186  {
187  return $this->intArray('role_id_ctrl');
188  }
+ Here is the call graph for this function:

◆ getRefId()

ILIAS\User\UserGUIRequest::getRefId ( )

Definition at line 42 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\int().

42  : int
43  {
44  return $this->int('ref_id');
45  }
+ Here is the call graph for this function:

◆ getRequest()

ILIAS\User\UserGUIRequest::getRequest ( )

Definition at line 322 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\$request.

323  {
324  return $this->request;
325  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ getRoleId()

ILIAS\User\UserGUIRequest::getRoleId ( )

Definition at line 96 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\int().

96  : int
97  {
98  $role_id = $this->int('rolid');
99  if ($role_id !== 0) {
100  return $role_id;
101  }
102  return $this->int('role_id');
103  }
+ Here is the call graph for this function:

◆ getRoleIds()

ILIAS\User\UserGUIRequest::getRoleIds ( )

Definition at line 180 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\intArray().

180  : array
181  {
182  return $this->intArray('role_id');
183  }
+ Here is the call graph for this function:

◆ getSearch()

ILIAS\User\UserGUIRequest::getSearch ( )

Definition at line 57 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\str().

57  : string
58  {
59  return $this->str('search');
60  }
+ Here is the call graph for this function:

◆ getSelect()

ILIAS\User\UserGUIRequest::getSelect ( )

Definition at line 140 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\strArray().

140  : array
141  {
142  return $this->strArray('select');
143  }
+ Here is the call graph for this function:

◆ getSelectAll()

ILIAS\User\UserGUIRequest::getSelectAll ( )

Definition at line 175 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\int().

175  : bool
176  {
177  return (bool) $this->int('select_cmd_all');
178  }
+ Here is the call graph for this function:

◆ getSelectedAction()

ILIAS\User\UserGUIRequest::getSelectedAction ( )

Definition at line 130 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\str().

Referenced by ilObjUserFolderGUI\__construct().

130  : string
131  {
132  return $this->str('selectedAction');
133  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSendMail()

ILIAS\User\UserGUIRequest::getSendMail ( )

Definition at line 195 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\str().

195  : string
196  {
197  return $this->str('send_mail');
198  }
+ Here is the call graph for this function:

◆ getStartingPointId()

ILIAS\User\UserGUIRequest::getStartingPointId ( )

Definition at line 82 of file class.UserGUIRequest.php.

References $id, and ILIAS\User\UserGUIRequest\int().

82  : ?int
83  {
84  if (!$this->wrapper->query()->has('spid') &&
85  !$this->wrapper->query()->has('start_point_id')) {
86  return null;
87  }
88 
89  $id = $this->int('spid');
90  if ($id !== 0) {
91  return $id;
92  }
93  return $this->int('start_point_id');
94  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ getTerm()

ILIAS\User\UserGUIRequest::getTerm ( )

Definition at line 77 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\str().

77  : string
78  {
79  return $this->str('term');
80  }
+ Here is the call graph for this function:

◆ getUDFs()

ILIAS\User\UserGUIRequest::getUDFs ( )

Definition at line 205 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\strArray().

205  : array
206  {
207  return $this->strArray('udf');
208  }
+ Here is the call graph for this function:

◆ int()

ILIAS\User\UserGUIRequest::int ( string  $key)
private

Definition at line 225 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\existsInPostOrQuery(), ILIAS\User\UserGUIRequest\getFromQueryOrPost(), and ILIAS\Repository\refinery().

Referenced by ILIAS\User\UserGUIRequest\getFetchAll(), ILIAS\User\UserGUIRequest\getFieldId(), ILIAS\User\UserGUIRequest\getFieldType(), ILIAS\User\UserGUIRequest\getFilteredRoles(), ILIAS\User\UserGUIRequest\getJumpToUser(), ILIAS\User\UserGUIRequest\getMailAttDelete(), ILIAS\User\UserGUIRequest\getRefId(), ILIAS\User\UserGUIRequest\getRoleId(), ILIAS\User\UserGUIRequest\getSelectAll(), ILIAS\User\UserGUIRequest\getStartingPointId(), and ILIAS\User\UserGUIRequest\intArray().

225  : int
226  {
227  $source = $this->existsInPostOrQuery($key);
228  if ($source === '') {
229  return 0;
230  }
231 
232  $transformation = $this->refinery->kindlyTo()->int();
233  return $this->getFromQueryOrPost($key, $transformation, $source);
234  }
getFromQueryOrPost(string $key, Transformation $transformation, string $source)
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ intArray()

ILIAS\User\UserGUIRequest::intArray ( string  $key)
protected

Definition at line 286 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\existsInPostOrQuery(), ILIAS\User\UserGUIRequest\getFromQueryOrPost(), ILIAS\User\UserGUIRequest\int(), and ILIAS\Repository\refinery().

Referenced by ILIAS\User\UserGUIRequest\getActionActive(), ILIAS\User\UserGUIRequest\getChecked(), ILIAS\User\UserGUIRequest\getFields(), ILIAS\User\UserGUIRequest\getIds(), ILIAS\User\UserGUIRequest\getPositions(), ILIAS\User\UserGUIRequest\getPostedRoleIds(), and ILIAS\User\UserGUIRequest\getRoleIds().

286  : array
287  {
288  $source = $this->existsInPostOrQuery($key);
289  if ($source === '') {
290  return [];
291  }
292 
293  $transformation = $this->refinery->custom()->transformation(
294  function ($arr) {
295  // keep keys(!), transform all values to int
296  return array_column(
297  array_map(
298  static function ($k, $v): array {
299  return [$k, (int) $v];
300  },
301  array_keys($arr),
302  $arr
303  ),
304  1,
305  0
306  );
307  }
308  );
309  return $this->getFromQueryOrPost($key, $transformation, $source);
310  }
getFromQueryOrPost(string $key, Transformation $transformation, string $source)
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isPost()

ILIAS\User\UserGUIRequest::isPost ( )

Definition at line 327 of file class.UserGUIRequest.php.

327  : bool
328  {
329  return $this->request->getMethod() === 'POST';
330  }

◆ str()

ILIAS\User\UserGUIRequest::str ( string  $key)
private

Definition at line 247 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\existsInPostOrQuery(), ILIAS\User\UserGUIRequest\getFromQueryOrPost(), and ILIAS\Repository\refinery().

Referenced by ILIAS\User\UserGUIRequest\getBaseClass(), ILIAS\User\UserGUIRequest\getCurrentPassword(), ILIAS\User\UserGUIRequest\getExportType(), ILIAS\User\UserGUIRequest\getLetter(), ILIAS\User\UserGUIRequest\getMailBody(), ILIAS\User\UserGUIRequest\getMailSalutation(), ILIAS\User\UserGUIRequest\getMailSubject(), ILIAS\User\UserGUIRequest\getNewPassword(), ILIAS\User\UserGUIRequest\getPassword(), ILIAS\User\UserGUIRequest\getSearch(), ILIAS\User\UserGUIRequest\getSelectedAction(), ILIAS\User\UserGUIRequest\getSendMail(), and ILIAS\User\UserGUIRequest\getTerm().

247  : string
248  {
249  $source = $this->existsInPostOrQuery($key);
250  if ($source === '') {
251  return '';
252  }
253 
254  $transformation = $this->refinery->kindlyTo()->string();
255  return $this->getFromQueryOrPost($key, $transformation, $source);
256  }
getFromQueryOrPost(string $key, Transformation $transformation, string $source)
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ strArray()

ILIAS\User\UserGUIRequest::strArray ( string  $key)
protected

Definition at line 258 of file class.UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\existsInPostOrQuery(), ILIAS\User\UserGUIRequest\getFromQueryOrPost(), ILIAS\Repository\refinery(), and ilUtil\stripSlashes().

Referenced by ILIAS\User\UserGUIRequest\getFiles(), ILIAS\User\UserGUIRequest\getSelect(), and ILIAS\User\UserGUIRequest\getUDFs().

258  : array
259  {
260  $source = $this->existsInPostOrQuery($key);
261  if ($source === '') {
262  return [];
263  }
264 
265  $transformation = $this->refinery->custom()->transformation(
266  function ($arr) {
267  return array_column(
268  array_map(
269  static function ($k, $v): array {
270  if (is_array($v)) {
271  $v = '';
272  }
273  return [$k, \ilUtil::stripSlashes((string) $v)];
274  },
275  array_keys($arr),
276  $arr
277  ),
278  1,
279  0
280  );
281  }
282  );
283  return $this->getFromQueryOrPost($key, $transformation, $source);
284  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
getFromQueryOrPost(string $key, Transformation $transformation, string $source)
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $request

RequestInterface ILIAS\User\UserGUIRequest::$request
private

Definition at line 32 of file class.UserGUIRequest.php.

Referenced by ILIAS\User\UserGUIRequest\getRequest().

◆ $wrapper

WrapperFactory ILIAS\User\UserGUIRequest::$wrapper
private

Definition at line 31 of file class.UserGUIRequest.php.


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