19declare(strict_types=1);
55 $this->storage =
$DIC[
'resource_storage'];
67 static $usr_language_key;
68 static $default_language;
71 if (!isset($usr_language_key) && (
$DIC->user()->getId() === 0 ||
$DIC->user()->isAnonymous())) {
72 $usr_language_key =
$DIC->http()->wrapper()->query()->has(
'lang')
73 ?
$DIC->http()->wrapper()->query()->retrieve(
'lang',
$DIC->refinery()->to()->string())
77 if (!isset($usr_language_key)) {
78 $usr_language_key =
$DIC->language()->getUserLanguage() ?:
$DIC->language()->getDefaultLanguage();
80 if (!isset($default_language)) {
85 ($item->getRefId() > 0) ?
90 if ($item instanceof
hasTitle && isset($this->translations[
"{$item->getProviderIdentification()->serialize()}|$usr_language_key"])
91 && $this->translations[
"{$item->getProviderIdentification()->serialize()}|$usr_language_key"] !==
'') {
92 return $item->
withTitle((
string) $this->translations[
"{$item->getProviderIdentification()->serialize()}|$usr_language_key"]);
133 if (isset($this->items[$serialized][
'parent_identification'])) {
134 return $DIC->globalScreen()->identification()->fromSerializedIdentification($this->items[$serialized][
'parent_identification']);
137 return $item->getParent();
146 if (isset($this->items[
$id][self::ICON_ID]) && strlen((
string) $this->items[
$id][self::ICON_ID]) > 1) {
149 $ri = $this->storage->manage()->find($this->items[
$id][self::ICON_ID]);
155 $src = $this->storage->consume()->src($ri);
161 if ($old_symbol instanceof
Glyph) {
162 $aria_label = $old_symbol->getAriaLabel();
163 } elseif ($old_symbol instanceof
Icon) {
164 $aria_label = $old_symbol->getLabel();
165 } elseif ($item instanceof
hasTitle) {
166 $aria_label = $item->getTitle();
169 $aria_label = empty($aria_label) ?
$id : $aria_label;
171 $symbol =
$DIC->ui()->factory()->symbol()->icon()->custom($src->getSrc(), $aria_label);
172 }
catch (Exception) {
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
static getArray(?string $key=null, string|array|null $values=null)
Indicates that a file is missing or not found.
static getDefaultLanguage()
static _lookupObjectId(int $ref_id)
static _lookupTitle(int $obj_id)
Interface IdentificationInterface.
customTranslationForUser(hasTitle $item)
withSymbol(Symbol $symbol)
getPosition()
Return the default position for installation, this will be overridden by the configuration later.
withPosition(int $position)
getProviderIdentification()
This describes how an icon could be modified during construction of UI.