19declare(strict_types=1);
27use ILIAS\Repository\RetrievalBase;
44 protected DataFactory $data_factory
54 $media_object_manager = $this->domain->mediaObject();
55 $lom = $this->domain->learningObjectMetadata();
57 if (isset($this->internal_data)) {
60 $this->internal_data = [];
61 foreach ($this->sub_object_retrieval->getPossibleTypes() as $type) {
62 foreach ($this->sub_object_retrieval->getAllIDsForType($type) as
$id) {
63 $title = $this->sub_object_retrieval->getTitleOfSubObject($type,
$id);
64 $link = $this->sub_object_retrieval->getLinkToSubObject($type,
$id);
70 $this->internal_data[$mob_id][
'internal_usages'][$type .
':' .
$id] = [
77 foreach ($this->internal_data as $mob_id => $value) {
79 unset($this->internal_data[$mob_id]);
83 $last_update = $media_object_manager->getLastChangeTimestamp($mob_id);
85 $reader = $lom->read(0, $mob_id,
'mob', $lom->paths()->copyright());
86 $preset_copyright = $lom->copyrightHelper()->readPresetCopyright($reader);
89 unset($this->internal_data[$mob_id]);
93 $this->internal_data[$mob_id][
'id'] = $mob_id;
94 $this->internal_data[$mob_id][
'title'] = $title;
95 $this->internal_data[$mob_id][
'last_update'] = $last_update;
96 $this->internal_data[$mob_id][
'copyright_identifier'] = $preset_copyright->identifier();
97 $this->internal_data[$mob_id][
'copyright'] = $lom->copyrightHelper()->hasPresetCopyright($reader) ?
98 $preset_copyright->presentAsString() :
99 $lom->copyrightHelper()->readCustomCopyright($reader);
110 $access = $this->domain->access();
114 foreach (
$data as $key => $datum) {
115 $mob_id = $datum[
'id'];
116 $already_collected_obj_ids = [];
122 $usage[
'type'] .
':' . $usage[
'id'],
123 array_keys($datum[
'internal_usages'])
129 if (!$parent_obj_id || in_array($parent_obj_id, $already_collected_obj_ids)) {
133 $parent_ref_id =
null;
136 if (!$access->checkAccess(
'visible',
'',
$ref_id)) {
140 $show_link = $access->checkAccess(
'read',
'', $parent_ref_id);
143 if (!$parent_ref_id) {
149 $link_to_parent =
'';
151 $link_to_parent = (string)
$static_url->builder()->build(
153 $this->data_factory->refId($parent_ref_id)
157 $already_collected_obj_ids[] = $parent_obj_id;
158 if ($parent_type ===
'mep') {
159 $data[$key][
'mep_usages'][] = [
160 'title' => $parent_title,
161 'link' => $link_to_parent
165 $data[$key][
'external_usages'][] = [
166 'title' => $parent_title,
167 'link' => $link_to_parent
176 string $copyright_identifier,
181 ($filter[
'title'] ??
'') !==
'' &&
182 !str_contains(strtolower($title), strtolower($filter[
'title']))
188 ($filter[
'copyright'] ?? []) !== [] &&
189 !in_array($copyright_identifier, $filter[
'copyright'])
194 $last_update =
new DateTimeImmutable(
'@' . $last_update);
196 (isset($filter[
'last_update'][0]) && $last_update <
new DateTimeImmutable($filter[
'last_update'][0])) ||
197 (isset($filter[
'last_update'][1]) && $last_update >
new DateTimeImmutable($filter[
'last_update'][1]))
208 ?
Order $order =
null,
210 array $parameters = []
212 $data = $this->getInternalData($filter);
230 return count($this->getInternalData($filter));
235 return $field ===
'last_update';
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
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 _getAllReferences(int $id)
get all reference ids for object ID
static _lookupTitle(int $obj_id)
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if(!file_exists('../ilias.ini.php'))