ILIAS  trunk Revision v12.0_alpha-16-g3e876e53c80
SubitemPropertiesReader.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
25use ILIAS\Data\Factory as DataFactory;
26use ilLanguage;
31use Generator;
32
34{
35 protected ilLanguage $lng;
36 protected DataFactory $data_factory;
38
39 public static function type(): string
40 {
41 return 'glo';
42 }
43
44 public function init(Container $dic): void
45 {
46 $this->lng = $dic->language();
47 $this->lng->loadLanguageModule('content');
48 $this->data_factory = new DataFactory();
49 $this->static_url = $dic['static_url'];
50 }
51
52 public function getSubitemProperties(
53 PropertiesFactory $factory,
54 int $parent_ref_id,
55 ID ...$subitem_ids
56 ): Generator {
57 foreach ($subitem_ids as $subitem_id) {
58 $link = $this->static_url->builder()->build(
59 'git',
60 $this->data_factory->refId((int) $subitem_id->id()),
61 [$parent_ref_id]
62 );
63 yield $factory->get(
64 $subitem_id,
65 ilGlossaryTerm::_lookGlossaryTerm((int) $subitem_id->id()),
66 $link,
67 false,
68 $this->lng->txt('cont_term')
69 );
70 }
71 }
72}
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
language()
Get interface to the i18n service.
Definition: Container.php:95
Builds data types.
Definition: Factory.php:36
getSubitemProperties(PropertiesFactory $factory, int $parent_ref_id, ID ... $subitem_ids)
Order of the output should respect the order of the subitem_ids.
Class Services.
Definition: Services.php:38
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookGlossaryTerm(int $term_id)
get glossary term
language handling
get(ID $id, string $title, ?URI $link_to_subitem, bool $open_link_in_new_viewport, string $presentable_subitem_type)
$dic
Definition: ltiresult.php:33