ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
base.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
9 
10 function base()
11 {
12  global $DIC;
13  $f = $DIC->ui()->factory();
14  $r = $DIC->ui()->renderer();
15  $refinery = $DIC->refinery();
16  $request = $DIC->http()->request();
17 
18  $vcs = [
19  $f->input()->viewControl()->pagination()
20  ->withAdditionalTransformation(
21  $refinery->custom()->transformation(
22  fn ($v) => ['vc_range' => $v]
23  )
24  )
25  ->withTotalCount(312)
26  ->withValue([Pagination::FNAME_OFFSET => 0, Pagination::FNAME_LIMIT => 50]),
27 
28  $f->input()->viewControl()->sortation([
29  'Field 1, ascending' => new Order('field1', 'ASC'),
30  'Field 1, descending' => new Order('field1', 'DESC'),
31  'Field 2, descending' => new Order('field2', 'ASC')
32  ])
33  ->withAdditionalTransformation(
34  $refinery->custom()->transformation(
35  fn ($v) => ['vc_sortation' => $v]
36  )
37  )
38  ->withValue(['field2', 'ASC']),
39 
40  $f->input()->viewControl()->fieldSelection([
41  'field1' => 'Feld 1',
42  'field2' => 'Feld 2'
43  ], 'shown columns', 'apply')
44  ->withAdditionalTransformation(
45  $refinery->custom()->transformation(
46  fn ($v) => ['vc_columns' => $v]
47  )
48  )
49  ->withValue(['field1','field2']),
50  ];
51 
52  $vc_container = $f->input()->container()->viewControl()->standard($vcs)
53  ->withAdditionalTransformation(
54  $refinery->custom()->transformation(
55  fn ($v) => array_filter(array_values($v)) === [] ? null : array_merge(...array_values($v))
56  )
57  )
58  ->withRequest($request);
59 
60  return $r->render([
61  $f->legacy('<pre>' . print_r($vc_container->getData(), true) . '</pre>'),
62  $f->divider()->horizontal(),
63  $vc_container
64  ]);
65 }
Both the subject and the direction need to be specified when expressing an order. ...
Definition: Order.php:12
global $DIC
Definition: feed.php:28
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:59
Refinery Factory $refinery