Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simplesamlphp
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Perun
Perun ProxyIdP
v1
simplesamlphp
Commits
d39bcc99
Unverified
Commit
d39bcc99
authored
7 years ago
by
Thijs Kinkhorst
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #861 from quique/dev
PSR-2
Coding style
parents
7827423a
af05377f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
templates/includes/header.php
+153
-141
153 additions, 141 deletions
templates/includes/header.php
with
153 additions
and
141 deletions
templates/includes/header.php
+
153
−
141
View file @
d39bcc99
...
...
@@ -5,26 +5,28 @@
/**
* Support the htmlinject hook, which allows modules to change header, pre and post body on all pages.
*/
$this
->
data
[
'htmlinject'
]
=
array
(
'htmlContentPre'
=>
array
()
,
'htmlContentPost'
=>
array
()
,
'htmlContentHead'
=>
array
()
,
)
;
$this
->
data
[
'htmlinject'
]
=
[
'htmlContentPre'
=>
[]
,
'htmlContentPost'
=>
[]
,
'htmlContentHead'
=>
[]
,
]
;
$jquery
=
array
();
if
(
array_key_exists
(
'jquery'
,
$this
->
data
))
$jquery
=
$this
->
data
[
'jquery'
];
$jquery
=
[];
if
(
array_key_exists
(
'jquery'
,
$this
->
data
))
{
$jquery
=
$this
->
data
[
'jquery'
];
}
if
(
array_key_exists
(
'pageid'
,
$this
->
data
))
{
$hookinfo
=
array
(
'pre'
=>
&
$this
->
data
[
'htmlinject'
][
'htmlContentPre'
],
'post'
=>
&
$this
->
data
[
'htmlinject'
][
'htmlContentPost'
],
'head'
=>
&
$this
->
data
[
'htmlinject'
][
'htmlContentHead'
],
'jquery'
=>
&
$jquery
,
'page'
=>
$this
->
data
[
'pageid'
]
)
;
SimpleSAML\Module
::
callHooks
(
'htmlinject'
,
$hookinfo
);
$hookinfo
=
[
'pre'
=>
&
$this
->
data
[
'htmlinject'
][
'htmlContentPre'
],
'post'
=>
&
$this
->
data
[
'htmlinject'
][
'htmlContentPost'
],
'head'
=>
&
$this
->
data
[
'htmlinject'
][
'htmlContentHead'
],
'jquery'
=>
&
$jquery
,
'page'
=>
$this
->
data
[
'pageid'
]
]
;
SimpleSAML\Module
::
callHooks
(
'htmlinject'
,
$hookinfo
);
}
// - o - o - o - o - o - o - o - o - o - o - o - o -
...
...
@@ -46,170 +48,180 @@ header('X-Frame-Options: SAMEORIGIN');
<meta
name=
"viewport"
content=
"initial-scale=1.0"
/>
<script
type=
"text/javascript"
src=
"/
<?php
echo
$this
->
data
[
'baseurlpath'
];
?>
resources/script.js"
></script>
<title>
<?php
if
(
array_key_exists
(
'header'
,
$this
->
data
))
{
echo
$this
->
data
[
'header'
];
if
(
array_key_exists
(
'header'
,
$this
->
data
))
{
echo
$this
->
data
[
'header'
];
}
else
{
echo
'SimpleSAMLphp'
;
echo
'SimpleSAMLphp'
;
}
?>
</title>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/
<?php
echo
$this
->
data
[
'baseurlpath'
];
?>
resources/default.css"
/>
<link
rel=
"icon"
type=
"image/icon"
href=
"/
<?php
echo
$this
->
data
[
'baseurlpath'
];
?>
resources/icons/favicon.ico"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/
<?php
echo
$this
->
data
[
'baseurlpath'
];
?>
resources/default.css"
/>
<link
rel=
"icon"
type=
"image/icon"
href=
"/
<?php
echo
$this
->
data
[
'baseurlpath'
];
?>
resources/icons/favicon.ico"
/>
<?php
if
(
!
empty
(
$jquery
))
{
$version
=
'1.8'
;
if
(
array_key_exists
(
'version'
,
$jquery
))
$version
=
$jquery
[
'version'
];
if
(
$version
==
'1.8'
)
{
if
(
isset
(
$jquery
[
'core'
])
&&
$jquery
[
'core'
])
echo
(
'<script type="text/javascript" src="/'
.
$this
->
data
[
'baseurlpath'
]
.
'resources/jquery-1.8.js"></script>'
.
"
\n
"
);
if
(
isset
(
$jquery
[
'ui'
])
&&
$jquery
[
'ui'
])
echo
(
'<script type="text/javascript" src="/'
.
$this
->
data
[
'baseurlpath'
]
.
'resources/jquery-ui-1.8.js"></script>'
.
"
\n
"
);
if
(
isset
(
$jquery
[
'css'
])
&&
$jquery
[
'css'
])
echo
(
'<link rel="stylesheet" media="screen" type="text/css" href="/'
.
$this
->
data
[
'baseurlpath'
]
.
'resources/uitheme1.8/jquery-ui.css" />'
.
"
\n
"
);
}
if
(
!
empty
(
$jquery
))
{
$version
=
'1.8'
;
if
(
array_key_exists
(
'version'
,
$jquery
))
{
$version
=
$jquery
[
'version'
];
}
if
(
$version
==
'1.8'
)
{
if
(
isset
(
$jquery
[
'core'
])
&&
$jquery
[
'core'
])
{
echo
(
'<script type="text/javascript" src="/'
.
$this
->
data
[
'baseurlpath'
]
.
'resources/jquery-1.8.js"></script>'
.
"
\n
"
);
}
if
(
isset
(
$jquery
[
'ui'
])
&&
$jquery
[
'ui'
])
{
echo
(
'<script type="text/javascript" src="/'
.
$this
->
data
[
'baseurlpath'
]
.
'resources/jquery-ui-1.8.js"></script>'
.
"
\n
"
);
}
if
(
isset
(
$jquery
[
'css'
])
&&
$jquery
[
'css'
])
{
echo
(
'<link rel="stylesheet" media="screen" type="text/css" href="/'
.
$this
->
data
[
'baseurlpath'
]
.
'resources/uitheme1.8/jquery-ui.css" />'
.
"
\n
"
);
}
}
}
if
(
isset
(
$this
->
data
[
'clipboard.js'
]))
{
echo
'<script type="text/javascript" src="/'
.
$this
->
data
[
'baseurlpath'
]
.
'resources/clipboard.min.js"></script>'
.
"
\n
"
;
echo
'<script type="text/javascript" src="/'
.
$this
->
data
[
'baseurlpath'
]
.
'resources/clipboard.min.js"></script>'
.
"
\n
"
;
}
if
(
!
empty
(
$this
->
data
[
'htmlinject'
][
'htmlContentHead'
]))
{
foreach
(
$this
->
data
[
'htmlinject'
][
'htmlContentHead'
]
AS
$c
)
{
echo
$c
;
}
if
(
!
empty
(
$this
->
data
[
'htmlinject'
][
'htmlContentHead'
]))
{
foreach
(
$this
->
data
[
'htmlinject'
][
'htmlContentHead'
]
as
$c
)
{
echo
$c
;
}
}
if
(
$this
->
isLanguageRTL
())
{
?>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/
<?php
echo
$this
->
data
[
'baseurlpath'
];
?>
resources/default-rtl.css"
/>
<?php
?>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/
<?php
echo
$this
->
data
[
'baseurlpath'
];
?>
resources/default-rtl.css"
/>
<?php
}
?>
<meta
name=
"robots"
content=
"noindex, nofollow"
/>
<?php
if
(
array_key_exists
(
'head'
,
$this
->
data
))
{
echo
'<!-- head -->'
.
$this
->
data
[
'head'
]
.
'<!-- /head -->'
;
<meta
name=
"robots"
content=
"noindex, nofollow"
/>
<?php
if
(
array_key_exists
(
'head'
,
$this
->
data
))
{
echo
'<!-- head -->'
.
$this
->
data
[
'head'
]
.
'<!-- /head -->'
;
}
?>
</head>
<?php
$onLoad
=
''
;
if
(
array_key_exists
(
'autofocus'
,
$this
->
data
))
{
$onLoad
.
=
'SimpleSAML_focus(\''
.
$this
->
data
[
'autofocus'
]
.
'\');'
;
if
(
array_key_exists
(
'autofocus'
,
$this
->
data
))
{
$onLoad
.
=
'SimpleSAML_focus(\''
.
$this
->
data
[
'autofocus'
]
.
'\');'
;
}
if
(
isset
(
$this
->
data
[
'onLoad'
]))
{
$onLoad
.
=
$this
->
data
[
'onLoad'
];
$onLoad
.
=
$this
->
data
[
'onLoad'
];
}
if
(
$onLoad
!==
''
)
{
$onLoad
=
' onload="'
.
$onLoad
.
'"'
;
if
(
$onLoad
!==
''
)
{
$onLoad
=
' onload="'
.
$onLoad
.
'"'
;
}
?>
<body
<?php
echo
$onLoad
;
?>
>
<div
id=
"wrap"
>
<div
id=
"header"
>
<h1><a
href=
"/
<?php
echo
$this
->
data
[
'baseurlpath'
];
?>
"
>
<?php
echo
(
isset
(
$this
->
data
[
'header'
])
?
$this
->
data
[
'header'
]
:
'SimpleSAMLphp'
);
?>
</a></h1>
</div>
<?php
$includeLanguageBar
=
TRUE
;
if
(
!
empty
(
$_POST
))
$includeLanguageBar
=
FALSE
;
if
(
isset
(
$this
->
data
[
'hideLanguageBar'
])
&&
$this
->
data
[
'hideLanguageBar'
]
===
TRUE
)
$includeLanguageBar
=
FALSE
;
if
(
$includeLanguageBar
)
{
$languages
=
$this
->
getLanguageList
();
if
(
count
(
$languages
)
>
1
)
{
echo
'<div id="languagebar">'
;
$langnames
=
array
(
'no'
=>
'Bokmål'
,
// Norwegian Bokmål
'nn'
=>
'Nynorsk'
,
// Norwegian Nynorsk
'se'
=>
'Sámegiella'
,
// Northern Sami
'da'
=>
'Dansk'
,
// Danish
'en'
=>
'English'
,
'de'
=>
'Deutsch'
,
// German
'sv'
=>
'Svenska'
,
// Swedish
'fi'
=>
'Suomeksi'
,
// Finnish
'es'
=>
'Español'
,
// Spanish
'fr'
=>
'Français'
,
// French
'it'
=>
'Italiano'
,
// Italian
'nl'
=>
'Nederlands'
,
// Dutch
'lb'
=>
'Lëtzebuergesch'
,
// Luxembourgish
'cs'
=>
'Čeština'
,
// Czech
'sl'
=>
'Slovenščina'
,
// Slovensk
'lt'
=>
'Lietuvių kalba'
,
// Lithuanian
'hr'
=>
'Hrvatski'
,
// Croatian
'hu'
=>
'Magyar'
,
// Hungarian
'pl'
=>
'Język polski'
,
// Polish
'pt'
=>
'Português'
,
// Portuguese
'pt-br'
=>
'Português brasileiro'
,
// Portuguese
'ru'
=>
'русский язык'
,
// Russian
'et'
=>
'eesti keel'
,
// Estonian
'tr'
=>
'Türkçe'
,
// Turkish
'el'
=>
'ελληνικά'
,
// Greek
'ja'
=>
'日本語'
,
// Japanese
'zh'
=>
'简体中文'
,
// Chinese (simplified)
'zh-tw'
=>
'繁體中文'
,
// Chinese (traditional)
'ar'
=>
'العربية'
,
// Arabic
'he'
=>
'עִבְרִית'
,
// Hebrew
'id'
=>
'Bahasa Indonesia'
,
// Indonesian
'sr'
=>
'Srpski'
,
// Serbian
'lv'
=>
'Latviešu'
,
// Latvian
'ro'
=>
'Românește'
,
// Romanian
'eu'
=>
'Euskara'
,
// Basque
'af'
=>
'Afrikaans'
,
// Afrikaans
);
$textarray
=
array
();
foreach
(
$languages
AS
$lang
=>
$current
)
{
$lang
=
strtolower
(
$lang
);
if
(
$current
)
{
$textarray
[]
=
$langnames
[
$lang
];
}
else
{
$textarray
[]
=
'<a href="'
.
htmlspecialchars
(
\SimpleSAML\Utils\HTTP
::
addURLParameters
(
\SimpleSAML\Utils\HTTP
::
getSelfURL
(),
array
(
$this
->
getTranslator
()
->
getLanguage
()
->
getLanguageParameterName
()
=>
$lang
)))
.
'">'
.
$langnames
[
$lang
]
.
'</a>'
;
}
}
echo
join
(
' | '
,
$textarray
);
echo
'</div>'
;
}
}
?>
<div
id=
"content"
>
<div
id=
"header"
>
<h1><a
href=
"/
<?php
echo
$this
->
data
[
'baseurlpath'
];
?>
"
>
<?php
echo
(
isset
(
$this
->
data
[
'header'
])
?
$this
->
data
[
'header'
]
:
'SimpleSAMLphp'
);
?>
</a></h1>
</div>
<?php
$includeLanguageBar
=
true
;
if
(
!
empty
(
$_POST
))
{
$includeLanguageBar
=
false
;
}
if
(
isset
(
$this
->
data
[
'hideLanguageBar'
])
&&
$this
->
data
[
'hideLanguageBar'
]
===
true
)
{
$includeLanguageBar
=
false
;
}
if
(
$includeLanguageBar
)
{
$languages
=
$this
->
getLanguageList
();
ksort
(
$languages
);
if
(
count
(
$languages
)
>
1
)
{
echo
'<div id="languagebar">'
;
$langnames
=
[
'no'
=>
'Bokmål'
,
// Norwegian Bokmål
'nn'
=>
'Nynorsk'
,
// Norwegian Nynorsk
'se'
=>
'Sámegiella'
,
// Northern Sami
'da'
=>
'Dansk'
,
// Danish
'en'
=>
'English'
,
'de'
=>
'Deutsch'
,
// German
'sv'
=>
'Svenska'
,
// Swedish
'fi'
=>
'Suomeksi'
,
// Finnish
'es'
=>
'Español'
,
// Spanish
'fr'
=>
'Français'
,
// French
'it'
=>
'Italiano'
,
// Italian
'nl'
=>
'Nederlands'
,
// Dutch
'lb'
=>
'Lëtzebuergesch'
,
// Luxembourgish
'cs'
=>
'Čeština'
,
// Czech
'sl'
=>
'Slovenščina'
,
// Slovensk
'lt'
=>
'Lietuvių kalba'
,
// Lithuanian
'hr'
=>
'Hrvatski'
,
// Croatian
'hu'
=>
'Magyar'
,
// Hungarian
'pl'
=>
'Język polski'
,
// Polish
'pt'
=>
'Português'
,
// Portuguese
'pt-br'
=>
'Português brasileiro'
,
// Portuguese
'ru'
=>
'русский язык'
,
// Russian
'et'
=>
'eesti keel'
,
// Estonian
'tr'
=>
'Türkçe'
,
// Turkish
'el'
=>
'ελληνικά'
,
// Greek
'ja'
=>
'日本語'
,
// Japanese
'zh'
=>
'简体中文'
,
// Chinese (simplified)
'zh-tw'
=>
'繁體中文'
,
// Chinese (traditional)
'ar'
=>
'العربية'
,
// Arabic
'he'
=>
'עִבְרִית'
,
// Hebrew
'id'
=>
'Bahasa Indonesia'
,
// Indonesian
'sr'
=>
'Srpski'
,
// Serbian
'lv'
=>
'Latviešu'
,
// Latvian
'ro'
=>
'Românește'
,
// Romanian
'eu'
=>
'Euskara'
,
// Basque
'af'
=>
'Afrikaans'
,
// Afrikaans
];
$textarray
=
[];
foreach
(
$languages
as
$lang
=>
$current
)
{
$lang
=
strtolower
(
$lang
);
if
(
$current
)
{
$textarray
[]
=
$langnames
[
$lang
];
}
else
{
$textarray
[]
=
'<a href="'
.
htmlspecialchars
(
\SimpleSAML\Utils\HTTP
::
addURLParameters
(
\SimpleSAML\Utils\HTTP
::
getSelfURL
(),
[
$this
->
getTranslator
()
->
getLanguage
()
->
getLanguageParameterName
()
=>
$lang
]
)
)
.
'">'
.
$langnames
[
$lang
]
.
'</a>'
;
}
}
echo
join
(
' | '
,
$textarray
);
echo
'</div>'
;
}
}
?>
<div
id=
"content"
>
<?php
if
(
!
empty
(
$this
->
data
[
'htmlinject'
][
'htmlContentPre'
]))
{
foreach
(
$this
->
data
[
'htmlinject'
][
'htmlContentPre'
]
AS
$c
)
{
echo
$c
;
}
if
(
!
empty
(
$this
->
data
[
'htmlinject'
][
'htmlContentPre'
]))
{
foreach
(
$this
->
data
[
'htmlinject'
][
'htmlContentPre'
]
as
$c
)
{
echo
$c
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment