ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
NotesMainBarProvider.php
Go to the documentation of this file.
1<?php
2
20
24
30{
31 public function getStaticTopItems(): array
32 {
33 return [];
34 }
35
36 public function getStaticSubItems(): array
37 {
39 $ctrl = $dic->ctrl();
40
41 // Comments
42 $title = $dic->language()->txt("mm_comments");
43 $icon = $this->dic->ui()->factory()->symbol()->icon()->standard(Standard::COMS, $title);
44 $ctrl->setParameterByClass(\ilPDNotesGUI::class, "note_type", 2);
45 $comments = $this->mainmenu->link($this->if->identifier('mm_pd_comments'))
46 ->withTitle($title)
47 ->withAction($ctrl->getLinkTargetByClass(["ilDashboardGUI", "ilPDNotesGUI"], "showPublicComments"))
48 ->withParent(StandardTopItemsProvider::getInstance()->getCommunicationIdentification())
49 ->withPosition(50)
50 ->withSymbol($icon)
51 ->withNonAvailableReason($this->dic->ui()->factory()->legacy()->content($this->dic->language()->txt('component_not_active')))
52 ->withAvailableCallable(
53 static function () use ($dic): bool {
54 return !$dic->settings()->get("disable_comments");
55 }
56 );
57
58 $title = $dic->language()->txt("mm_notes");
59 $icon = $this->dic->ui()->factory()->symbol()->icon()->standard(Standard::NOTS, $title);
60
61 // Notes
62 $ctrl->setParameterByClass(\ilPDNotesGUI::class, "note_type", 1);
63 $notes = $this->mainmenu->link($this->if->identifier('mm_pd_notes'))
64 ->withTitle($title)
65 ->withAction($ctrl->getLinkTargetByClass(["ilDashboardGUI", "ilPDNotesGUI"], "showPrivateNotes"))
66 ->withParent(StandardTopItemsProvider::getInstance()->getPersonalWorkspaceIdentification())
67 ->withPosition(70)
68 ->withSymbol($icon)
69 ->withNonAvailableReason($this->dic->ui()->factory()->legacy()->content($this->dic->language()->txt('component_not_active')))
70 ->withAvailableCallable(
71 static function () use ($dic): bool {
72 return !$dic->settings()->get("disable_notes");
73 }
74 );
75
76 return [
78 $notes,
79 ];
80 }
81}
language()
Get interface to the i18n service.
Definition: Container.php:95
settings()
Get the interface to the settings.
Definition: Container.php:135
ctrl()
Get the interface to the control structure.
Definition: Container.php:63
This describes the specific behavior of an ILIAS standard icon.
Definition: Standard.php:27
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if(!file_exists('../ilias.ini.php'))
$comments