ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
base.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
25
36function base()
37{
38 global $DIC;
39 $f = $DIC->ui()->factory();
40 $r = $DIC->ui()->renderer();
41 $refinery = $DIC->refinery();
42 $request = $DIC->http()->request();
43
44 $vcs = [
45 $f->input()->viewControl()->pagination()
46 ->withAdditionalTransformation(
47 $refinery->custom()->transformation(
48 fn($v) => ['vc_range' => $v]
49 )
50 )
51 ->withTotalCount(312)
52 ->withValue([Pagination::FNAME_OFFSET => 0, Pagination::FNAME_LIMIT => 50]),
53
54 $f->input()->viewControl()->sortation([
55 'Field 1, ascending' => new Order('field1', 'ASC'),
56 'Field 1, descending' => new Order('field1', 'DESC'),
57 'Field 2, descending' => new Order('field2', 'ASC')
58 ])
59 ->withAdditionalTransformation(
60 $refinery->custom()->transformation(
61 fn($v) => ['vc_sortation' => $v]
62 )
63 )
64 ->withValue(['field2', 'ASC']),
65
66 $f->input()->viewControl()->fieldSelection([
67 'field1' => 'Feld 1',
68 'field2' => 'Feld 2'
69 ], 'shown columns', 'apply')
70 ->withAdditionalTransformation(
71 $refinery->custom()->transformation(
72 fn($v) => ['vc_columns' => $v]
73 )
74 )
75 ->withValue(['field1','field2']),
76 $f->input()->viewControl()->mode([
77 'mode1' => 'a mode',
78 'mode2' => 'another mode'
79 ])
80 ->withAdditionalTransformation(
81 $refinery->custom()->transformation(
82 fn($v) => ['vc_mode' => $v]
83 )
84 )
85 ->withValue('mode2'),
86 ];
87
88 $vc_container = $f->input()->container()->viewControl()->standard($vcs)
89 ->withAdditionalTransformation(
90 $refinery->custom()->transformation(
91 fn($v) => array_filter(array_values($v)) === [] ? null : array_merge(...array_values($v))
92 )
93 )
94 ->withRequest($request);
95
96 return $r->render([
97 $f->legacy()->content('<pre>' . print_r($vc_container->getData(), true) . '</pre>'),
98 $f->divider()->horizontal(),
99 $vc_container
100 ]);
101}
Both the subject and the direction need to be specified when expressing an order.
Definition: Order.php:29
global $DIC
Definition: shib_login.php:26