ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
CertificateMainBarProvider.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
27
33{
34 public function getStaticTopItems(): array
35 {
36 return [];
37 }
38
39 public function getStaticSubItems(): array
40 {
41 global $DIC;
42
43 $title = $this->dic->language()->txt("mm_certificates");
44 $icon = $this->dic->ui()->factory()->symbol()->icon()->standard("cert", $title);
45
46 $ctrl = $DIC->ctrl();
47 return [
48 $this->mainmenu
49 ->link($this->if->identifier('mm_cert'))
50 ->withTitle($title)
51 ->withAction(
52 $ctrl->getLinkTargetByClass(
53 [
54 \ilDashboardGUI::class,
55 \ilAchievementsGUI::class,
56 \ilUserCertificateGUI::class
57 ]
58 )
59 )
60 ->withParent(StandardTopItemsProvider::getInstance()->getAchievementsIdentification())
61 ->withVisibilityCallable(
62 static fn(): bool => BasicAccessCheckClosuresSingleton::getInstance()->isUserLoggedIn()()
63 )
64 ->withAvailableCallable(
65 static fn(): bool => (new ilCertificateActiveValidator())->validate()
66 )
67 ->withNonAvailableReason(
68 $this->dic->ui()->factory()->legacy()->content(
69 $this->dic->language()->txt('component_not_active')
70 )
71 )
72 ->withSymbol($icon)
73 ->withPosition(50),
74 ];
75 }
76}
if(!file_exists('../ilias.ini.php'))
global $DIC
Definition: shib_login.php:26