ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ui_mainbar.php File Reference

Go to the source code of this file.

Functions

 ui_mainbar ()
 
 getUIMainbar ($f, $uri, $condensed=false)
 
 getUIContent ($f, $request)
 

Function Documentation

◆ getUIContent()

getUIContent (   $f,
  $request 
)

Definition at line 112 of file ui_mainbar.php.

References $_GET, $_SERVER, $c, $DIC, Vendor\Package\$f, _initIliasForPreview(), and getUIMainbar().

113 {
114  $params = $request->getQueryParams();
115  $cidx = -1;
116  if (array_key_exists('c', $params)) {
117  $cidx = $params['c'];
118  }
119 
120 
121  switch ($cidx) {
122  case 1:
123  $t = 'Tier des Jahres: Fischotter3';
124  $c = [
125  $f->legacy('<h1>Fischotter</h1><p>Der Fischotter (Lutra lutra) ist ein an das Wasserleben angepasster Marder, der zu den besten Schwimmern unter den Landraubtieren zählt.</p>')
126  ,$f->link()->standard("Quelle: Wikipedia", "https://de.wikipedia.org/wiki/Tier_des_Jahres")
127  ];
128  break;
129  case 2:
130  $t = 'Tier des Jahres: Maulwurf';
131  $c = [
132  $f->legacy('<h1>Maulwurf</h1><p>Der Europäische Maulwurf ist ein mittelgroßer Vertreter der Eurasischen Maulwürfe (Talpa). Er erreicht eine Kopf-Rumpf-Länge von 11,3 bis 15,9 cm, der Schwanz wird 2,5 bis 4,0 cm lang.</p>')
133  ,$f->link()->standard("Quelle: Wikipedia", "https://de.wikipedia.org/wiki/Tier_des_Jahres")
134  ];
135  break;
136  case 3:
137  $t = 'Tier des Jahres: Reh';
138  $c = [
139  $f->legacy('<h1>Reh</h1><p>Das Reh springt hoch,<br> das Reh springt weit.<br> Warum auch nicht? <br>Es hat ja Zeit.</p>')
140  ];
141  break;
142  case 4:
143  $t = 'Tier des Jahres: Bachflohkrebs';
144  $c = [
145  $f->legacy('<h1>Bachflohkrebs</h1><p>Der Bachflohkrebs (Gammarus fossarum) ist ein Flohkrebs aus der Familie der Gammaridae und ein typischer Bachbewohner. <br> Er reagiert als sogenanntes Zeigertier äußerst empfindlich auf Gewässerverschmutzungen.</p>')
146  ,$f->link()->standard("Quelle: Wikipedia", "https://de.wikipedia.org/wiki/Tier_des_Jahres")
147  ];
148  break;
149  case 5:
150  $t = 'Tier des Jahres: Wildkatze';
151  $c = [
152  $f->legacy('<h1>Wildkatze</h1><p>Die Europäische Wildkatze oder Waldkatze (Felis silvestris) ist eine Kleinkatze, die in Europa von der Iberischen Halbinsel bis Osteuropa (westliche Ukraine), in Italien, auf dem Balkan, in Anatolien, im Kaukasus und in den schottischen Highlands vorkommt.</p>')
153  ,$f->link()->standard("Quelle: Wikipedia", "https://de.wikipedia.org/wiki/Tier_des_Jahres")
154  ];
155  break;
156  case 6:
157  $t = 'Frühbarock';
158  $c = [
159  $f->legacy('<h1>Glühwürmchen</h1><p>Der Große Leuchtkäfer bzw. das Große Glühwürmchen oder Große Johannisglühwürmchen (Lampyris noctiluca) ist ein Käfer aus der Familie Leuchtkäfer (Lampyridae).</p>')
160  ,$f->link()->standard("Quelle: Wikipedia", "https://de.wikipedia.org/wiki/Tier_des_Jahres")
161  ];
162  break;
163 
164  case 7:
165  $t = 'Frühbarock';
166  $c = [
167  $f->legacy('<h1>Frühbarock</h1><p><b>etwa 1600 bis 1650</b><br>unter italienischer Dominanz, mit etwa Monteverdi, Gabrieli.</p>')
168  ,$f->link()->standard("Quelle: Wikipedia", "https://de.wikipedia.org/wiki/Tier_des_Jahres")
169  ];
170  break;
171  case 8:
172  $t = 'Hochbarock';
173  $c = [$f->legacy('<h1>Hochbarock</h1><p><b>etwa 1650 bis 1710</b><br>Das französische Musikleben des späten 17. Jahrhunderts wurde maßgeblich von Jean-Baptiste Lully (1632–1687) am Hofe Ludwigs XIV. geprägt.</p>')];
174  break;
175  case 9:
176  $t = 'Spätbarock';
177  $c = [$f->legacy('<h1>Spätbarock</h1><p><b>etwa 1710 bis 1750</b><br>Entwickelte sich im Hochbarock die Musik noch unabhängig in verschiedenen Regionen Europas, so zeichnete sich der Spätbarock durch eine grenzübergreifende Verbreitung der Stile aus. Im deutschen Raum trieb Georg Philipp Telemann (1681–1767) diese Entwicklung voran und wurde schließlich zur „Ikone“ unter den Tonkünstlern.</p>')];
178  break;
179 
180  default:
181  $t = 'Mainbar-Demo';
182  $c = [$f->legacy('Dies ist ein reduziertes Beispiel für die Mainbar des UI-Frameworks.')];
183  }
184 
185  return[$t, $c];
186 }
187 
188 
189 
190 if ($_GET['ui_mainbar'] == '1' ||
191  $_GET['ui_mainbar'] == '2'
192 ) {
193  chdir('../../../../../../');
194  require_once('src/UI/examples/Layout/Page/Standard/ui.php');
196 
197  //get resources
198  global $DIC;
199  $f = $DIC['ui.factory'];
200  $renderer = $DIC['ui.renderer'];
201  $request = $DIC->http()->request();
202 
203  $df = new \ILIAS\Data\Factory();
204  $uri = $df->uri(
205  $_SERVER['REQUEST_SCHEME'] .
206  '://' .
207  $_SERVER['SERVER_NAME'] .
208  ':' .
209  $_SERVER['SERVER_PORT'] .
210  $_SERVER['SCRIPT_NAME'] .
211  '?' .
212  $_SERVER['QUERY_STRING']
213  );
214 
215  if ($_GET['ui_mainbar'] == '1') {
216  $mainbar = getUIMainbar($f, $uri);
217  }
218  if ($_GET['ui_mainbar'] == '2') {
219  $mainbar = getUIMainbar($f, $uri, true);
220  }
221 
222  list($page_title, $content) = getUIContent($f, $request);
223 
224  $logo = $f->image()->responsive("templates/default/images/HeaderIcon.svg", "ILIAS");
225  $breadcrumbs = null;
226  $metabar = null;
227  $footer = null;
228  $short_title = 'DEMO';
229  $view_title = 'UI Mainbar';
230 
231  $page = $f->layout()->page()->standard(
232  $content,
233  $metabar,
234  $mainbar,
235  $breadcrumbs,
236  $logo,
237  $footer,
238  $page_title,
239  $short_title,
240  $view_title
241  )
242  ->withUIDemo(true);
243 
244  echo $renderer->render($page);
245 }
$c
Definition: cli.php:37
$_GET["client_id"]
getUIContent($f, $request)
Definition: ui_mainbar.php:112
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
global $DIC
Definition: goto.php:24
if($_GET['new_ui']=='1') if($_GET['replaced']=='1') _initIliasForPreview()
Below are helpers for the construction of demo-content.
Definition: ui.php:71
getUIMainbar($f, $uri, $condensed=false)
Definition: ui_mainbar.php:22
+ Here is the call graph for this function:

