19 declare(strict_types=1);
39 protected const string ID =
'grouping_id';
40 protected const string ACTION =
'table_action';
58 protected string $action,
59 protected int $content_obj_id,
68 $this->content_obj_id,
78 return $this->ui_factory->table()->data(
79 $this->data_retrieval,
80 $this->
lng->txt(
'groupings'),
82 )->withRequest($this->
http->request())
91 $f = $this->ui_factory->table()->column();
94 self::COL_TITLE =>
$f->text($this->
lng->txt(
'title'))->withIsSortable(
true),
95 self::COL_DESCRIPTION =>
$f->text($this->
lng->txt(
'description'))->withIsSortable(
true),
96 self::COL_SOURCE =>
$f->link($this->
lng->txt(
'groupings_source'))->withIsSortable(
true),
97 self::COL_UNIQUE_FIELD =>
$f->text($this->
lng->txt(
'unambiguousness'))->withIsSortable(
true),
98 self::COL_ASSIGNED_OBJS =>
$f->linkListing($this->
lng->txt(
'groupings_assigned_obj_' . $type))->withIsSortable(
true)
107 $f = $this->ui_factory->table()->action();
109 self::ACTION_EDIT =>
$f->single(
110 $this->
lng->txt(
'edit'),
114 self::ACTION_DELETE =>
$f->standard(
115 $this->lng->txt(
'delete'),
124 if (!isset($this->url_builder)) {
132 if (!isset($this->action_token)) {
140 if (!isset($this->id_token)) {
148 $url_builder =
new URLBuilder($this->data_factory->uri(
149 ltrim(ILIAS_HTTP_PATH,
'/') .
'/' . $this->action
164 if ($this->
http->wrapper()->query()->has($this->
actionToken()->getName())) {
165 $action = $this->
http->wrapper()->query()->retrieve(
181 $retrieval_trafo = $this->
refinery->byTrying([
182 $this->
refinery->custom()->transformation(
function ($v) use ($data_retrieval) {
183 if ((
string) $v[0] ===
'ALL_OBJECTS') {
184 return $data_retrieval->getAllGroupingIDs();
186 throw new \Exception(
'not all selected');
188 $this->
refinery->kindlyTo()->listOf(
193 if ($this->
http->wrapper()->query()->has($this->
IDToken()->getName())) {
194 $grouping_ids = $this->
http->wrapper()->query()->retrieve(
200 return $grouping_ids;
const string COL_ASSIGNED_OBJS
const string ACTION_DELETE
const string COL_DESCRIPTION
acquireParameters(array $namespace, string ... $names)
URLBuilderToken $action_token
const string COL_UNIQUE_FIELD
static http()
Fetches the global http state from ILIAS.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
initURLBuilderAndTokens()
__construct(protected string $action, protected int $content_obj_id, protected ilLanguage $lng, protected UIFactory $ui_factory, protected DataFactory $data_factory, protected HTTP $http, protected Refinery $refinery, StaticURL $static_url)
DataRetrieval $data_retrieval
URLBuilderToken $id_token
static _lookupType(int $id, bool $reference=false)