19 declare(strict_types=1);
46 $icon = [ilObject::class,
'_getIcon'],
47 $references_of = [ilObject::class,
'_getAllReferences'],
48 $link_to = [ilLink::class,
'_getLink']
50 $this->icon = Closure::fromCallable($icon);
51 $this->references_of = Closure::fromCallable($references_of);
52 $this->link_to = Closure::fromCallable($link_to);
57 $meta_data = $this->
metaData($badge);
58 if (
null === $meta_data) {
62 $parent_icon = $this->container->ui()->factory()->symbol()->icon()->custom(
63 ($this->icon)($meta_data[
'id'],
'big', $meta_data[
'type']),
64 $this->container->language()->txt(
'obj_' . $meta_data[
'type']),
68 $parent_ref_id = current(($this->references_of)($meta_data[
'id']));
69 if ($parent_ref_id && $this->container->access()->checkAccess(
'read',
'', $parent_ref_id)) {
70 $parent_link = $this->container->ui()
73 ->standard($meta_data[
'title'], ($this->link_to)($parent_ref_id));
75 $parent_link = $this->container->ui()->factory()->legacy()->content($meta_data[
'title']);
78 return $this->container->ui()->factory()->listing()->descriptive([
79 $this->container->language()->txt(
'object') => $this->container->ui()->factory()->legacy()->content(
80 $this->container->ui()->renderer()->render([$parent_icon, $parent_link])
87 $meta_data = $this->
metaData($badge);
88 if (
null === $meta_data) {
92 $icon = [$this->container->ui()->factory()->symbol()->icon(),
'custom'];
95 $this->container->ui()->renderer()->render(
$icon(($this->icon)($meta_data[
'id'],
'small', $meta_data[
'type']), $meta_data[
'title'])),
106 if ($parent[
'type'] ===
'bdga') {
__construct(private readonly Container $container, $icon=[ilObject::class, '_getIcon'], $references_of=[ilObject::class, '_getAllReferences'], $link_to=[ilLink::class, '_getLink'])
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
readonly Closure $link_to
asProperty(ilBadge $badge)
readonly Closure $references_of
asComponent(ilBadge $badge)