ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 ()
 
 getIds ()
 
 getChecked ()
 
 getFieldType ()
 
 getFields ()
 
 getSelectedAction ()
 
 getFrSearch ()
 
 getSelect ()
 
 getDefaultSessionReminder ()
 
 getFiles ()
 
 getExportType ()
 
 getMailSalutation (string $gender, string $lang)
 
 getMailSubject (string $lang)
 
 getMailBody (string $lang)
 
 getMailAttDelete (string $lang)
 
 getSelectAll ()
 
 getRoleIds ()
 
 getPostedRoleIds ()
 
 getFilteredRoles ()
 
 getSendMail ()
 
 getPassword ()
 
 getUDFs ()
 
 getPositions ()
 
 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 UserGUIRequest.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 34 of file UserGUIRequest.php.

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

Member Function Documentation

◆ bool()

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

Definition at line 226 of file UserGUIRequest.php.

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

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

226  : bool
227  {
228  $source = $this->existsInPostOrQuery($key);
229  if ($source === '') {
230  return false;
231  }
232 
233  $transformation = $this->refinery->kindlyTo()->bool();
234  return $this->getFromQueryOrPost($key, $transformation, $source);
235  }
getFromQueryOrPost(string $key, Transformation $transformation, string $source)
+ 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 326 of file 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().

326  : string
327  {
328  if ($this->wrapper->post()->has($key)) {
329  return 'post';
330  }
331 
332  if ($this->wrapper->query()->has($key)) {
333  return 'query';
334  }
335 
336  return '';
337  }
+ Here is the caller graph for this function:

◆ getBaseClass()

ILIAS\User\UserGUIRequest::getBaseClass ( )

Definition at line 52 of file 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 110 of file UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\intArray().

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

◆ getDefaultSessionReminder()

ILIAS\User\UserGUIRequest::getDefaultSessionReminder ( )

Definition at line 140 of file UserGUIRequest.php.

References ilSessionReminder\LEAD_TIME_DISABLED, and ILIAS\User\UserGUIRequest\str().

140  : ?string
141  {
142  return $this->str('default_session_reminder') ?: (string) \ilSessionReminder::LEAD_TIME_DISABLED;
143  }
+ Here is the call graph for this function:

◆ getExportType()

ILIAS\User\UserGUIRequest::getExportType ( )

Definition at line 150 of file 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 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 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 120 of file UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\intArray().

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

◆ getFieldType()

ILIAS\User\UserGUIRequest::getFieldType ( )

Definition at line 115 of file UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\int().

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

◆ getFiles()

ILIAS\User\UserGUIRequest::getFiles ( )

Definition at line 145 of file 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 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 339 of file 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().

339  : mixed
340  {
341  if ($source === 'query') {
342  return $this->wrapper->query()->retrieve($key, $transformation);
343  }
344 
345  return $this->wrapper->post()->retrieve($key, $transformation);
346  }
+ Here is the caller graph for this function:

◆ getFrSearch()

ILIAS\User\UserGUIRequest::getFrSearch ( )

Definition at line 130 of file UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\bool().

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

◆ getIds()

ILIAS\User\UserGUIRequest::getIds ( )

Definition at line 105 of file UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\intArray().

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

◆ getJumpToUser()

ILIAS\User\UserGUIRequest::getJumpToUser ( )

Definition at line 62 of file 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 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 UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\int().

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

◆ getMailBody()

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

Definition at line 165 of file UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\str().

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

◆ getMailSalutation()

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

Definition at line 155 of file UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\str().

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

◆ getMailSubject()

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

Definition at line 160 of file UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\str().

160  : string
161  {
162  return $this->str('subject_' . $lang);
163  }
$lang
Definition: xapiexit.php:25
+ 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 307 of file UserGUIRequest.php.

307  : array
308  {
309  return $this->request->getParsedBody();
310  }

◆ getPassword()

ILIAS\User\UserGUIRequest::getPassword ( )

Definition at line 200 of file 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 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 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 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 312 of file UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\$request.

313  {
314  return $this->request;
315  }
RequestInterface $request

◆ getRoleId()

ILIAS\User\UserGUIRequest::getRoleId ( )

Definition at line 96 of file 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 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 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 135 of file UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\strArray().

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

◆ getSelectAll()

ILIAS\User\UserGUIRequest::getSelectAll ( )

Definition at line 175 of file 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 125 of file UserGUIRequest.php.

References ILIAS\User\UserGUIRequest\str().

Referenced by ilObjUserFolderGUI\__construct().

125  : string
126  {
127  return $this->str('selectedAction');
128  }
+ 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 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 UserGUIRequest.php.

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

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  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$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 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 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 215 of file 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().

215  : int
216  {
217  $source = $this->existsInPostOrQuery($key);
218  if ($source === '') {
219  return 0;
220  }
221 
222  $transformation = $this->refinery->kindlyTo()->int();
223  return $this->getFromQueryOrPost($key, $transformation, $source);
224  }
getFromQueryOrPost(string $key, Transformation $transformation, string $source)
+ 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 276 of file UserGUIRequest.php.

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

Referenced by 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().

276  : array
277  {
278  $source = $this->existsInPostOrQuery($key);
279  if ($source === '') {
280  return [];
281  }
282 
283  $transformation = $this->refinery->custom()->transformation(
284  function ($arr) {
285  // keep keys(!), transform all values to int
286  return array_column(
287  array_map(
288  static function ($k, $v): array {
289  return [$k, (int) $v];
290  },
291  array_keys($arr),
292  $arr
293  ),
294  1,
295  0
296  );
297  }
298  );
299  return $this->getFromQueryOrPost($key, $transformation, $source);
300  }
getFromQueryOrPost(string $key, Transformation $transformation, string $source)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isPost()

ILIAS\User\UserGUIRequest::isPost ( )

Definition at line 317 of file UserGUIRequest.php.

317  : bool
318  {
319  return $this->request->getMethod() === 'POST';
320  }

◆ str()

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

◆ strArray()

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

Definition at line 248 of file 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().

248  : array
249  {
250  $source = $this->existsInPostOrQuery($key);
251  if ($source === '') {
252  return [];
253  }
254 
255  $transformation = $this->refinery->custom()->transformation(
256  function ($arr) {
257  return array_column(
258  array_map(
259  static function ($k, $v): array {
260  if (is_array($v)) {
261  $v = '';
262  }
263  return [$k, \ilUtil::stripSlashes((string) $v)];
264  },
265  array_keys($arr),
266  $arr
267  ),
268  1,
269  0
270  );
271  }
272  );
273  return $this->getFromQueryOrPost($key, $transformation, $source);
274  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
getFromQueryOrPost(string $key, Transformation $transformation, string $source)
+ 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 UserGUIRequest.php.

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

◆ $wrapper

WrapperFactory ILIAS\User\UserGUIRequest::$wrapper
private

Definition at line 31 of file UserGUIRequest.php.


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