19declare(strict_types=1);
49 $r =
$DIC[
'ui.renderer'];
52 $table = $repo->getTableForRepresentation();
55 $table->withRequest(
$DIC->http()->request())
62 protected \ILIAS\Data\Factory
$df;
67 $this->ui_factory =
$DIC[
'ui.factory'];
68 $this->df = new \ILIAS\Data\Factory();
74 return $this->ui_factory->table()->data(
76 'a data table from a repository',
84 array $visible_column_ids,
87 mixed $additional_viewcontrol_data,
89 mixed $additional_parameters
92 $this->ui_factory->
symbol()->icon()->
custom(
'assets/images/standard/icon_checked.svg',
'',
'small'),
93 $this->ui_factory->
symbol()->icon()->
custom(
'assets/images/standard/icon_unchecked.svg',
'',
'small')
96 $row_id = (string) $record[
'usr_id'];
97 $record[
'achieve_txt'] = $record[
'achieve'] > 80 ?
'passed' :
'failed';
98 $record[
'failure_txt'] =
"not " . $record[
"achieve_txt"];
99 $record[
'repeat'] = $record[
'achieve'] < 80;
100 $record[
'achieve_icon'] = $icons[(
int) $record[
'achieve'] > 80];
101 yield $row_builder->buildDataRow($row_id, $record);
106 mixed $additional_viewcontrol_data,
108 mixed $additional_parameters
110 return count($this->dummyrecords());
116 $sql_order_part = $order->
join(
'ORDER BY', fn(...$o) => implode(
' ', $o));
117 $sql_range_part = sprintf(
'LIMIT %2$s OFFSET %1$s', ...
$range->
unpack());
119 fn($rec) => array_merge($rec, [
'sql_order' => $sql_order_part,
'sql_range' => $sql_range_part]),
120 $this->dummyrecords()
127 $f = $this->ui_factory;
129 'usr_id' =>
$f->table()->column()->number(
"User ID")
130 ->withIsSortable(
false),
131 'login' =>
$f->table()->column()->text(
"Login")
132 ->withHighlight(
true),
133 'email' =>
$f->table()->column()->eMail(
"eMail"),
134 'last' =>
$f->table()->column()->date(
"last login", $this->df->dateFormat()->germanLong()),
135 'achieve' =>
$f->table()->column()->status(
"progress")
136 ->withIsOptional(
true),
137 'achieve_txt' =>
$f->table()->column()->status(
"success")
138 ->withIsSortable(
false)
139 ->withIsOptional(
true),
140 'failure_txt' =>
$f->table()->column()->status(
"failure")
141 ->withIsSortable(
false)
142 ->withIsOptional(
true,
false),
143 'achieve_icon' =>
$f->table()->column()->statusIcon(
"achieved")
144 ->withIsOptional(
true),
145 'repeat' =>
$f->table()->column()->boolean(
"repeat",
'yes',
'no')
146 ->withIsSortable(
false),
147 'fee' =>
$f->table()->column()->number(
"Fee")
149 ->withUnit(
'£',
I\Column\Number::UNIT_POSITION_FORE),
150 'sql_order' =>
$f->table()->column()->text(
"sql order part")
151 ->withIsSortable(
false)
152 ->withIsOptional(
true),
153 'sql_range' =>
$f->table()->column()->text(
"sql range part")
154 ->withIsSortable(
false)
155 ->withIsOptional(
true)
162 [
'usr_id' => 123,
'login' =>
'superuser',
'email' =>
'user@example.com',
163 'last' => new \DateTimeImmutable(),
'achieve' => 20,
'fee' => 0
165 [
'usr_id' => 867,
'login' =>
'student1',
'email' =>
'student1@example.com',
166 'last' => new \DateTimeImmutable(),
'achieve' => 90,
'fee' => 40
168 [
'usr_id' => 8923,
'login' =>
'student2',
'email' =>
'student2@example.com',
169 'last' => new \DateTimeImmutable(),
'achieve' => 66,
'fee' => 36.789
171 [
'usr_id' => 8748,
'login' =>
'student3_longname',
'email' =>
'student3_long_email@example.com',
172 'last' => new \DateTimeImmutable(),
'achieve' => 66,
'fee' => 36.789
Both the subject and the direction need to be specified when expressing an order.
join($init, callable $fn)
A simple class to express a naive range of whole positive numbers.
getColumsForRepresentation()
getTotalRowCount(mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
Mainly for the purpose of pagination-support, it is important to know about the total number of recor...
doSelect(Order $order, Range $range)
ILIAS UI Factory $ui_factory
getRows(I\DataRowBuilder $row_builder, array $visible_column_ids, Range $range, Order $order, mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
getTableForRepresentation()
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.