-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathheader.php
715 lines (604 loc) · 36.5 KB
/
header.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
<?php
/**
* Header component
*
* This file is part of the OSIRIS package.
* Copyright (c) 2024 Julia Koblitz, OSIRIS Solutions GmbH
*
* @package OSIRIS
* @since 1.0.0
*
* @copyright Copyright (c) 2024 Julia Koblitz, OSIRIS Solutions GmbH
* @author Julia Koblitz <[email protected]>
* @license MIT
*/
include_once BASEPATH . "/php/init.php";
$breadcrumb = $breadcrumb ?? [];
$pagetitle = array('OSIRIS');
foreach ($breadcrumb as $crumb) {
array_push($pagetitle, $crumb['name']);
}
$pagetitle = implode(' | ', array_reverse($pagetitle));
$uri = $_SERVER['REQUEST_URI'];
// $uri = str_replace(ROOTPATH."/", '', $uri, 1);
$uri = substr_replace($uri, '', 0, strlen(ROOTPATH . "/"));
$lasturl = explode("/", $uri);
// dump($lasturl);
$page = $page ?? $lasturl[0]; //end($lasturl);
$pageactive = function ($p) use ($page) {
if ($page == $p) return "active";
$uri = explode('?', $_SERVER['REQUEST_URI'], 2)[0];
if ((ROOTPATH . "/" . $p) == $uri) return 'active';
return "";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Meta tags -->
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
<meta name="description" content="OSIRIS ist ein modernes Forschungsinformationssystem, das besonderen Schwerpunkt auf Open Source und Nutzerfreundlichkeit legt." />
<!-- Favicon and title -->
<link rel="icon" href="img/favicon.png">
<title><?= $pagetitle ?? 'OSIRIS-App' ?></title>
<link rel="manifest" href="<?= ROOTPATH ?>/manifest.json">
<!-- Open Graph / Facebook -->
<meta property="og:title" content="OSIRIS - the open, smart and intuitive research information system" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://osiris-app.de" />
<meta property="og:description" content="OSIRIS ist ein modernes Forschungsinformationssystem, das besonderen Schwerpunkt auf Open Source und Nutzerfreundlichkeit legt.." />
<meta property="og:image" content="<?= ROOTPATH ?>/img/apple-touch-icon.png" />
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://osiris-app.de">
<meta property="twitter:title" content="OSIRIS - the open, smart and intuitive research information system">
<meta property="twitter:description" content="OSIRIS ist ein modernes Forschungsinformationssystem, das besonderen Schwerpunkt auf Open Source und Nutzerfreundlichkeit legt..">
<meta property="twitter:image" content="<?= ROOTPATH ?>/img/apple-touch-icon.png">
<!-- Apple -->
<link rel="apple-touch-icon" sizes="180x180" href="<?= ROOTPATH ?>/img/apple-touch-icon.png">
<link rel="mask-icon" href="<?= ROOTPATH ?>/img/mask-icon.svg" color="#dd590e">
<!-- Favicon and title -->
<link rel="icon" href="<?= ROOTPATH ?>/img/favicon.png">
<title><?= $pagetitle ?? 'OSIRIS' ?></title>
<!-- Icon font -->
<link href="<?= ROOTPATH ?>/css/phosphoricons/regular/style.css?v=<?= CSS_JS_VERSION ?>" rel="stylesheet" />
<link href="<?= ROOTPATH ?>/css/phosphoricons/fill/style.css?v=<?= CSS_JS_VERSION ?>" rel="stylesheet" />
<!-- for open access icons -->
<link href="<?= ROOTPATH ?>/css/fontello/css/osiris.css?v=<?= CSS_JS_VERSION ?>" rel="stylesheet" />
<link rel="stylesheet" href="<?= ROOTPATH ?>/css/main.css?<?= filemtime(BASEPATH . '/css/main.css') ?>">
<?php
echo $Settings->generateStyleSheet();
?>
<style>
:root {
--affiliation: "<?= $Settings->get('affiliation') ?>";
}
</style>
<script>
const ROOTPATH = "<?= ROOTPATH ?>";
const AFFILIATION = "<?= $Settings->get('affiliation') ?>";
</script>
<script src="<?= ROOTPATH ?>/js/jquery-3.3.1.min.js?v=<?= CSS_JS_VERSION ?>"></script>
<script src="<?= ROOTPATH ?>/js/datatables/jquery.dataTables.min.js?v=<?= CSS_JS_VERSION ?>"></script>
<script src="<?= ROOTPATH ?>/js/datatables/dataTables.responsive.min.js?v=<?= CSS_JS_VERSION ?>"></script>
<script>
$.extend($.fn.DataTable.ext.classes, {
sPaging: "pagination mt-10 ",
sPageFirst: "direction ",
sPageLast: "direction ",
sPagePrevious: "direction ",
sPageNext: "direction ",
sPageButtonActive: "active ",
sFilterInput: "form-control small d-inline w-auto ml-10 ",
sLengthSelect: "form-control small d-inline w-auto",
sInfo: "float-right text-muted",
sLength: "float-right"
});
</script>
<script src="<?= ROOTPATH ?>/js/osiris.js?<?= filemtime(BASEPATH . '/js/osiris.js') ?>"></script>
<script src="<?= ROOTPATH ?>/js/script.js?<?= filemtime(BASEPATH . '/js/script.js') ?>"></script>
<?php if (isset($additionalHead)) {
echo $additionalHead;
} ?>
</head>
<body>
<div class="loader">
<span></span>
</div>
<!-- Page wrapper start -->
<div class="page-wrapper
<?= $_COOKIE['D3-accessibility-contrast'] ?? '' ?>
<?= $_COOKIE['D3-accessibility-transitions'] ?? '' ?>
<?= $_COOKIE['D3-accessibility-dyslexia'] ?? '' ?>
">
<div class="sticky-alerts"></div>
<div class="modal" id="the-modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<a data-dismiss="modal" class="btn float-right" role="button" aria-label="Close">
<span aria-hidden="true">×</span>
</a>
<h5 class="modal-title" id="modal-title"></h5>
<div id="modal-content"></div>
</div>
</div>
</div>
<!-- Sidebar overlay -->
<div class="sidebar-overlay" onclick="osirisJS.toggleSidebar()"></div>
<!-- Navbar start -->
<div class="navbar navbar-top">
<a href="<?= ROOTPATH ?>/" class="navbar-brand ml-20">
<img src="<?= ROOTPATH ?>/img/logo.svg" alt="OSIRIS">
<?php if (!LIVE) { ?>
<span class=" position-absolute bottom-0 left-0 secondary" style="font-size: 1rem;z-index:1">TESTSYSTEM</span>
<?php } ?>
</a>
<a href="<?= $Settings->get('affiliation_details')['link'] ?? '#' ?>" class="navbar-brand ml-auto" target="_blank">
<?= $Settings->printLogo("") ?>
</a>
</div>
<nav class="navbar navbar-bottom">
<!-- Button to toggle sidebar -->
<button class="btn btn-action active" type="button" onclick="osirisJS.toggleSidebar(this);" aria-label="Toggle sidebar"></button>
<ul class="navbar-nav">
<?php if (false) { ?>
<!-- set to true during maintenance -->
<div class="alert danger">
<b><?= lang('System maintenance', 'Wartungsarbeiten') ?>.</b>
<?= lang('Please do not add, edit or remove data. Changes might be overwritten.', 'Bitte keine Daten hinzufügen, bearbeiten oder löschen. Änderungen werden evtl. überschrieben.') ?>
</div>
<?php } else { ?>
<nav aria-label="breadcrumbs">
<ul class="breadcrumb">
<?php
$breadcrumb = $breadcrumb ?? [];
if (!empty($breadcrumb)) {
echo '<li class=""><a href="' . ROOTPATH . '/"><i class="ph ph-house" aria-label="Home"></i></a></li>';
foreach ($breadcrumb as $crumb) {
if (!isset($crumb['path'])) {
echo '<li class="active" aria-current="page"><a href="#">' . $crumb['name'] . '</a></li>';
} else {
echo '<li class=""><a href="' . ROOTPATH . $crumb['path'] . '">' . $crumb['name'] . '</a></li>';
}
}
}
?>
</ul>
</nav>
<?php } ?>
</ul>
<!-- Accessibility menu -->
<div class="dropdown d-none d-md-block">
<button class="btn text-primary border-primary square mr-5" data-toggle="dropdown" type="button" id="accessibility-menu" aria-haspopup="true" aria-expanded="false">
<i class="ph ph-person-arms-spread ph-person-simple-circle"></i>
<span class="sr-only"><?= lang('Accessibility Options', 'Accessibility-Optionen') ?></span>
</button>
<div class="dropdown-menu dropdown-menu-center w-300" aria-labelledby="accessibility-menu">
<h6 class="header text-primary">Accessibility</h6>
<form action="<?= ROOTPATH ?>/set-preferences" method="get" class="content">
<input type="hidden" name="accessibility[check]">
<input type="hidden" name="redirect" value="<?= $_SERVER['REQUEST_URI'] ?>">
<div class="form-group">
<div class="custom-checkbox">
<input type="checkbox" id="set-contrast" name="accessibility[contrast]" value="high-contrast" <?= !empty($_COOKIE['D3-accessibility-contrast'] ?? '') ? 'checked' : '' ?>>
<label for="set-contrast"><?= lang('High contrast', 'Erhöhter Kontrast') ?></label><br>
<small class="text-muted">
<?= lang('Enhance the contrast of the web page for better readability.', 'Erhöht den Kontrast für bessere Lesbarkeit.') ?>
</small>
</div>
</div>
<div class="form-group">
<div class="custom-checkbox">
<input type="checkbox" id="set-transitions" name="accessibility[transitions]" value="without-transitions" <?= !empty($_COOKIE['D3-accessibility-transitions'] ?? '') ? 'checked' : '' ?>>
<label for="set-transitions"><?= lang('Reduce motion', 'Verringerte Bewegung') ?></label><br>
<small class="text-muted">
<?= lang('Reduce motion and animations on the page.', 'Verringert Animationen und Bewegungen auf der Seite.') ?>
</small>
</div>
</div>
<div class="form-group">
<div class="custom-checkbox">
<input type="checkbox" id="set-dyslexia" name="accessibility[dyslexia]" value="dyslexia" <?= !empty($_COOKIE['D3-accessibility-dyslexia'] ?? '') ? 'checked' : '' ?>>
<label for="set-dyslexia"><?= lang('Dyslexia mode', 'Dyslexie-Modus') ?></label><br>
<small class="text-muted">
<?= lang('Use a special font to increase readability for users with dyslexia.', 'OSIRIS nutzt eine spezielle Schriftart, die von manchen Menschen mit Dyslexie besser gelesen werden kann.') ?>
</small>
</div>
</div>
<button class="btn primary">Apply</button>
</form>
</div>
</div>
<form action="<?= ROOTPATH ?>/set-preferences" method="get">
<input type="hidden" name="language" value="<?= lang('de', 'en') ?>">
<input type="hidden" name="redirect" value="<?= $_SERVER['REQUEST_URI'] ?>">
<button type="submit" class="btn text-primary border-primary mr-5">
<i class="ph ph-translate" aria-hidden="true"></i>
<span class="sr-only"><?= lang('Change language', 'Sprache ändern') ?></span>
<?= lang('DE', 'EN') ?>
</button>
</form>
<?php if (!isset($_SESSION['loggedin']) || $_SESSION['loggedin'] !== true || !isset($_SESSION['username'])) { ?>
<a href="<?= ROOTPATH ?>/" class="btn text-primary border-primary mr-5">
<i class="ph ph-sign-in" aria-hidden="true"></i>
<?= lang('Log in', 'Anmelden') ?>
</a>
<?php } else {
$realusername = $_SESSION['realuser'] ?? $_SESSION['username'];
$maintain = $osiris->persons->find(['maintenance' => $realusername, 'username' => ['$exists'=>true]], ['projection' => ['displayname' => 1, 'username' => 1]])->toArray();
if (!empty($maintain)) { ?>
<form action="" class="nav-search" id="navbar-search">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text border-primary text-primary"><i class="ph ph-user"></i></span>
</div>
<select name="OSIRIS-SELECT-MAINTENANCE-USER" id="osiris-select-maintenance-user" class="form-control border-primary bg-white" onchange="$(this).closest('form').submit()">
<option value="" disabled>
<?= lang('Switch user', 'Benutzer wechseln') ?>
</option>
<option value="<?= $realusername ?>"><?= $DB->getNameFromId($realusername) ?></option>
<?php
foreach ($maintain as $d) { ?>
<option value="<?= $d['username'] ?>" <?= $d['username'] == $_SESSION['username'] ? 'selected' : '' ?>><?= $DB->getNameFromId($d['username']) ?></option>
<?php } ?>
</select>
</div>
</form>
<?php } else { ?>
<form id="navbar-search" action="<?= ROOTPATH ?>/activities" method="get" class="nav-search">
<div class="input-group">
<input type="text" name="q" class="form-control border-primary" autocomplete="off" placeholder="<?= lang('Search in activities', 'Suche in Aktivitäten') ?>">
<div class="input-group-append">
<button class="btn primary filled"><i class="ph ph-magnifying-glass"></i></button>
</div>
</div>
</form>
<?php }
} ?>
</nav>
<!-- Sidebar start -->
<div class="sidebar">
<div class="sidebar-menu">
<!-- Sidebar links and titles -->
<?php if (!isset($_SESSION['loggedin']) || $_SESSION['loggedin'] === false) { ?>
<a href="<?= ROOTPATH ?>/" class="cta with-icon <?= $pageactive('add-activity') ?>">
<i class="ph ph-sign-in mr-10" aria-hidden="true"></i>
<?= lang('Log in', 'Anmelden') ?>
</a>
<?php if (strtoupper(USER_MANAGEMENT) === 'AUTH') { ?>
<a href="<?= ROOTPATH ?>/auth/new-user" class="with-icon <?= $pageactive('auth/new-user') ?>">
<i class="ph ph-user-plus" aria-hidden="true"></i>
<?= lang('Register', 'Registrieren') ?>
</a>
<?php } ?>
<?php } else { ?>
<!-- search bar -->
<div class="content" style="margin-top:-4rem">
<input type="text" class="form-control small border-primary" autocomplete="off" placeholder="<?= lang('Search', 'Suche') ?>" oninput="searchNavBar(this.value)">
</div>
<a href="<?= ROOTPATH ?>/add-activity" class="cta with-icon <?= $pageactive('add-activity') ?>">
<i class="ph ph-plus-circle mr-10" aria-hidden="true"></i>
<?= lang('Add activity', 'Aktivität hinzuf.') ?>
</a>
<script>
function searchNavBar(value) {
var links = $('.sidebar a');
links.each(function() {
if ($(this).text().toLowerCase().includes(value.toLowerCase())) {
$(this).css('display', 'flex');
} else {
$(this).css('display', 'none');
}
});
// hide empty header
var titles = $('.sidebar .title');
titles.each(function() {
var nav = $(this).next();
var visible = false;
nav.children().each(function() {
if ($(this).css('display') == 'flex') {
visible = true;
}
});
if (visible) {
$(this).css('display', 'block');
} else {
$(this).css('display', 'none');
}
});
}
</script>
<div class="title collapse open" onclick="toggleSidebar(this);" id="sidebar-user">
<?= lang('My area', 'Mein Bereich') ?>
</div>
<nav>
<a href="<?= ROOTPATH ?>/profile/<?= $_SESSION['username'] ?>" class="with-icon <?= $pageactive('profile/' . $_SESSION['username']) ?>">
<i class="ph ph-user" aria-hidden="true"></i>
<?= $USER["displayname"] ?? 'User' ?>
</a>
<?php if ($Settings->hasPermission('scientist')) { ?>
<a href="<?= ROOTPATH ?>/my-year" class="with-icon <?= $pageactive('my-year') ?>">
<i class="ph ph-calendar" aria-hidden="true"></i>
<?= lang('My year', 'Mein Jahr') ?>
</a>
<a href="<?= ROOTPATH ?>/calendar" class="with-icon <?= $pageactive('calendar') ?>">
<i class="ph ph-calendar-dots" aria-hidden="true"></i>
<?= lang('Calendar', 'Kalender') ?>
</a>
<a href="<?= ROOTPATH ?>/my-activities" class="with-icon <?= $pageactive('my-activities') ?>">
<i class="ph ph-folder-user" aria-hidden="true"></i>
<?= lang('My activities', 'Meine Aktivitäten') ?>
</a>
<?php } ?>
<a href="<?= ROOTPATH ?>/user/logout" class=" with-icon" style="--primary-color:var(--danger-color);--primary-color-20:var(--danger-color-20);">
<i class="ph ph-sign-out" aria-hidden="true"></i>
Logout
</a>
</nav>
<div class="title collapse open" onclick="toggleSidebar(this);" id="sidebar-activities">
<?= lang('Data', 'Daten') ?>
</div>
<nav>
<style>
.sidebar-menu>a.inline-btn,
.sidebar-menu nav>a.inline-btn {
position: absolute;
right: 2rem;
margin: .5rem;
background: white;
padding: .5rem;
width: 3rem;
height: 3rem;
font-size: 1.4rem;
border-radius: var(--border-radius);
}
.sidebar-menu>a.inline-btn:not(.active),
.sidebar-menu nav>a.inline-btn:not(.active) {
display: none;
}
.sidebar-menu:hover>a.inline-btn:not(.active),
.sidebar-menu:hover nav>a.inline-btn:not(.active) {
display: block;
}
</style>
<a href="<?= ROOTPATH ?>/activities/search" class="inline-btn <?= $pageactive('activities') ?>" title="<?=lang('Advanced Search', 'Erweiterte Suche')?>">
<i class="ph ph-magnifying-glass-plus"></i>
</a>
<a href="<?= ROOTPATH ?>/activities" class="with-icon <?= $pageactive('activities') ?>">
<i class="ph ph-folders" aria-hidden="true"></i>
<?= lang('All activities', 'Alle Aktivitäten') ?>
</a>
<?php if ($Settings->featureEnabled('projects')) { ?>
<a href="<?= ROOTPATH ?>/projects/search" class="inline-btn mt-10 <?= $pageactive('projects') ?>" title="<?=lang('Advanced Search', 'Erweiterte Suche')?>">
<i class="ph ph-magnifying-glass-plus"></i>
</a>
<a href="<?= ROOTPATH ?>/projects" class="with-icon <?= $pageactive('projects') ?>">
<i class="ph ph-tree-structure" aria-hidden="true"></i>
<?= lang('Projects', 'Projekte') ?>
</a>
<?php if ($Settings->featureEnabled('nagoya') && $Settings->hasPermission('nagoya.view')) { ?>
<a href="<?= ROOTPATH ?>/nagoya" class="with-icon <?= $pageactive('nagoya') ?>">
<i class="ph ph-scales" aria-hidden="true"></i>
<?= lang('Nagoya Protocol', 'Nagoya-Protokoll') ?>
</a>
<?php } ?>
<?php } ?>
<a href="<?= ROOTPATH ?>/journal" class="with-icon <?= $pageactive('journal') ?>">
<i class="ph ph-stack" aria-hidden="true"></i>
<?= lang('Journals', 'Journale') ?>
</a>
<a href="<?= ROOTPATH ?>/conferences" class="with-icon <?= $pageactive('conferences') ?>">
<i class="ph ph-presentation-chart" aria-hidden="true"></i>
<?= lang('Events') ?>
</a>
<a href="<?= ROOTPATH ?>/teaching" class="with-icon <?= $pageactive('teaching') ?>">
<i class="ph ph-chalkboard-simple" aria-hidden="true"></i>
<?= lang('Teaching modules', 'Lehrmodule') ?>
</a>
<?php if ($Settings->featureEnabled('topics')) { ?>
<a href="<?= ROOTPATH ?>/topics" class="with-icon <?= $pageactive('topics') ?>">
<i class="ph ph-puzzle-piece" aria-hidden="true"></i>
<?= $Settings->topicLabel() ?>
</a>
<?php } ?>
<!-- <a href="<?= ROOTPATH ?>/tags" class="with-icon <?= $pageactive('tags') ?>">
<i class="ph ph-circles-three-plus" aria-hidden="true"></i>
<?= lang('Tags', 'Schlagwörter') ?>
</a> -->
<?php if ($Settings->featureEnabled('concepts')) { ?>
<a href="<?= ROOTPATH ?>/concepts" class="with-icon <?= $pageactive('concepts') ?>">
<i class="ph ph-lightbulb" aria-hidden="true"></i>
<?= lang('Concepts', 'Konzepte') ?>
</a>
<?php } ?>
</nav>
<div class="title collapse open" onclick="toggleSidebar(this);" id="sidebar-users">
<?= lang('Users', 'Personen') ?>
</div>
<nav>
<?php
$active = $pageactive('user/browse');
if (empty($active) && !str_contains($uri, "profile/" . $_SESSION['username'])) {
$active = $pageactive('profile');
}
?>
<a href="<?= ROOTPATH ?>/user/browse" class="with-icon <?= $active ?>">
<i class="ph ph-users" aria-hidden="true"></i>
<?= lang('Users', 'Personen') ?>
</a>
<a href="<?= ROOTPATH ?>/groups" class="with-icon <?= $pageactive('groups') ?>">
<i class="ph ph-users-three" aria-hidden="true"></i>
<?= lang('Organisational Units', 'Einheiten') ?>
</a>
<!-- <a href="<?= ROOTPATH ?>/expertise" class="with-icon <?= $pageactive('expertise') ?>">
<i class="ph ph-barbell" aria-hidden="true"></i>
<?= lang('Expertise search', 'Expertise-Suche') ?>
</a> -->
<?php if ($Settings->featureEnabled('guests')) { ?>
<a href="<?= ROOTPATH ?>/guests" class="with-icon <?= $pageactive('guests') ?>">
<i class="ph ph-user-switch" aria-hidden="true"></i>
<?= lang('Guests', 'Gäste') ?>
</a>
<?php } ?>
</nav>
<div class="title collapse open" onclick="toggleSidebar(this);" id="sidebar-tools">
<?= lang('Visualization', 'Visualisierung') ?>
</div>
<nav>
<!-- <a href="<?= ROOTPATH ?>/activities/search" class="with-icon <?= $pageactive('activities/search') ?>">
<i class="ph ph-magnifying-glass-plus" aria-hidden="true"></i>
<?= lang('Advanced search', 'Erweiterte Suche') ?>
</a> -->
<a href="<?= ROOTPATH ?>/dashboard" class="with-icon <?= $pageactive('dashboard') ?>">
<i class="ph ph-chart-line" aria-hidden="true"></i>
<?= lang('Dashboard') ?>
</a>
<a href="<?= ROOTPATH ?>/visualize" class="with-icon <?= $pageactive('visualize') ?>">
<i class="ph ph-graph" aria-hidden="true"></i>
<?= lang('Visualizations', 'Visualisierung') ?>
</a>
<a href="<?= ROOTPATH ?>/pivot" class="with-icon <?= $pageactive('pivot') ?>">
<i class="ph ph-table" aria-hidden="true"></i>
<?= lang('Pivot table', 'Pivot-Tabelle') ?>
</a>
</nav>
<div class="title collapse open" onclick="toggleSidebar(this);" id="sidebar-export">
<?= lang('Export & Import') ?>
</div>
<nav>
<a href="<?= ROOTPATH ?>/download" class="with-icon <?= $pageactive('download') ?>">
<i class="ph ph-download" aria-hidden="true"></i>
Export <?= lang('Activities', 'Aktivitäten') ?>
</a>
<a href="<?= ROOTPATH ?>/cart" class="with-icon <?= $pageactive('cart') ?>">
<i class="ph ph-shopping-cart" aria-hidden="true"></i>
<?= lang('Cart', 'Einkaufswagen') ?>
<?php
$cart = readCart();
if (!empty($cart)) { ?>
<span class="badge secondary badge-pill ml-10" id="cart-counter">
<?= count($cart) ?>
</span>
<?php } else { ?>
<span class="badge secondary badge-pill ml-10 hidden" id="cart-counter">
0
</span>
<?php } ?>
</a>
<a href="<?= ROOTPATH ?>/import" class="with-icon <?= $pageactive('import') ?>">
<i class="ph ph-upload" aria-hidden="true"></i>
<?= lang('Import') ?>
</a>
<?php if ($Settings->hasPermission('report.queue')) { ?>
<?php
$n_queue = $osiris->queue->count(['declined' => ['$ne' => true]]);
?>
<a href="<?= ROOTPATH ?>/queue/editor" class="sidebar-link with-icon sidebar-link-osiris <?= $pageactive('queue/editor') ?>">
<i class="ph ph-queue" aria-hidden="true"></i>
<?= lang('Queue', 'Warteschlange') ?>
<span class="badge secondary badge-pill ml-10" id="cart-counter">
<?= $n_queue ?>
</span>
</a>
<?php } ?>
<?php if ($Settings->hasPermission('report.generate')) { ?>
<a href="<?= ROOTPATH ?>/reports" class="with-icon <?= $pageactive('reports') ?>">
<i class="ph ph-printer" aria-hidden="true"></i>
<?= lang('Reports', 'Berichte') ?>
</a>
<?php if ($Settings->featureEnabled('ida')) { ?>
<a href="<?= ROOTPATH ?>/ida/dashboard" class="with-icon <?= $pageactive('ida') ?>">
<i class="ph ph-clipboard-text" aria-hidden="true"></i>
<?= lang('IDA-Integration') ?>
</a>
<?php } ?>
<?php } ?>
</nav>
<?php } ?>
<?php if ($Settings->hasPermission('admin.see') || $Settings->hasPermission('report.templates') || $Settings->hasPermission('user.synchronize')) { ?>
<div class="title collapse open" onclick="toggleSidebar(this);" id="sidebar-admin">
ADMIN
</div>
<nav>
<?php if ($Settings->hasPermission('admin.see')) { ?>
<a href="<?= ROOTPATH ?>/admin/general" class="with-icon <?= $pageactive('admin/general') ?>">
<i class="ph ph-gear" aria-hidden="true"></i>
<?= lang('General settings') ?>
</a>
<a href="<?= ROOTPATH ?>/admin/roles" class="with-icon <?= $pageactive('admin/roles') ?>">
<i class="ph ph-shield-check" aria-hidden="true"></i>
<?= lang('Roles & Rights', 'Rollen & Rechte') ?>
</a>
<a href="<?= ROOTPATH ?>/admin/fields" class="with-icon <?= $pageactive('admin/fields') ?>">
<i class="ph ph-textbox" aria-hidden="true"></i>
<?= lang('Custom fields') ?>
</a>
<a href="<?= ROOTPATH ?>/admin/categories" class="with-icon <?= $pageactive('admin/categories') ?>">
<i class="ph ph-bookmarks" aria-hidden="true"></i>
<?= lang('Activities', 'Aktivitäten') ?>
</a>
<a href="<?= ROOTPATH ?>/admin/features" class="with-icon <?= $pageactive('admin/features') ?>">
<i class="ph ph-wrench" aria-hidden="true"></i>
<?= lang('Features', 'Funktionen') ?>
</a>
<?php } ?>
<?php if ($Settings->hasPermission('report.templates')) { ?>
<a href="<?= ROOTPATH ?>/admin/reports" class="with-icon <?= $pageactive('admin/reports') ?>">
<i class="ph ph-clipboard-text"></i>
<?= lang('Report templates', 'Berichte-Vorlagen') ?>
</a>
<?php } ?>
<?php if ($Settings->hasPermission('user.synchronize')) { ?>
<a href="<?= ROOTPATH ?>/admin/users" class="with-icon <?= $pageactive('admin/users') ?>">
<i class="ph ph-users"></i>
<?= lang('Users', 'Nutzer') ?>
</a>
<?php } ?>
</nav>
<?php } ?>
</div>
</div>
<script>
function toggleSidebar(el) {
el = $(el)
let id = el.attr('id')
let hide = el.hasClass('open')
el.next().slideToggle();
el.toggleClass('open');
window.sessionStorage.setItem(id, hide);
}
$(function() {
$('.title.collapse').each(function(n, el) {
var hide = window.sessionStorage.getItem($(el).attr('id'));
if (hide == 'true') {
$(el).removeClass('open')
$(el).next().hide()
}
})
});
</script>
<!-- Content wrapper start -->
<div class="content-wrapper">
<?php if ($pageactive('preview')) { ?>
<div class="title-bar text-danger text-center font-weight-bold d-block font-size-20">
<b>PREVIEW</b>
</div>
<?php } ?>
<div class="content-container">
<?php
if (function_exists('printMsg') && (isset($_GET['msg']) || isset($_GET['error'])) || isset($_SESSION['msg'])) {
printMsg();
}
if ($Settings->hasPermission('admin.give-right') && isset($Settings->errors) && !empty($Settings->errors)) {
?>
<div class="alert danger mb-20">
<h3 class="title">There are errors in your settings:</h3>
<?= implode('<br>', $Settings->errors) ?>
<br>
Default settings are used. Go to the <a href="<?= ROOTPATH ?>/admin/general">Admin Panel</a> to fix this.
</div>
<?php
}
?>