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
0
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
e3b1abbc
Commit
e3b1abbc
authored
4 years ago
by
Tim van Dijen
Browse files
Options
Downloads
Patches
Plain Diff
Remove legacy code
parent
d7f99a3f
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
lib/SimpleSAML/XHTML/Template.php
+0
-70
0 additions, 70 deletions
lib/SimpleSAML/XHTML/Template.php
with
0 additions
and
70 deletions
lib/SimpleSAML/XHTML/Template.php
+
0
−
70
View file @
e3b1abbc
...
@@ -534,76 +534,6 @@ class Template extends Response
...
@@ -534,76 +534,6 @@ class Template extends Response
}
}
/**
* Find template path.
*
* This function locates the given template based on the template name. It will first search for the template in
* the current theme directory, and then the default theme.
*
* The template name may be on the form <module name>:<template path>, in which case it will search for the
* template file in the given module.
*
* @param string $template The relative path from the theme directory to the template file.
* @param bool $throw_exception
*
* @return string|null The absolute path to the template file.
*
* @throws \Exception If the template file couldn't be found.
*/
private
function
findTemplatePath
(
string
$template
,
bool
$throw_exception
=
true
):
?string
{
list
(
$templateModule
,
$templateName
)
=
$this
->
findModuleAndTemplateName
(
$template
);
$templateModule
=
(
$templateModule
!==
null
)
?
$templateModule
:
'default'
;
// first check the current theme
if
(
$this
->
theme
[
'module'
]
!==
null
)
{
// .../module/<themeModule>/themes/<themeName>/<templateModule>/<templateName>
$filename
=
Module
::
getModuleDir
(
$this
->
theme
[
'module'
])
.
'/themes/'
.
$this
->
theme
[
'name'
]
.
'/'
.
$templateModule
.
'/'
.
$templateName
;
}
elseif
(
$templateModule
!==
'default'
)
{
// .../module/<templateModule>/templates/<templateName>
$filename
=
Module
::
getModuleDir
(
$templateModule
)
.
'/templates/'
.
$templateName
;
}
else
{
// .../templates/<theme>/<templateName>
$base
=
$this
->
configuration
->
getPathValue
(
'templatedir'
,
'templates/'
)
?:
'templates/'
;
$filename
=
$base
.
$templateName
;
}
$filename
=
$this
->
normalizeTemplateName
(
$filename
);
// not found in current theme
Logger
::
debug
(
$_SERVER
[
'PHP_SELF'
]
.
' - Template: Could not find template file ['
.
$template
.
'] at ['
.
$filename
.
'] - now trying the base template'
);
// try default theme
if
(
$templateModule
!==
'default'
)
{
// .../module/<templateModule>/templates/<templateName>
$filename
=
Module
::
getModuleDir
(
$templateModule
)
.
'/templates/'
.
$templateName
;
}
else
{
// .../templates/<templateName>
$base
=
$this
->
configuration
->
getPathValue
(
'templatedir'
,
'templates/'
)
?:
'templates/'
;
$filename
=
$base
.
'/'
.
$templateName
;
}
$filename
=
$this
->
normalizeTemplateName
(
$filename
);
// not found in default template
if
(
$throw_exception
)
{
// log error and throw exception
$error
=
'Template: Could not find template file ['
.
$template
.
'] at ['
.
$filename
.
']'
;
Logger
::
critical
(
$_SERVER
[
'PHP_SELF'
]
.
' - '
.
$error
);
throw
new
\Exception
(
$error
);
}
else
{
// missing template expected, return NULL
return
null
;
}
}
/**
/**
* Return the internal translator object used by this template.
* Return the internal translator object used by this template.
*
*
...
...
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