19declare(strict_types=1);
62 protected bool $include_objective_items =
false
79 $this->hiddenfilesfound = $a_hiddenfilesfound;
90 protected function init(): void
92 if ($this->initialised) {
95 $tree = $this->domain->repositoryTree();
96 if ($this->mode === self::TREE) {
97 $this->
raw = $tree->getSubTree($tree->getNodeData($this->parent_ref_id));
98 } elseif ($this->mode === self::FLAT) {
99 $this->
raw = $tree->getChilds($this->parent_ref_id,
"title");
101 $this->
raw[] = $tree->getNodeData($this->single_ref_id);
103 if ($this->include_objective_items) {
114 $this->initialised =
true;
120 foreach ($objective_ids as $objective_id) {
130 if ((
$ref_id = $item[
"ref_id"] ?? 0) > 0) {
131 foreach ($this->
raw as $raw_item) {
132 if ($raw_item[
"ref_id"] ==
$ref_id) {
136 $this->
raw[] = $item;
146 return count($this->
raw) > 0;
152 if (isset($this->raw_by_type[$type])) {
153 return array_map(
static function ($item) {
154 return (
int) $item[
"child"];
155 }, $this->raw_by_type[$type]);
163 return array_keys($this->raw_by_type[
"_all"]);
169 return $this->raw_by_type[
"_all"][
$ref_id] ??
null;
175 $type = $this->raw_by_type[
"_all"][
$ref_id][
"type"] ??
"";
176 $obj_definition = $this->domain->objectDefinition();
177 return $obj_definition->isSideBlock($type);
183 $all = $sort->sortItems([
"all" => $this->
raw]);
184 $this->
raw = $all[
"all"];
193 $obj_definition = $this->domain->objectDefinition();
195 $this->raw_by_type[
"_all"] = [];
196 foreach ($this->
raw as $key => $object) {
199 if ($object[
"type"] ===
"adm" || $object[
"type"] ===
"rolf" ||
200 $obj_definition->getDevMode($object[
"type"])) {
205 if ($obj_definition->isInactivePlugin($object[
"type"])) {
224 $type = $obj_definition->getGroupOfObj($object[
"type"]);
226 $type = $object[
"type"];
229 $new_key = (
int) $object[
"child"];
230 $this->rendered[$new_key] =
false;
231 $this->raw_by_type[$type][$new_key] = $object;
233 $this->raw_by_type[
"_all"][$new_key] = $object;
234 if ($object[
"type"] !==
"sess") {
235 $this->raw_by_type[
"_non_sess"][$new_key] = $object;
242 if (!$this->force_session_order_by_date) {
245 if (isset($this->raw_by_type[
"sess"]) && count($this->raw_by_type[
"sess"]) > 0) {
252 foreach ($this->
raw as $key => $object) {
270 $this->parent_ref_id,
271 $this->parent_obj_id,
273 ) as $class_provider) {
274 $id = get_class($class_provider);
290 if (is_null($this->user_filter)) {
293 $filter = $this->domain->content()->filter(
297 $this->parent_obj_id,
302 $this->
raw = $filter->apply();
311 $ilObjDataCache = $this->domain->objectDataCache();
314 $short_desc =
$ilSetting->get(
"rep_shorten_description");
315 $short_desc_max_length = (
int)
$ilSetting->get(
"rep_shorten_description_length");
318 foreach ($this->
raw as $key => $object) {
320 $object[
"description"],
321 $short_desc_max_length,
329 foreach ($this->
raw as $key => $object) {
330 $obj_ids[] = $object[
"obj_id"];
332 if (count($obj_ids) > 0) {
334 foreach ($this->
raw as $key => $object) {
336 if ($ilObjDataCache->isTranslatedDescription((
int) $object[
"obj_id"])) {
337 $long_desc[$object[
"obj_id"]] = $object[
"description"];
339 if ($short_desc && $short_desc_max_length) {
341 (
string) ($long_desc[$object[
"obj_id"]] ??
""),
342 $short_desc_max_length,
346 $this->
raw[$key][
"description"] = $long_desc[$object[
"obj_id"]] ??
'';
360 $this->parent_ref_id,
361 $this->parent_obj_id,
363 ) as $class_provider) {
364 $id = get_class($class_provider);
367 $class_provider->setSelection($current);
368 $filtered = $class_provider->getFilteredObjects();
369 $this->
raw = array_filter($this->
raw,
static function ($i) use ($filtered) {
370 return (is_array($filtered) && in_array($i[
"obj_id"], $filtered));
379 foreach ($this->raw_by_type[
"_all"] as $object) {
380 $obj_ids[] = $object[
"obj_id"];
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Manages container subitems set.
InternalDomainService $domain
isClassificationFilterActive()
__construct(InternalDomainService $domain, int $mode, int $parent_ref_id, ?\ilContainerUserFilter $user_filter=null, int $single_ref_id=0, bool $admin_mode=false, bool $force_session_order_by_date=true, protected bool $include_objective_items=false)
getRefIdsOfType(string $type)
getRawDataByRefId(int $ref_id)
preloadAdvancedMDValues()
groupItems()
Internally group all items.
ilContainerUserFilter $user_filter
applyUserFilter()
Apply container user filter on objects.
addAdditionalSubItemInformationToObject(array &$object)
isSideBlockItem(int $ref_id)
setHiddenFilesFound(bool $a_hiddenfilesfound)
getCompleteDescriptions()
From ilContainer.
applyClassificationFilter()
From ilContainer.
bool $force_session_order_by_date
getAdditionalSubItemInformation()
static preloadByObjIds(array $a_obj_ids)
Preload list gui data.
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
static getValidProviders(int $a_parent_ref_id, int $a_parent_obj_id, string $a_parent_obj_type)
Get all valid providers (for parent container)
static _getInstance(int $a_obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupContainerSetting(int $a_id, string $a_keyword, ?string $a_default_value=null)
static _getObjectiveIds(int $course_id, bool $a_activated_only=false)
static getItemsByObjective(int $objective_id)
Get objective items.
static addAdditionalSubItemInformation(array &$item)
Parse item data for list entries.
static _lookupType(int $id, bool $reference=false)
static getLongDescriptions(array $obj_ids)
static _lookupObjId(int $ref_id)
static shortenTextExtended(string $a_str, int $a_len, bool $a_dots=false, bool $a_next_blank=false, bool $a_keep_extension=false)