19 declare(strict_types=1);
49 $this->definition = $DIC[
'objDefinition'];
55 if (!isset(self::$instance)) {
56 self::$instance =
new self();
59 return self::$instance;
71 if (!$assigned_template) {
81 foreach ($this->
settings->getTemplates() as $template) {
82 if ($template->getId() === $template_id) {
83 return $template->getIconHandler()->getAbsolutePath();
92 foreach ($this->assignments as $tpl_id => $assignments) {
93 if (in_array($ref_id, $assignments,
true)) {
121 return in_array($type, $this->icon_types,
true);
127 $this->icon_types = [];
130 foreach ($this->
settings->getTemplates() as $tpl) {
131 if ($tpl->getIconIdentifier() !==
'') {
132 $templates[] = $tpl->getId();
133 foreach ($tpl->getAssignments() as $assignment) {
134 if (!in_array($assignment, $this->icon_types,
true)) {
135 $this->icon_types[] = $assignment;
getIconPathForTemplate(int $template_id)
Icon factory for didactic template custom icons.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
supportsCustomIcon(string $type)
static _getAllReferences(int $id)
get all reference ids for object ID
getIconPathForObject(int $obj_id)
Get icon path for object Not applicable to non container objects, use getIconPathForReference instead...
static _lookupObjId(int $ref_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getIconPathForReference(int $ref_id)
static getAssignmentsForTemplates(array $template_ids)
ilObjectDefinition $definition
ilDidacticTemplateSettings $settings
static _lookupType(int $id, bool $reference=false)
findAssignedTemplate(int $ref_id)
static ilDidacticTemplateIconFactory $instance