ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
mainbar.php
Go to the documentation of this file.
1<?php
2function mainbar()
3{
4 global $DIC;
5 $f = $DIC->ui()->factory();
6 $renderer = $DIC->ui()->renderer();
7
8 $mainbar = buildMainbar($f, $renderer);
9 return $renderer->render($mainbar);
10}
11
12function buildMainbar($f, $r)
13{
14 $tools_btn = $f->button()->bulky(
15 $f->symbol()->icon()->custom('./src/UI/examples/Layout/Page/Standard/grid.svg', ''),
16 'Tools',
17 '#'
18 );
19 $more_btn = $f->button()->bulky(
20 $f->symbol()->icon()->standard('', ''),
21 'more',
22 '#'
23 );
24
25 $mainbar = $f->mainControls()->mainbar()
26 ->withToolsButton($tools_btn)
27 ->withMoreButton($more_btn);
28
29 $entries = [];
30 $entries['repository'] = getDemoEntryRepository($f);
31 $entries['pws'] = getDemoEntryPersonalWorkspace($f);
32 $entries['achievements'] = getDemoEntryAchievements($f);
33 $entries['communication'] = getDemoEntryCommunication($f);
34 $entries['organisation'] = getDemoEntryOrganisation($f);
35 $entries['administration'] = getDemoEntryAdministration($f);
36
37 foreach ($entries as $id => $entry) {
38 $mainbar = $mainbar->withAdditionalEntry($id, $entry);
39 }
40 $tools = getDemoEntryTools($f);
41 foreach ($tools as $id => $entry) {
42 $mainbar = $mainbar->withAdditionalToolEntry($id, $entry);
43 }
44
45 return $mainbar;
46}
47
49{
50 $symbol = $f->symbol()->icon()->custom('./src/UI/examples/Layout/Page/Standard/layers.svg', '')->withSize('small');
51 $slate = $f->maincontrols()->slate()->combined('Repository', $symbol, '');
52 return $slate;
53}
54
56{
57 $symbol = $f->symbol()->icon()->custom('./src/UI/examples/Layout/Page/Standard/user.svg', '')->withSize('small');
58 $slate = $f->maincontrols()->slate()->combined('Personal Workspace', $symbol, '');
59 return $slate;
60}
61
63{
64 $symbol = $f->symbol()->icon()->custom('./src/UI/examples/Layout/Page/Standard/achievements.svg', '')->withSize('small');
65 $slate = $f->maincontrols()->slate()->legacy('Achievements', $symbol, $f->legacy('content: Achievements'));
66 return $slate;
67}
68
70{
71 $symbol = $f->symbol()->icon()->custom('./src/UI/examples/Layout/Page/Standard/communication.svg', '')->withSize('small');
72 $slate = $f->maincontrols()->slate()->legacy('Communication', $symbol, $f->legacy('content: Communication'));
73 return $slate;
74}
75
77{
78 $symbol = $f->symbol()->icon()->custom('./src/UI/examples/Layout/Page/Standard/organisation.svg', '')->withSize('small');
79 $slate = $f->maincontrols()->slate()->legacy('Organisation', $symbol, $f->legacy('content: Organisation'));
80 return $slate;
81}
82
84{
85 $symbol = $f->symbol()->icon()->custom('./src/UI/examples/Layout/Page/Standard/administration.svg', '')->withSize('small');
86 $slate = $f->maincontrols()->slate()->legacy('Administration', $symbol, $f->legacy('content: Administration'));
87 return $slate;
88}
89
91{
92 $symbol = $f->symbol()->icon()->custom('./src/UI/examples/Layout/Page/Standard/question.svg', '')->withSize('small');
93 $slate = $f->maincontrols()->slate()->legacy('Help', $symbol, $f->legacy('<h2>tool 1</h2><p>Some Text for Tool 1 entry</p>'));
94 $tools = ['tool1' => $slate];
95 return $tools;
96}
An exception for terminatinating execution or to throw for unit testing.
getDemoEntryAdministration($f)
Definition: mainbar.php:83
getDemoEntryRepository($f)
Definition: mainbar.php:48
getDemoEntryOrganisation($f)
Definition: mainbar.php:76
getDemoEntryPersonalWorkspace($f)
Definition: mainbar.php:55
buildMainbar($f, $r)
Definition: mainbar.php:12
mainbar()
Definition: mainbar.php:2
getDemoEntryCommunication($f)
Definition: mainbar.php:69
getDemoEntryAchievements($f)
Definition: mainbar.php:62
getDemoEntryTools($f)
Definition: mainbar.php:90
$DIC
Definition: xapitoken.php:46