ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
base.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
9 
20 function base()
21 {
22  global $DIC;
23  $f = $DIC->ui()->factory();
24  $r = $DIC->ui()->renderer();
25  $refinery = $DIC->refinery();
26  $request = $DIC->http()->request();
27 
28  $vcs = [
29  $f->input()->viewControl()->pagination()
30  ->withAdditionalTransformation(
31  $refinery->custom()->transformation(
32  fn($v) => ['vc_range' => $v]
33  )
34  )
35  ->withTotalCount(312)
36  ->withValue([Pagination::FNAME_OFFSET => 0, Pagination::FNAME_LIMIT => 50]),
37 
38  $f->input()->viewControl()->sortation([
39  'Field 1, ascending' => new Order('field1', 'ASC'),
40  'Field 1, descending' => new Order('field1', 'DESC'),
41  'Field 2, descending' => new Order('field2', 'ASC')
42  ])
43  ->withAdditionalTransformation(
44  $refinery->custom()->transformation(
45  fn($v) => ['vc_sortation' => $v]
46  )
47  )
48  ->withValue(['field2', 'ASC']),
49 
50  $f->input()->viewControl()->fieldSelection([
51  'field1' => 'Feld 1',
52  'field2' => 'Feld 2'
53  ], 'shown columns', 'apply')
54  ->withAdditionalTransformation(
55  $refinery->custom()->transformation(
56  fn($v) => ['vc_columns' => $v]
57  )
58  )
59  ->withValue(['field1','field2']),
60  ];
61 
62  $vc_container = $f->input()->container()->viewControl()->standard($vcs)
63  ->withAdditionalTransformation(
64  $refinery->custom()->transformation(
65  fn($v) => array_filter(array_values($v)) === [] ? null : array_merge(...array_values($v))
66  )
67  )
68  ->withRequest($request);
69 
70  return $r->render([
71  $f->legacy('<pre>' . print_r($vc_container->getData(), true) . '</pre>'),
72  $f->divider()->horizontal(),
73  $vc_container
74  ]);
75 }
base()
expected output: > ILIAS shows the rendered viewcontrols Pagination, Sortation and Field Selection...
Definition: base.php:20
Both the subject and the direction need to be specified when expressing an order. ...
Definition: Order.php:12
global $DIC
Definition: shib_login.php:25
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:59
$r