aboutsummaryrefslogtreecommitdiff
path: root/templates/responsive-navigation.php
blob: 66b18359bbe9e3cd7932ee902083547ad476159a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
<?php
[$navigation, $activated] = ResponsiveHelper::getNavigationArray();
$hash = md5(json_encode($navigation));

$response = compact('activated');
if (!isset($_COOKIE['responsive-navigation-hash']) || $_COOKIE['responsive-navigation-hash'] !== $hash) {
    $response = array_merge($response, compact('navigation', 'hash'));
}
?>
<script>
STUDIP.Navigation = <?= json_encode($response, JSON_PARTIAL_OUTPUT_ON_ERROR) ?>;
</script>