19 declare(strict_types=1);
45 $f = $DIC[
'ui.factory'];
50 $r = $DIC[
'ui.renderer'];
57 $df = new \ILIAS\Data\Factory();
58 $request = $DIC->http()->request();
62 'id' =>
$f->table()->column()->number(
"ID"),
63 'letter' =>
$f->table()->column()->text(
"Letter")
68 protected array $records;
71 protected \
ILIAS\
UI\Factory $ui_factory,
74 $this->records = $this->initRecords();
77 public function getRows(
78 I\OrderingRowBuilder $row_builder,
79 array $visible_column_ids
81 $records = array_values($this->records);
82 foreach ($this->records as $position_index => $record) {
83 yield $row_builder->buildOrderingRow((
string) $record[
'id'], $record);
87 protected function initRecords(): array
93 $records[(string) $id] = [
'id' => $id,
'letter' => chr($id)];
101 public function setOrder(array $ordered): void
104 foreach ($ordered as
$id) {
105 $r[(string) $id] = $this->records[(
string)
$id];
116 $target = (
new URI((
string) $request->getUri()))->withParameter(
'ordering_example', 3);
117 $table =
$f->table()->ordering($data_retrieval, $target,
'sort the letters', $columns)
118 ->withRequest($request);
124 if ($request->getMethod() ==
"POST" 128 $data = $table->withRequest($request)->getData();
129 if (
$data === range(65, 68)) {
130 $data_retrieval->setOrder(
$data);
131 $out[] =
$f->messageBox()->success(
"ok. great ordering!");
133 $out[] =
$f->messageBox()->failure(
"nah. try again.");
Interface Observer Contains several chained tasks and infos about them.
__construct()
Constructor setup ILIAS global object public.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins