19 declare(strict_types=1);
41 public const string ID =
'ref_id';
42 protected const string ACTION =
'table_action';
43 protected const string NAMESPACE =
'grouping_assign';
57 protected string $action,
58 protected int $content_obj_id,
69 $this->content_obj_id,
81 return $this->ui_factory->table()->data(
82 $this->data_retrieval,
83 $this->
lng->txt(
'crs_grp_assign_crs') .
' (' . $this->grouping->getTitle() .
')',
85 )->withRequest($this->
http->request())
94 $f = $this->ui_factory->table()->column();
97 self::COL_TITLE =>
$f->text($this->
lng->txt(
'title'))->withIsSortable(
true),
98 self::COL_PATH =>
$f->text($this->
lng->txt(
'path'))->withIsSortable(
true),
99 self::COL_ASSIGNED =>
$f->statusIcon($this->
lng->txt(
'assigned'))->withIsSortable(
true)
108 $f = $this->ui_factory->table()->action();
110 self::ACTION_TOGGLE_ASSIGNMENT =>
$f->standard(
111 $this->
lng->txt(
'grouping_change_assignment'),
120 if (!isset($this->url_builder)) {
128 if (!isset($this->action_token)) {
136 if (!isset($this->id_token)) {
144 $url_builder =
new URLBuilder($this->data_factory->uri(
145 rtrim(ILIAS_HTTP_PATH,
'/') .
'/' . $this->action
160 if ($this->
http->wrapper()->query()->has($this->
actionToken()->getName())) {
161 $action = $this->
http->wrapper()->query()->retrieve(
177 $retrieval_trafo = $this->
refinery->byTrying([
178 $this->
refinery->custom()->transformation(
function ($v) use ($data_retrieval) {
179 if ((
string) $v[0] ===
'ALL_OBJECTS') {
181 foreach ($data_retrieval->getAllEligibleRefIDs() as
$ref_id) {
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;
acquireParameters(array $namespace, string ... $names)
URLBuilderToken $action_token
URLBuilderToken $id_token
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...
const string ACTION_TOGGLE_ASSIGNMENT
initURLBuilderAndTokens()
const string COL_ASSIGNED
__construct(protected string $action, protected int $content_obj_id, protected ilObjCourseGrouping $grouping, protected ilLanguage $lng, protected UIFactory $ui_factory, protected DataFactory $data_factory, protected HTTP $http, protected Refinery $refinery, ilObjUser $user, ilTree $tree)
static _lookupType(int $id, bool $reference=false)
DataRetrieval $data_retrieval