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

Restore SimpleSAML_XHTML_Template::getLanguageCookie() and setLanguageCookie()...

Restore SimpleSAML_XHTML_Template::getLanguageCookie() and setLanguageCookie() temporarily, as wrappers over the new methods in SimpleSAML\Locale\Language.
parent 809daf0c
No related branches found
No related tags found
No related merge requests found
...@@ -50,6 +50,8 @@ class SimpleSAML_XHTML_Template ...@@ -50,6 +50,8 @@ class SimpleSAML_XHTML_Template
/** /**
* Temporary wrapper for SimpleSAML\Locale\Translate::getPreferredTranslation().
*
* @deprecated This method will be removed in SSP 2.0. Please use * @deprecated This method will be removed in SSP 2.0. Please use
* SimpleSAML\Locale\Translate::getPreferredTranslation() instead. * SimpleSAML\Locale\Translate::getPreferredTranslation() instead.
*/ */
...@@ -96,25 +98,6 @@ class SimpleSAML_XHTML_Template ...@@ -96,25 +98,6 @@ class SimpleSAML_XHTML_Template
} }
/**
* Merge two translation arrays.
*
* @param array $def The array holding string definitions.
* @param array $lang The array holding translations for every string.
* @return array The recursive merge of both arrays.
* @deprecated This method will be removed in SimpleSAMLphp 2.0. Please use array_merge_recursive() instead.
*/
public static function lang_merge($def, $lang)
{
foreach ($def as $key => $value) {
if (array_key_exists($key, $lang)) {
$def[$key] = array_merge($value, $lang[$key]);
}
}
return $def;
}
/** /**
* Find template path. * Find template path.
* *
...@@ -195,4 +178,45 @@ class SimpleSAML_XHTML_Template ...@@ -195,4 +178,45 @@ class SimpleSAML_XHTML_Template
throw new Exception($error); throw new Exception($error);
} }
/**
* Merge two translation arrays.
*
* @param array $def The array holding string definitions.
* @param array $lang The array holding translations for every string.
* @return array The recursive merge of both arrays.
* @deprecated This method will be removed in SimpleSAMLphp 2.0. Please use array_merge_recursive() instead.
*/
public static function lang_merge($def, $lang)
{
foreach ($def as $key => $value) {
if (array_key_exists($key, $lang)) {
$def[$key] = array_merge($value, $lang[$key]);
}
}
return $def;
}
/**
* @return null|string
* @deprecated This method will be removed in SSP 2.0. Please use \SimpleSAML\Locale\Language::getLanguageCookie()
* instead.
*/
public static function getLanguageCookie()
{
return \SimpleSAML\Locale\Language::getLanguageCookie();
}
/**
* @param $language
* @deprecated This method will be removed in SSP 2.0. Please use \SimpleSAML\Locale\Language::setLanguageCookie()
* instead.
*/
public static function setLanguageCookie($language)
{
\SimpleSAML\Locale\Language::setLanguageCookie($language);
}
} }
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