3 declare(strict_types=1);
32 $f = $DIC[
'ui.factory'];
37 $r = $DIC[
'ui.renderer'];
43 $df = new \ILIAS\Data\Factory();
44 $request = $DIC->http()->request();
51 'word' =>
$f->table()->column()->text(
"Word")
52 ->withHighlight(
true),
53 'phrase' =>
$f->table()->column()->text(
"Phrase")
54 ->withIsOptional(
true,
false)
62 $url_builder =
new URLBuilder($df->uri($request->getUri()->__toString()));
63 $query_params_namespace = [
'orderingtable',
'example'];
64 list($url_builder, $action_parameter_token, $row_id_token) = $url_builder->acquireParameters(
65 $query_params_namespace,
70 $f->table()->action()->standard(
72 $url_builder->withParameter($action_parameter_token,
"edit"),
81 $data_retrieval =
new class (
$f,
$r) implements
I\OrderingBinding {
82 protected array $records;
88 $this->records = $this->initRecords();
91 public function getRows(
92 I\OrderingRowBuilder $row_builder,
93 array $visible_column_ids
95 $records = array_values($this->records);
96 foreach ($this->records as $position_index => $record) {
97 $row_id = (string) $record[
'id'];
98 yield $row_builder->buildOrderingRow($row_id, $record);
102 protected function initRecords(): array
105 [
'A is for apple',
'it’s red and its green'],
106 [
'B is for ball',
'and it bounces between'],
107 [
'C is for cat',
'it’s licking its paws'],
108 [
'D is for dog',
'it loves playing with balls'],
109 [
'E is for elephant',
'bigger than me'],
110 [
'F is for fish',
'he’s missing the sea'],
111 [
'G for gorilla',
'he’s big and he’s strong'],
112 [
'H is for home',
'and that’s where I belong'],
113 [
'I is for insect',
'flying around'],
114 [
'J is for jumping',
'jump up and down'],
118 foreach (
$r as $record) {
119 list($word, $phrase) = $record;
120 $id = substr($word, 0, 1);
133 public function setOrder(array $ordered): void
136 foreach ($ordered as
$id) {
137 $r[(string) $id] = $this->records[(
string)
$id];
144 $target = (
new URI((
string) $request->getUri()))->withParameter(
'ordering_example', 1);
145 $table =
$f->table()->ordering(
'ordering table', $columns, $data_retrieval, $target)
146 ->withActions($actions)
147 ->withRequest($request);
150 if ($request->getMethod() ==
"POST" 154 if (
$data = $table->getData()) {
155 $out[] =
$f->legacy(
'<pre>' . print_r(
$data,
true) .
'</pre>');
157 $data_retrieval->setOrder(
$data);
An entity that renders components to a string output.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider .
__construct()
Constructor setup ILIAS global object public.
The scope of this class is split ilias-conform URI's into components.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Refinery Factory $refinery