Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
SWITCHwayf
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Guillaume Rousse
SWITCHwayf
Commits
2ae8a50c
Commit
2ae8a50c
authored
Apr 10, 2018
by
Guillaume Rousse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
look for templates in lib subdirectory
parent
07a0dd4f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
48 deletions
+18
-48
lib/templates.php
lib/templates.php
+18
-48
No files found.
lib/templates.php
View file @
2ae8a50c
...
...
@@ -20,13 +20,7 @@ function printHeader(){
global
$useImprovedDropDownList
,
$disableRemoteLogos
,
$organizationLogoURL
;
global
$federationURL
,
$organizationURL
,
$faqURL
,
$helpURL
,
$privacyURL
;
// Check if custom header template exists
if
(
file_exists
(
'custom-header.php'
)){
include
(
'custom-header.php'
);
}
else
{
// Use default code
include
(
'default-header.php'
);
}
include
(
get_template
(
'header.php'
));
}
...
...
@@ -85,13 +79,7 @@ function printWAYF(){
$defaultSelected
=
(
$selectedIDP
==
'-'
)
?
'selected="selected"'
:
''
;
$rememberSelectionChecked
=
(
isset
(
$_COOKIE
[
$redirectStateCookieName
]))
?
'checked="checked"'
:
''
;
// Check if custom header template exists
if
(
file_exists
(
'custom-body.php'
)){
include
(
'custom-body.php'
);
}
else
{
// Use default code
include
(
'default-body.php'
);
}
include
(
get_template
(
'body.php'
));
}
/******************************************************************************/
...
...
@@ -103,13 +91,7 @@ function printSettings(){
$actionURL
=
$_SERVER
[
'SCRIPT_NAME'
]
.
'?'
.
htmlentities
(
$_SERVER
[
'QUERY_STRING'
]);
$defaultSelected
=
(
$selectedIDP
==
'-'
)
?
'selected="selected"'
:
''
;
// Check if custom header template exists
if
(
file_exists
(
'custom-settings.php'
)){
include
(
'custom-settings.php'
);
}
else
{
// Use default code
include
(
'default-settings.php'
);
}
include
(
get_template
(
'settings.php'
));
}
/******************************************************************************/
...
...
@@ -267,26 +249,14 @@ function printNotice(){
}
}
// Check if footer template exists
if
(
file_exists
(
'custom-notice.php'
)){
include
(
'custom-notice.php'
);
}
else
{
// Use default code
include
(
'default-notice.php'
);
}
include
(
get_template
(
'notice.php'
));
}
/******************************************************************************/
// Prints end of HTML page
function
printFooter
(){
// Check if footer template exists
if
(
file_exists
(
'custom-footer.php'
)){
include
(
'custom-footer.php'
);
}
else
{
// Use default code
include
(
'default-footer.php'
);
}
include
(
get_template
(
'footer.php'
));
}
/******************************************************************************/
...
...
@@ -298,13 +268,7 @@ function printError($message){
// Show Header
printHeader
();
// Check if error template exists
if
(
file_exists
(
'custom-error.php'
)){
include
(
'custom-error.php'
);
}
else
{
// Use default code
include
(
'default-error.php'
);
}
include
(
get_template
(
'error.php'
));
// Show footer
printFooter
();
...
...
@@ -424,12 +388,7 @@ function printEmbeddedConfigurationScript(){
header
(
'Content-type: text/plain;charset="utf-8"'
);
if
(
file_exists
(
'custom-embedded-wayf.php'
)){
include
(
'custom-embedded-wayf.php'
);
}
else
{
// Use default code
include
(
'default-embedded-wayf.php'
);
}
include
(
get_template
(
'embedded-wayf.php'
));
}
/******************************************************************************/
...
...
@@ -456,3 +415,14 @@ function printCSS($file){
echo
$cssContent
;
}
function
get_template
(
$name
)
{
global
$topLevelDir
;
$custom_template
=
$topLevelDir
.
'/lib/custom-'
.
$name
;
$default_template
=
$topLevelDir
.
'/lib/default-'
.
$name
;
return
(
file_exists
(
$custom_template
))
?
$custom_template
:
$default_template
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment