Skip to content
Snippets Groups Projects
Commit e3611647 authored by Jaime Perez Crespo's avatar Jaime Perez Crespo
Browse files

Fix phpdoc comments for SimpleSAML_XHTML_Template.

parent 5cffdcfd
No related branches found
No related tags found
No related merge requests found
...@@ -17,19 +17,20 @@ class SimpleSAML_XHTML_Template { ...@@ -17,19 +17,20 @@ class SimpleSAML_XHTML_Template {
/** /**
* Constructor * Constructor
* *
* @param $configuration Configuration object * @param SimpleSAML_Configuration $configuration Configuration object
* @param $template Which template file to load * @param string $template Which template file to load
* @param $defaultDictionary The default dictionary where tags will come from. * @param string|null $defaultDictionary The default dictionary where tags will come from.
*/ */
function __construct(SimpleSAML_Configuration $configuration, $template, $defaultDictionary = NULL) { public function __construct(SimpleSAML_Configuration $configuration, $template, $defaultDictionary = null)
{
$this->configuration = $configuration; $this->configuration = $configuration;
$this->template = $template; $this->template = $template;
$this->data['baseurlpath'] = $this->configuration->getBaseURL(); $this->data['baseurlpath'] = $this->configuration->getBaseURL();
$this->translator = new SimpleSAML\Locale\Translate($configuration, $defaultDictionary = NULL); $this->translator = new SimpleSAML\Locale\Translate($configuration, $defaultDictionary = null);
} }
/** /**
* Includs a file relative to the template base directory. * Includes a file relative to the template base directory.
* This function can be used to include headers and footers etc. * This function can be used to include headers and footers etc.
* *
*/ */
...@@ -42,7 +43,8 @@ class SimpleSAML_XHTML_Template { ...@@ -42,7 +43,8 @@ class SimpleSAML_XHTML_Template {
} }
/** /**
* @deprecated This method will be removed in SSP 2.0. Please use SimpleSAML\Locale\Translate::getTranslation() instead. * @deprecated This method will be removed in SSP 2.0. Please use SimpleSAML\Locale\Translate::getTranslation()
* instead.
*/ */
public function getTranslation($translations) { public function getTranslation($translations) {
return $this->translator->getTranslation($translations); return $this->translator->getTranslation($translations);
...@@ -50,6 +52,8 @@ class SimpleSAML_XHTML_Template { ...@@ -50,6 +52,8 @@ class SimpleSAML_XHTML_Template {
/** /**
* Wrap Language->t to translate tag into the current language, with a fallback to english. * Wrap Language->t to translate tag into the current language, with a fallback to english.
*
* @see \SimpleSAML\Locale\Translate::t()
*/ */
public function t($tag, $replacements = array(), $fallbackdefault = true, $oldreplacements = array(), $striptags = FALSE) { public function t($tag, $replacements = array(), $fallbackdefault = true, $oldreplacements = array(), $striptags = FALSE) {
return $this->translator->t($tag, $replacements, $fallbackdefault, $oldreplacements, $striptags); return $this->translator->t($tag, $replacements, $fallbackdefault, $oldreplacements, $striptags);
...@@ -73,7 +77,9 @@ class SimpleSAML_XHTML_Template { ...@@ -73,7 +77,9 @@ class SimpleSAML_XHTML_Template {
/** /**
* Wraps Language->getLanguageList * Wraps Translate->includeInlineTranslation()
*
* @see \SimpleSAML\Locale\Translate::includeInlineTranslation()
*/ */
public function includeInlineTranslation($tag, $translation) { public function includeInlineTranslation($tag, $translation) {
return $this->translator->includeInlineTranslation($tag, $translation); return $this->translator->includeInlineTranslation($tag, $translation);
...@@ -93,17 +99,16 @@ class SimpleSAML_XHTML_Template { ...@@ -93,17 +99,16 @@ class SimpleSAML_XHTML_Template {
/** /**
* Find template path. * Find template path.
* *
* This function locates the given template based on the template name. * This function locates the given template based on the template name. It will first search for the template in
* It will first search for the template in the current theme directory, and * the current theme directory, and then the default theme.
* then the default theme.
* *
* The template name may be on the form <module name>:<template path>, in which case * The template name may be on the form <module name>:<template path>, in which case it will search for the
* it will search for the template file in the given module. * template file in the given module.
* *
* An error will be thrown if the template file couldn't be found. * @param string $template The relative path from the theme directory to the template file.
* @return string The absolute path to the template file.
* *
* @param string $template The relative path from the theme directory to the template file. * @throws Exception If the template file couldn't be found.
* @return string The absolute path to the template file.
*/ */
private function findTemplatePath($template) { private function findTemplatePath($template) {
assert('is_string($template)'); assert('is_string($template)');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment