19declare(strict_types=1);
41 protected int $content_obj_id,
45 protected UIFactory $ui_factory,
47 protected DataFactory $data_factory
53 array $visible_column_ids,
56 mixed $additional_viewcontrol_data,
58 mixed $additional_parameters
62 $assigned = $this->grouping->getAssignedItems();
63 $assigned_ref_ids = [];
64 foreach ($assigned as $item) {
65 $assigned_ref_ids[] = $item[
'target_ref_id'];
68 $ok_icon = $this->ui_factory->symbol()->icon()->custom(
69 'assets/images/standard/icon_ok.svg',
70 $this->
lng->txt(
'assigned')
79 if (in_array(
$ref_id->toInt(), $assigned_ref_ids)) {
82 $records[
$ref_id->toInt()] = $record;
88 foreach ($records as
$ref_id => $record) {
94 mixed $additional_viewcontrol_data,
96 mixed $additional_parameters
98 return count($this->getAllEligibleRefIDs());
110 $this->
user->getId(),
114 $filtered_ref_ids = [];
115 foreach ($item_ref_ids as $item_ref_id) {
116 if ($this->tree->checkForParentType($item_ref_id,
'adm')) {
119 $filtered_ref_ids[] = $this->data_factory->refId($item_ref_id);
121 return $filtered_ref_ids;
127 foreach ($this->tree->getPathFull(
$ref_id->toInt()) as $step) {
128 $titles[] = $step[
'title'];
130 return implode(
' > ', $titles);
135 $order_field = array_keys($order->
get())[0] ?? AssignmentHandler::COL_TITLE;
136 $order_direction = $order->
get()[$order_field] ?? Order::ASC;
138 $ordering_callable_without_direction = match ($order_field) {
139 AssignmentHandler::COL_TITLE, AssignmentHandler::COL_PATH =>
140 fn(
$a,
$b) => (
$a[$order_field] ??
'') <=> (
$b[$order_field] ??
''),
141 AssignmentHandler::COL_ASSIGNED =>
142 fn(
$a,
$b) => isset(
$a[$order_field]) <=> isset(
$b[$order_field])
144 $ordering_callable = fn(
$a,
$b) => $order_direction === Order::ASC ?
145 $ordering_callable_without_direction(
$a,
$b) :
146 $ordering_callable_without_direction(
$b,
$a);
148 uasort($records, $ordering_callable);
const string COL_ASSIGNED
buildPath(ReferenceId $ref_id)
sortRecords(array $records, Order $order)
getTotalRowCount(mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
Mainly for the purpose of pagination-support, it is important to know about the total number of recor...
getRows(DataRowBuilder $row_builder, array $visible_column_ids, Range $range, Order $order, mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
This is called by the table to retrieve rows; map data-records to rows using the $row_builder e....
__construct(protected int $content_obj_id, protected ilObjCourseGrouping $grouping, protected ilObjUser $user, protected ilTree $tree, protected UIFactory $ui_factory, protected ilLanguage $lng, protected DataFactory $data_factory)
Builds a Color from either hex- or rgb values.
Both the subject and the direction need to be specified when expressing an order.
A simple class to express a naive range of whole positive numbers.
Class ilObject Basic functions for all objects.
static _lookupType(int $id, bool $reference=false)
static _lookupTitle(int $obj_id)
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
Util class various functions, usage as namespace.
static _getObjectsByOperations( $a_obj_type, string $a_operation, int $a_usr_id=0, int $limit=0)
Get all objects of a specific type and check access This function is not recursive,...
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
buildDataRow(string $id, array $record)
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples