3declare(strict_types=1);
35 $this->definition =
$DIC[
'objDefinition'];
41 if (!isset(self::$instance)) {
42 self::$instance =
new self();
57 if (!$assigned_template) {
67 foreach ($this->
settings->getTemplates() as $template) {
68 if ($template->getId() === $template_id) {
69 return $template->getIconHandler()->getAbsolutePath();
78 foreach ($this->assignments as $tpl_id =>
$assignments) {
107 return in_array(
$type, $this->icon_types,
true);
113 $this->icon_types = [];
117 if (
$tpl->getIconIdentifier() !==
'') {
118 $templates[] =
$tpl->getId();
119 foreach (
$tpl->getAssignments() as $assignment) {
120 if (!in_array($assignment, $this->icon_types,
true)) {
121 $this->icon_types[] = $assignment;
Class IllegalStateException.
Icon factory for didactic template custom icons.
findAssignedTemplate(int $ref_id)
static ilDidacticTemplateIconFactory $instance
getIconPathForReference(int $ref_id)
getIconPathForTemplate(int $template_id)
supportsCustomIcon(string $type)
ilObjectDefinition $definition
getIconPathForObject(int $obj_id)
Get icon path for object Not applicable to non container objects, use getIconPathForReference instead...
ilDidacticTemplateSettings $settings
static getAssignmentsForTemplates(array $template_ids)
parses the objects.xml it handles the xml-description of all ilias objects
static _lookupType(int $id, bool $reference=false)
static _getAllReferences(int $id)
get all reference ids for object ID
static _lookupObjId(int $ref_id)
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl