19 declare(strict_types=1);
47 protected int $mode = self::FLAT;
59 int $single_ref_id = 0,
60 bool $admin_mode =
false,
61 bool $force_session_order_by_date =
true 78 $this->hiddenfilesfound = $a_hiddenfilesfound;
89 protected function init(): void
91 if ($this->initialised) {
94 $tree = $this->domain->repositoryTree();
95 if ($this->mode === self::TREE) {
96 $this->
raw = $tree->getSubTree($tree->getNodeData($this->parent_ref_id));
97 } elseif ($this->mode === self::FLAT) {
98 $this->
raw = $tree->getChilds($this->parent_ref_id,
"title");
100 $this->
raw[] = $tree->getNodeData($this->single_ref_id);
110 $this->initialised =
true;
119 return count($this->
raw) > 0;
125 if (isset($this->raw_by_type[$type])) {
126 return array_map(
static function ($item) {
127 return (
int) $item[
"child"];
128 }, $this->raw_by_type[$type]);
136 return array_keys($this->raw_by_type[
"_all"]);
142 return $this->raw_by_type[
"_all"][
$ref_id] ??
null;
148 $type = $this->raw_by_type[
"_all"][
$ref_id][
"type"] ??
"";
149 $obj_definition = $this->domain->objectDefinition();
150 return $obj_definition->isSideBlock($type);
156 $all = $sort->sortItems([
"all" => $this->
raw]);
157 $this->
raw = $all[
"all"];
166 $obj_definition = $this->domain->objectDefinition();
168 $this->raw_by_type[
"_all"] = [];
169 foreach ($this->
raw as $key => $object) {
172 if ($object[
"type"] ===
"adm" || $object[
"type"] ===
"rolf" ||
173 $obj_definition->getDevMode($object[
"type"])) {
178 if ($obj_definition->isInactivePlugin($object[
"type"])) {
183 if (in_array($object[
'type'], array(
'file',
'fold',
'cat'))) {
186 if (!$this->admin_mode) {
194 $type = $obj_definition->getGroupOfObj($object[
"type"]);
196 $type = $object[
"type"];
199 $new_key = (
int) $object[
"child"];
200 $this->rendered[$new_key] =
false;
201 $this->raw_by_type[$type][$new_key] = $object;
203 $this->raw_by_type[
"_all"][$new_key] = $object;
204 if ($object[
"type"] !==
"sess") {
205 $this->raw_by_type[
"_non_sess"][$new_key] = $object;
212 if (!$this->force_session_order_by_date) {
215 if (isset($this->raw_by_type[
"sess"]) && count($this->raw_by_type[
"sess"]) > 0) {
222 foreach ($this->
raw as $key => $object) {
240 $this->parent_ref_id,
241 $this->parent_obj_id,
243 ) as $class_provider) {
244 $id = get_class($class_provider);
260 if (is_null($this->user_filter)) {
263 $filter = $this->domain->content()->filter(
267 $this->parent_obj_id,
272 $this->
raw = $filter->apply();
281 $ilObjDataCache = $this->domain->objectDataCache();
284 $short_desc =
$ilSetting->get(
"rep_shorten_description");
285 $short_desc_max_length = (
int)
$ilSetting->get(
"rep_shorten_description_length");
289 foreach ($this->
raw as $key => $object) {
291 $object[
"description"],
292 $short_desc_max_length,
300 foreach ($this->
raw as $key => $object) {
301 $obj_ids[] = $object[
"obj_id"];
303 if (count($obj_ids) > 0) {
305 foreach ($this->
raw as $key => $object) {
307 if ($ilObjDataCache->isTranslatedDescription((
int) $object[
"obj_id"])) {
308 $long_desc[$object[
"obj_id"]] = $object[
"description"];
310 if ($short_desc && $short_desc_max_length) {
312 (
string) ($long_desc[$object[
"obj_id"]] ??
""),
313 $short_desc_max_length,
317 $this->
raw[$key][
"description"] = $long_desc[$object[
"obj_id"]] ??
'';
332 $this->parent_ref_id,
333 $this->parent_obj_id,
335 ) as $class_provider) {
336 $id = get_class($class_provider);
339 $class_provider->setSelection($current);
340 $filtered = $class_provider->getFilteredObjects();
341 $this->
raw = array_filter($this->
raw,
static function ($i) use ($filtered) {
342 return (is_array($filtered) && in_array($i[
"obj_id"], $filtered));
351 foreach ($this->raw_by_type[
"_all"] as $object) {
352 $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)
bool $force_session_order_by_date
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
setHiddenFilesFound(bool $a_hiddenfilesfound)
__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)
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)