4 declare(strict_types=1);
54 $this->logger = $DIC->logger()->otpl();
55 $this->definition = $DIC[
'objDefinition'];
64 if (!isset(self::$instance)) {
65 self::$instance =
new self();
67 return self::$instance;
82 if (!$assigned_template) {
95 foreach ($this->
settings->getTemplates() as $template) {
96 if ($template->getId() == $template_id) {
97 return $template->getIconHandler()->getAbsolutePath();
108 foreach ($this->assignments as $tpl_id =>
$assignments) {
110 return (
int) $tpl_id;
129 $ref_id = end($refs);
139 return in_array($type, $this->icon_types);
145 $this->icon_types = [];
149 if (
$tpl->getIconIdentifier() !=
'') {
150 $templates[] =
$tpl->getId();
151 foreach (
$tpl->getAssignments() as $assignment) {
152 if (!in_array($assignment, $this->icon_types)) {
153 $this->icon_types[] = $assignment;
getIconPathForTemplate(int $template_id)
Icon factory for didactic template custom icons.
supportsCustomIcon(string $type)
static getInstance()
Get singelton instance.
getIconPathForObject(int $obj_id)
Get icon path for object not applicable to non container objects, use getIconPathForReference instead...
static _getAllReferences($a_id)
get all reference ids of object
getIconPathForReference(int $ref_id)
static getAssignmentsForTemplates(array $template_ids)
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
__construct()
ilDidacticTemplateIconFactory constructor.
findAssignedTemplate(int $ref_id)