19 declare(strict_types=1);
46 protected int $mode = self::FLAT;
58 int $single_ref_id = 0,
59 bool $admin_mode =
false 75 $this->hiddenfilesfound = $a_hiddenfilesfound;
86 protected function init(): void
88 if ($this->initialised) {
91 $tree = $this->domain->repositoryTree();
92 if ($this->mode === self::TREE) {
93 $this->
raw = $tree->getSubTree($tree->getNodeData($this->parent_ref_id));
94 } elseif ($this->mode === self::FLAT) {
95 $this->
raw = $tree->getChilds($this->parent_ref_id,
"title");
97 $this->
raw[] = $tree->getNodeData($this->single_ref_id);
107 $this->initialised =
true;
116 return count($this->
raw) > 0;
122 if (isset($this->raw_by_type[$type])) {
123 return array_map(
static function ($item) {
124 return (
int) $item[
"child"];
125 }, $this->raw_by_type[$type]);
133 return array_keys($this->raw_by_type[
"_all"]);
139 return $this->raw_by_type[
"_all"][
$ref_id] ??
null;
145 $type = $this->raw_by_type[
"_all"][
$ref_id][
"type"] ??
"";
146 $obj_definition = $this->domain->objectDefinition();
147 return $obj_definition->isSideBlock($type);
153 $all = $sort->sortItems([
"all" => $this->
raw]);
154 $this->
raw = $all[
"all"];
163 $obj_definition = $this->domain->objectDefinition();
165 $this->raw_by_type[
"_all"] = [];
166 foreach ($this->
raw as $key => $object) {
169 if ($object[
"type"] ===
"adm" || $object[
"type"] ===
"rolf" ||
170 $obj_definition->getDevMode($object[
"type"])) {
175 if ($obj_definition->isInactivePlugin($object[
"type"])) {
180 if (in_array($object[
'type'], array(
'file',
'fold',
'cat'))) {
183 if (!$this->admin_mode) {
191 $type = $obj_definition->getGroupOfObj($object[
"type"]);
193 $type = $object[
"type"];
196 $new_key = (
int) $object[
"child"];
197 $this->rendered[$new_key] =
false;
198 $this->raw_by_type[$type][$new_key] = $object;
200 $this->raw_by_type[
"_all"][$new_key] = $object;
201 if ($object[
"type"] !==
"sess") {
202 $this->raw_by_type[
"_non_sess"][$new_key] = $object;
209 if (isset($this->raw_by_type[
"sess"]) && count($this->raw_by_type[
"sess"]) > 0) {
216 foreach ($this->
raw as $key => $object) {
234 $this->parent_ref_id,
235 $this->parent_obj_id,
237 ) as $class_provider) {
238 $id = get_class($class_provider);
254 if (is_null($this->user_filter)) {
257 $filter = $this->domain->content()->filter(
261 $this->parent_obj_id,
266 $this->
raw = $filter->apply();
275 $ilObjDataCache = $this->domain->objectDataCache();
278 $short_desc =
$ilSetting->get(
"rep_shorten_description");
279 $short_desc_max_length = (
int)
$ilSetting->get(
"rep_shorten_description_length");
283 foreach ($this->
raw as $key => $object) {
285 $object[
"description"],
286 $short_desc_max_length,
294 foreach ($this->
raw as $key => $object) {
295 $obj_ids[] = $object[
"obj_id"];
297 if (count($obj_ids) > 0) {
299 foreach ($this->
raw as $key => $object) {
301 if ($ilObjDataCache->isTranslatedDescription((
int) $object[
"obj_id"])) {
302 $long_desc[$object[
"obj_id"]] = $object[
"description"];
304 if ($short_desc && $short_desc_max_length) {
306 (
string) ($long_desc[$object[
"obj_id"]] ??
""),
307 $short_desc_max_length,
311 $this->
raw[$key][
"description"] = $long_desc[$object[
"obj_id"]] ??
'';
326 $this->parent_ref_id,
327 $this->parent_obj_id,
329 ) as $class_provider) {
330 $id = get_class($class_provider);
333 $class_provider->setSelection($current);
334 $filtered = $class_provider->getFilteredObjects();
335 $this->
raw = array_filter($this->
raw,
static function ($i) use ($filtered) {
336 return (is_array($filtered) && in_array($i[
"obj_id"], $filtered));
345 foreach ($this->raw_by_type[
"_all"] as $object) {
346 $obj_ids[] = $object[
"obj_id"];
Manages container subitems set.
addAdditionalSubItemInformationToObject(array &$object)
isSideBlockItem(int $ref_id)
static preloadByObjIds(array $a_obj_ids)
Preload list gui data.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getRefIdsOfType(string $type)
static _isFileHidden(string $a_file_name)
Returns true, if a file with the specified name, is usually hidden from the user. ...
static _lookupObjId(int $ref_id)
preloadAdvancedMDValues()
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static getLongDescriptions(array $obj_ids)
applyClassificationFilter()
From ilContainer.
getAdditionalSubItemInformation()
InternalDomainService $domain
__construct(InternalDomainService $domain, int $mode, int $parent_ref_id, ?\ilContainerUserFilter $user_filter=null, int $single_ref_id=0, bool $admin_mode=false)
setHiddenFilesFound(bool $a_hiddenfilesfound)
isClassificationFilterActive()
getCompleteDescriptions()
From ilContainer.
groupItems()
Internally group all items.
applyUserFilter()
Apply container user filter on objects.
static addAdditionalSubItemInformation(array &$item)
Parse item data for list entries.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
static shortenTextExtended(string $a_str, int $a_len, bool $a_dots=false, bool $a_next_blank=false, bool $a_keep_extension=false)
static _getInstance(int $a_obj_id)
ilContainerUserFilter $user_filter
static _lookupContainerSetting(int $a_id, string $a_keyword, ?string $a_default_value=null)
static _lookupType(int $id, bool $reference=false)
getRawDataByRefId(int $ref_id)
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 sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)