ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilPDGlobalScreenProvider Class Reference

Class ilPDGlobalScreenProvider. More...

+ Inheritance diagram for ilPDGlobalScreenProvider:
+ Collaboration diagram for ilPDGlobalScreenProvider:

Public Member Functions

 __construct (\ILIAS\DI\Container $dic)
 
 getTopItem ()
 Some other components want to provide Items for the main menu which are located at the PD TopTitem by default. More...
 
 getStaticTopItems ()
 
 getStaticSubItems ()
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Scope\MainMenu\Provider\AbstractStaticMainMenuProvider
 __construct (Container $dic)
 
 getAllIdentifications ()
 
 provideTypeInformation ()
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 __construct (Container $dic)
 
 getFullyQualifiedClassName ()
 
 getProviderNameForPresentation ()
 

Protected Attributes

 $top_item
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Scope\MainMenu\Provider\AbstractStaticMainMenuProvider
 $dic
 
 $if
 
 $mainmenu
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 $dic
 

Additional Inherited Members

- Data Fields inherited from ILIAS\GlobalScreen\Scope\MainMenu\Provider\StaticMainMenuProvider
const PURPOSE_MAINBAR = 'mainmenu'
 
- Protected Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 globalScreen ()
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilPDGlobalScreenProvider::__construct ( \ILIAS\DI\Container  $dic)

Definition at line 20 of file class.ilPDGlobalScreenProvider.php.

21  {
22  parent::__construct($dic);
23  $this->top_item = $this->if->identifier('desktop');
24  }

Member Function Documentation

◆ getStaticSubItems()

ilPDGlobalScreenProvider::getStaticSubItems ( )

Implements ILIAS\GlobalScreen\Scope\MainMenu\Provider\StaticMainMenuProvider.

Definition at line 62 of file class.ilPDGlobalScreenProvider.php.

References ILIAS\GlobalScreen\Scope\MainMenu\Provider\AbstractStaticMainMenuProvider\$dic, ilPDSelectedItemsBlockViewSettings\allViewsEnabled(), getTopItem(), and if.

62  : array
63  {
64  $dic = $this->dic;
65 
66  $dic->language()->loadLanguageModule("pd");
67 
68  // overview
69  $entries[] = $this->mainmenu->link($this->if->identifier('mm_pd_sel_items'))
70  ->withTitle($this->dic->language()->txt("overview"))
71  ->withAction("ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToSelectedItems")
72  ->withParent($this->getTopItem())
73  ->withPosition(1)
74  ->withNonAvailableReason($this->dic->ui()->factory()->legacy("{$this->dic->language()->txt('component_not_active')}"))
75  ->withAvailableCallable(
76  function () use ($dic) {
77  return $dic->settings()->get('disable_my_offers', 0) == 0;
78  }
79  )
80  ->withVisibilityCallable(
81  function () use ($dic) {
82  $pdItemsViewSettings = new ilPDSelectedItemsBlockViewSettings($dic->user());
83 
84  return (bool) $pdItemsViewSettings->allViewsEnabled() || $pdItemsViewSettings->enabledSelectedItems();
85  }
86  );
87 
88  // my groups and courses, if both is available
89  $entries[] = $this->mainmenu->link($this->if->identifier('mm_pd_crs_grp'))
90  ->withTitle($this->dic->language()->txt("my_courses_groups"))
91  ->withAction("ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToMemberships")
92  ->withParent($this->getTopItem())
93  ->withPosition(2)
94  ->withNonAvailableReason($this->dic->ui()->factory()->legacy("{$this->dic->language()->txt('component_not_active')}"))
95  ->withAvailableCallable(
96  function () use ($dic) {
97  return $dic->settings()->get('disable_my_memberships', 0) == 0;
98  }
99  )
100  ->withVisibilityCallable(
101  function () use ($dic) {
102  $pdItemsViewSettings = new ilPDSelectedItemsBlockViewSettings($dic->user());
103 
104  return (bool) $pdItemsViewSettings->allViewsEnabled() || $pdItemsViewSettings->enabledMemberships();
105  }
106  );
107 
108  // achievements
109  $entries[] = $this->mainmenu->link($this->if->identifier('mm_pd_achiev'))
110  ->withTitle($this->dic->language()->txt("pd_achievements"))
111  ->withAction($dic->ctrl()->getLinkTargetByClass(["ilPersonalDesktopGUI", "ilAchievementsGUI"], ""))
112  ->withParent($this->getTopItem())
113  ->withPosition(7)
114  ->withAvailableCallable(
115  function () use ($dic) {
116  $achievements = new ilAchievements();
117 
118  return (bool) $achievements->isAnyActive();
119  }
120  );
121 
122  return $entries;
123  }
if(!file_exists(getcwd() . '/ilias.ini.php'))
registration confirmation script for ilias
Definition: confirmReg.php:12
Class ilPDSelectedItemsBlockViewSettings.
Maybe a separate service in the future.
getTopItem()
Some other components want to provide Items for the main menu which are located at the PD TopTitem by...
+ Here is the call graph for this function:

◆ getStaticTopItems()

ilPDGlobalScreenProvider::getStaticTopItems ( )

Implements ILIAS\GlobalScreen\Scope\MainMenu\Provider\StaticMainMenuProvider.

Definition at line 43 of file class.ilPDGlobalScreenProvider.php.

References ILIAS\GlobalScreen\Scope\MainMenu\Provider\AbstractStaticMainMenuProvider\$dic, and getTopItem().

43  : array
44  {
45  $dic = $this->dic;
46 
47  // Personal Desktop TopParentItem
48  return [$this->mainmenu->topParentItem($this->getTopItem())
49  ->withTitle($this->dic->language()->txt("personal_desktop"))
50  ->withPosition(1)
51  ->withVisibilityCallable(
52  function () use ($dic) {
53  return (bool) ($dic->user()->getId() != ANONYMOUS_USER_ID);
54  }
55  )];
56  }
getTopItem()
Some other components want to provide Items for the main menu which are located at the PD TopTitem by...
+ Here is the call graph for this function:

◆ getTopItem()

ilPDGlobalScreenProvider::getTopItem ( )

Some other components want to provide Items for the main menu which are located at the PD TopTitem by default.

Therefore we have to provide our TopTitem Identification for others

Returns
IdentificationInterface

Definition at line 34 of file class.ilPDGlobalScreenProvider.php.

References $top_item.

Referenced by getStaticSubItems(), and getStaticTopItems().

+ Here is the caller graph for this function:

Field Documentation

◆ $top_item

ilPDGlobalScreenProvider::$top_item
protected

Definition at line 17 of file class.ilPDGlobalScreenProvider.php.

Referenced by getTopItem().


The documentation for this class was generated from the following file: