ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
header.php
Go to the documentation of this file.
1<?php
2
3
4
8$this->data['htmlinject'] = [
9 'htmlContentPre' => [],
10 'htmlContentPost' => [],
11 'htmlContentHead' => [],
12];
13
14
16if (array_key_exists('jquery', $this->data)) {
17 $jquery = $this->data['jquery'];
18}
19
20if (array_key_exists('pageid', $this->data)) {
21 $hookinfo = [
22 'pre' => &$this->data['htmlinject']['htmlContentPre'],
23 'post' => &$this->data['htmlinject']['htmlContentPost'],
24 'head' => &$this->data['htmlinject']['htmlContentHead'],
25 'jquery' => &$jquery,
26 'page' => $this->data['pageid']
27 ];
28
30}
31// - o - o - o - o - o - o - o - o - o - o - o - o -
32
42header('X-Frame-Options: SAMEORIGIN');
43
44?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
45<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
46<head>
47<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
48<meta name="viewport" content="initial-scale=1.0" />
49<script type="text/javascript" src="/<?php echo $this->data['baseurlpath']; ?>resources/script.js"></script>
50<title><?php
51if (array_key_exists('header', $this->data)) {
52 echo $this->data['header'];
53} else {
54 echo 'SimpleSAMLphp';
55}
56?></title>
57
58 <link rel="stylesheet" type="text/css" href="/<?php echo $this->data['baseurlpath']; ?>resources/default.css" />
59 <link rel="icon" type="image/icon" href="/<?php echo $this->data['baseurlpath']; ?>resources/icons/favicon.ico" />
60
61<?php
62
63if (!empty($jquery)) {
64 $version = '1.8';
65 if (array_key_exists('version', $jquery)) {
66 $version = $jquery['version'];
67 }
68
69 if ($version == '1.8') {
70 if (isset($jquery['core']) && $jquery['core']) {
71 echo('<script type="text/javascript" src="/' . $this->data['baseurlpath'] . 'resources/jquery-1.8.js"></script>' . "\n");
72 }
73
74 if (isset($jquery['ui']) && $jquery['ui']) {
75 echo('<script type="text/javascript" src="/' . $this->data['baseurlpath'] . 'resources/jquery-ui-1.8.js"></script>' . "\n");
76 }
77
78 if (isset($jquery['css']) && $jquery['css']) {
79 echo('<link rel="stylesheet" media="screen" type="text/css" href="/' . $this->data['baseurlpath'] .
80 'resources/uitheme1.8/jquery-ui.css" />' . "\n");
81 }
82 }
83}
84
85if (isset($this->data['clipboard.js'])) {
86 echo '<script type="text/javascript" src="/' . $this->data['baseurlpath'] .
87 'resources/clipboard.min.js"></script>' . "\n";
88}
89
90if (!empty($this->data['htmlinject']['htmlContentHead'])) {
91 foreach ($this->data['htmlinject']['htmlContentHead'] as $c) {
92 echo $c;
93 }
94}
95
96
97
98
99if ($this->isLanguageRTL()) {
100 ?>
101 <link rel="stylesheet" type="text/css" href="/<?php echo $this->data['baseurlpath']; ?>resources/default-rtl.css" />
102<?php
103}
104?>
105
106
107 <meta name="robots" content="noindex, nofollow" />
108
109
110<?php
111if (array_key_exists('head', $this->data)) {
112 echo '<!-- head -->' . $this->data['head'] . '<!-- /head -->';
113}
114?>
115</head>
116<?php
118if (array_key_exists('autofocus', $this->data)) {
119 $onLoad .= 'SimpleSAML_focus(\'' . $this->data['autofocus'] . '\');';
120}
121if (isset($this->data['onLoad'])) {
122 $onLoad .= $this->data['onLoad'];
123}
124
125if ($onLoad !== '') {
126 $onLoad = ' onload="' . $onLoad . '"';
127}
128?>
129<body<?php echo $onLoad; ?>>
130
131<div id="wrap">
132
133 <div id="header">
134 <h1><a href="/<?php echo $this->data['baseurlpath']; ?>"><?php
135 echo(isset($this->data['header']) ? $this->data['header'] : 'SimpleSAMLphp');
136 ?></a></h1>
137 </div>
138
139
140 <?php
141
142 $includeLanguageBar = true;
143 if (!empty($_POST)) {
144 $includeLanguageBar = false;
145 }
146 if (isset($this->data['hideLanguageBar']) && $this->data['hideLanguageBar'] === true) {
147 $includeLanguageBar = false;
148 }
149
150 if ($includeLanguageBar) {
151 $languages = $this->getLanguageList();
152 ksort($languages);
153 if (count($languages) > 1) {
154 echo '<div id="languagebar">';
155 $langnames = [
156 'no' => 'Bokmål', // Norwegian Bokmål
157 'nn' => 'Nynorsk', // Norwegian Nynorsk
158 'se' => 'Sámegiella', // Northern Sami
159 'da' => 'Dansk', // Danish
160 'en' => 'English',
161 'de' => 'Deutsch', // German
162 'sv' => 'Svenska', // Swedish
163 'fi' => 'Suomeksi', // Finnish
164 'es' => 'Español', // Spanish
165 'ca' => 'Català', // Catalan
166 'fr' => 'Français', // French
167 'it' => 'Italiano', // Italian
168 'nl' => 'Nederlands', // Dutch
169 'lb' => 'Lëtzebuergesch', // Luxembourgish
170 'cs' => 'Čeština', // Czech
171 'sl' => 'Slovenščina', // Slovensk
172 'lt' => 'Lietuvių kalba', // Lithuanian
173 'hr' => 'Hrvatski', // Croatian
174 'hu' => 'Magyar', // Hungarian
175 'pl' => 'Język polski', // Polish
176 'pt' => 'Português', // Portuguese
177 'pt-br' => 'Português brasileiro', // Portuguese
178 'ru' => 'русский язык', // Russian
179 'et' => 'eesti keel', // Estonian
180 'tr' => 'Türkçe', // Turkish
181 'el' => 'ελληνικά', // Greek
182 'ja' => '日本語', // Japanese
183 'zh' => '简体中文', // Chinese (simplified)
184 'zh-tw' => '繁體中文', // Chinese (traditional)
185 'ar' => 'العربية', // Arabic
186 'he' => 'עִבְרִית', // Hebrew
187 'id' => 'Bahasa Indonesia', // Indonesian
188 'sr' => 'Srpski', // Serbian
189 'lv' => 'Latviešu', // Latvian
190 'ro' => 'Românește', // Romanian
191 'eu' => 'Euskara', // Basque
192 'af' => 'Afrikaans', // Afrikaans
193 ];
194
195 $textarray = [];
196 foreach ($languages as $lang => $current) {
197 $lang = strtolower($lang);
198 if ($current) {
199 $textarray[] = $langnames[$lang];
200 } else {
201 $textarray[] = '<a href="' . htmlspecialchars(
202 \SimpleSAML\Utils\HTTP::addURLParameters(
203 \SimpleSAML\Utils\HTTP::getSelfURL(),
204 [$this->getTranslator()->getLanguage()->getLanguageParameterName() => $lang]
205 )
206 ) . '">' .
207 $langnames[$lang] . '</a>';
208 }
209 }
210 echo join(' | ', $textarray);
211 echo '</div>';
212 }
213 }
214
215
216
217 ?>
218 <div id="content">
219
220
221
222<?php
223
224if (!empty($this->data['htmlinject']['htmlContentPre'])) {
225 foreach ($this->data['htmlinject']['htmlContentPre'] as $c) {
226 echo $c;
227 }
228}
html()
$version
Definition: build.php:27
An exception for terminatinating execution or to throw for unit testing.
static callHooks($hook, &$data=null)
Call a hook in all enabled modules.
Definition: Module.php:281
$jquery
Definition: header.php:15
if(!empty($jquery)) if(isset( $this->data[ 'clipboard.js'])) if(!empty($this->data['htmlinject']['htmlContentHead'])) if( $this->isLanguageRTL()) if(array_key_exists('head', $this->data)) $onLoad
Definition: header.php:117
$this data['htmlinject']
Support the htmlinject hook, which allows modules to change header, pre and post body on all pages.
Definition: header.php:8
$hookinfo
Definition: index.php:7
static http()
Fetches the global http state from ILIAS.
Temporary autoloader to ensure compatibility with old, non-PSR-2 compliant classes.