19declare(strict_types=1);
40 protected const string ROW_ID =
"row_ids";
57 protected readonly DataFactory $data_factory,
60 protected readonly HTTPServices
$http,
62 protected readonly RefineryFactory
$refinery,
63 protected readonly
ilCtrl $ctrl,
64 protected readonly
bool $actions_permitted =
false
72 self::TABLE_COL_TITLE => $this->
ui->factory()->table()->column()->text(
73 $this->
lng->txt(self::LNG_TABLE_COL_TITLE)
74 )->withIsSortable(
true),
75 self::TABLE_COL_DESCRIPTION => $this->
ui->factory()->table()->column()->text(
76 $this->
lng->txt(self::LNG_TABLE_COL_DESCRIPTION)
77 )->withIsSortable(
true),
78 self::TABLE_COL_LAST_UPDATE => $this->
ui->factory()->table()->column()->text(
79 $this->
lng->txt(self::LNG_TABLE_COL_LAST_UPDATE)
80 )->withIsSortable(
true),
81 self::TABLE_COL_STATUS => $this->
ui->factory()->table()->column()->text(
82 $this->
lng->txt(self::LNG_TABLE_COL_STATUS)
83 )->withIsSortable(
true)
89 if (!$this->actions_permitted) {
92 $this->url_builder =
new URLBuilder($this->data_factory->uri($this->http->request()->getUri()->__toString()));
93 list($this->url_builder, $this->action_parameter_token, $this->row_id_token) =
94 $this->url_builder->acquireParameters(
95 [
'datatable', self::TABLE_ID],
96 self::TABLE_ACTION_ID,
100 foreach ($this->data_retrieval->getAllActions() as $command => $txt) {
101 $actions[$command] = $this->
ui->factory()->table()->action()->single(
103 $this->url_builder->withParameter($this->action_parameter_token, $command),
112 if (!isset($this->table)) {
113 $this->table = $this->
ui->factory()->table()->data(
114 $this->data_retrieval,
115 $this->
lng->txt(self::LNG_TABLE_TITLE),
119 ->withId(self::TABLE_ID)->withRequest($this->
http->request());
130 return $this->
ui->renderer()->render([$this->
getTable()]);
135 if (!$this->
http->wrapper()->query()->has($this->action_parameter_token->getName())) {
138 if (!$this->
http->wrapper()->query()->has($this->row_id_token->getName())) {
141 if (!$this->actions_permitted) {
144 $action = $this->
http->wrapper()->query()->retrieve(
145 $this->action_parameter_token->getName(),
146 $this->refinery->kindlyTo()->string()
148 $tokens = $this->
http->wrapper()->query()->retrieve(
149 $this->row_id_token->getName(),
150 $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->int())
152 $task_id = (
int) $tokens[0];
154 $this->
ctrl->setParameterByClass(get_class($task_handler),
'task_id', $task_id);
155 $this->
ctrl->redirectByClass(get_class($task_handler), $action);
156 $this->
ctrl->clearParameterByClass(get_class($task_handler),
'task_id');
Provides fluid interface to RBAC services.
const string TABLE_COL_TITLE
const string LNG_TABLE_COL_TITLE
const string LNG_TABLE_COL_STATUS
const string LNG_TABLE_COL_DESCRIPTION
ilURLBuilderToken $row_id_token
const string TABLE_COL_STATUS
const string LNG_TABLE_COL_LAST_UPDATE
const string TABLE_ACTION_ID
const string TABLE_COL_LAST_UPDATE
__construct(protected readonly DataFactory $data_factory, protected readonly UIServices $ui, protected readonly ilLanguage $lng, protected readonly HTTPServices $http, protected readonly DataRetrievalInterface $data_retrieval, protected readonly RefineryFactory $refinery, protected readonly ilCtrl $ctrl, protected readonly bool $actions_permitted=false)
ilURLBuilderToken $action_parameter_token
const string LNG_TABLE_TITLE
const string TABLE_COL_DESCRIPTION
Class ilCtrl provides processing control methods.
Factory for component tasks.
static getComponentTask(int $a_task_id)
This describes a Data Table.
readonly HttpService $http
static http()
Fetches the global http state from ILIAS.