ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
PDMainBarProvider.php
Go to the documentation of this file.
2
7
14{
15
19 public function getStaticTopItems() : array
20 {
21 return [];
22 }
23
24
28 public function getStaticSubItems() : array
29 {
32
33 $f = $this->dic->ui()->factory();
34
35 $title = $this->dic->language()->txt("mm_favorites");
36 $icon = $this->dic->ui()->factory()->symbol()->icon()->custom(\ilUtil::getImagePath("outlined/icon_fav.svg"), $title);
37
38 return [
39 $this->mainmenu->complex($this->if->identifier('mm_pd_sel_items'))
40 ->withSupportsAsynchronousLoading(true)
41 ->withTitle($title)
42 ->withSymbol($icon)
43 ->withContentWrapper(function () use ($f) {
44 $fav_list = new \ilFavouritesListGUI();
45
46 return $f->legacy($fav_list->render());
47 })
48 ->withParent(StandardTopItemsProvider::getInstance()->getPersonalWorkspaceIdentification())
49 ->withPosition(10)
50 ->withAvailableCallable(
51 function () use ($dic) {
52 // note: the setting disable_my_offers is used for
53 // presenting the favourites in the main section of the dashboard
54 // return $dic->settings()->get('disable_my_offers', 0) == 0;
55 return true;
56 }
57 )
58 ->withVisibilityCallable(
59 $access_helper->isUserLoggedIn($access_helper->isRepositoryReadable(
60 static function () use ($dic) : bool {
61 return true;
62 $pdItemsViewSettings = new ilPDSelectedItemsBlockViewSettings($dic->user());
63
64 return (bool) $pdItemsViewSettings->allViewsEnabled() || $pdItemsViewSettings->enabledSelectedItems();
65 }
66 ))
67 ),
68 ];
69 }
70}
An exception for terminatinating execution or to throw for unit testing.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
if(!file_exists(getcwd() . '/ilias.ini.php'))
registration confirmation script for ilias
Definition: confirmReg.php:12