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