19declare(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,
61 protected UIFactory $ui_factory,
62 protected DataFactory $data_factory,
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'),
112 $this->URLBuilder()->withParameter($this->actionToken(), self::ACTION_TOGGLE_ASSIGNMENT),
120 if (!isset($this->url_builder)) {
128 if (!isset($this->action_token)) {
136 if (!isset($this->id_token)) {
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([
179 if ((
string) $v[0] ===
'ALL_OBJECTS') {
182 $res[] = $ref_id->toInt();
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
__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)
initURLBuilderAndTokens()
const string ACTION_TOGGLE_ASSIGNMENT
URLBuilderToken $id_token
DataRetrieval $data_retrieval
URLBuilderToken $action_token
Builds a Color from either hex- or rgb values.
acquireParameters(array $namespace, string ... $names)
Class ilObject Basic functions for all objects.
static _lookupType(int $id, bool $reference=false)
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
A Column describes the form of presentation for a certain aspect of data, i.e.
This describes a Data Table.
static http()
Fetches the global http state from ILIAS.