◆ getUIMainbar()

getUIMainbar (   $f,
  $uri,
  $condensed = false 
)

Definition at line 22 of file ui_mainbar.php.

References Vendor\Package\$f.

Referenced by getUIContent().

23 {
24  $symbol = $f->symbol()->icon()->standard('rcat', 'Fischotter', 'small');
25  $link010 = $f->link()->bulky($symbol, '2021 - Fischotter', $uri->withParameter('c', 1));
26  $symbol = $f->symbol()->icon()->standard('rcat', 'Maulwurf', 'small');
27  $link011 = $f->link()->bulky($symbol, '2020 - Maulwurf', $uri->withParameter('c', 2));
28  $symbol = $f->symbol()->icon()->standard('rcat', 'Reh', 'small');
29  $link012 = $f->link()->bulky($symbol, '2019 - Reh', $uri->withParameter('c', 3));
30 
31  $symbol = $f->symbol()->icon()->standard('rcat', 'Bachflohkrebs', 'small');
32  $link020 = $f->link()->bulky($symbol, '2021 - Bachflohkrebs', $uri->withParameter('c', 4));
33  $symbol = $f->symbol()->icon()->standard('rcat', 'Wildkatze', 'small');
34  $link021 = $f->link()->bulky($symbol, '2020 - Wildkatze', $uri->withParameter('c', 5));
35  $symbol = $f->symbol()->icon()->standard('rcat', 'Glühwürmchen', 'small');
36  $link022 = $f->link()->bulky($symbol, '2019 - Glühwürmchen', $uri->withParameter('c', 6));
37 
38  $link10 = $f->link()->bulky($symbol, 'Frühbarock', $uri->withParameter('c', 7));
39  $link11 = $f->link()->bulky($symbol, 'Hochbarock', $uri->withParameter('c', 8));
40  $link12 = $f->link()->bulky($symbol, 'Spätbarock', $uri->withParameter('c', 9));
41 
42  $symbol = $f->symbol()->icon()->standard('cat', 'Deutschland', 'small');
43  $slate01 = $f->maincontrols()->slate()->combined('Deutschland', $symbol, '')
44  ->withAdditionalEntry($link010)
45  ->withAdditionalEntry($link011)
46  ->withAdditionalEntry($link012);
47 
48  $contents = <<<EOT
49  <p>Leider gibt es im Takatuka Land kein Tier des Jahres.
50  <br />
51  <b>Aber:</b> Slates in der Main Bar können andere Inhalte als Links enthalten. </p>
52  <p>Zum Beispiel könnten sich hier Inhalte wie der Magazinbaum oder der
53  Mailbaum, komplexe Elemente wie das Notifikation Center, die Hilfe oder
54  auch dieser Text befinden.</p>
55  <p> Die Main Bar ist ganz bewusst nicht nur als 'Menü' gedacht sondern dient auch dazu,
56  komplexe Bedienelemente darzustellen.</p>
57 EOT;
58 
59  $symbol = $f->symbol()->icon()->standard('cat', 'Takatuka Land', 'small');
60  $slate02 = $f->maincontrols()->slate()->legacy('Takatuka Land', $symbol, $f->legacy($contents));
61 
62  $symbol = $f->symbol()->icon()->standard('cat', 'Schweiz', 'small');
63  $slate03 = $f->maincontrols()->slate()->combined('Schweiz', $symbol, '')
64  ->withAdditionalEntry($link020)
65  ->withAdditionalEntry($link021)
66  ->withAdditionalEntry($link022);
67 
68  $symbol = $f->symbol()->icon()->custom('./src/UI/examples/Layout/Page/Standard/layers.svg', '')->withSize('small');
69  $slate0 = $f->maincontrols()->slate()->combined('Tier des Jahres', $symbol, '')
70  ->withAdditionalEntry($slate01)
71  ->withAdditionalEntry($slate02)
72  ->withAdditionalEntry($slate03);
73 
74  $slate1 = $f->maincontrols()->slate()->combined('Barock', $symbol, '')
75  ->withAdditionalEntry($link10)
76  ->withAdditionalEntry($link11)
77  ->withAdditionalEntry($link12);
78 
79 
80  if (!$condensed) {
81  $mainbar = $f->mainControls()->mainbar()
82  ->withAdditionalEntry('slate0', $slate0)
83  ->withAdditionalEntry('slate1', $slate1);
84 
85 
86 
87  $tools_btn = $f->button()->bulky(
88  $f->symbol()->icon()->custom('./src/UI/examples/Layout/Page/Standard/grid.svg', ''),
89  'Tools',
90  '#'
91  );
92  $mainbar = $mainbar->withToolsButton($tools_btn);
93 
94  $symbol = $f->symbol()->icon()->custom('./src/UI/examples/Layout/Page/Standard/question.svg', '')->withSize('small');
95  $slate = $f->maincontrols()->slate()->legacy('Help', $symbol, $f->legacy('<h2>tool 1</h2><p>Some Text for Tool 1 entry</p>'));
96  $tools = ['tool1' => $slate];
97  foreach ($tools as $id => $entry) {
98  $mainbar = $mainbar->withAdditionalToolEntry($id, $entry);
99  }
100 
101  return $mainbar;
102  }
103 
104  $slate_base = $f->maincontrols()->slate()->combined('Menu', $symbol, '')
105  ->withAdditionalEntry($slate0)
106  ->withAdditionalEntry($slate1);
107  $mainbar = $f->mainControls()->mainbar()
108  ->withAdditionalEntry('slate0', $slate_base);
109  return $mainbar;
110 }
+ Here is the caller graph for this function:

◆ ui_mainbar()

ui_mainbar ( )

Definition at line 3 of file ui_mainbar.php.

References $DIC, Vendor\Package\$f, and $url.

4 {
5  global $DIC;
6  $f = $DIC['ui.factory'];
7  $df = new \ILIAS\Data\Factory();
8  $renderer = $DIC['ui.renderer'];
9  $request = $DIC->http()->request();
10 
11  $url = 'src/UI/examples/Layout/Page/Standard/ui_mainbar.php?ui_mainbar=1';
12  $mainbar = $f->button()->standard('Mainbar', $url);
13  $url2 = 'src/UI/examples/Layout/Page/Standard/ui_mainbar.php?ui_mainbar=2';
14  $mainbar2 = $f->button()->standard('Mainbar Combined', $url2);
15 
16  return $renderer->render([
17  $mainbar,
18  $mainbar2
19  ]);
20 }
global $DIC
Definition: goto.php:24
$url