Skip to content
Snippets Groups Projects
Commit 37565470 authored by Tim van Dijen's avatar Tim van Dijen
Browse files

Move attribute translations away from template

parent 107f3772
No related branches found
No related tags found
No related merge requests found
...@@ -47,10 +47,6 @@ TRSTART; ...@@ -47,10 +47,6 @@ TRSTART;
echo "\n<ul>\n"; echo "\n<ul>\n";
foreach ($attributes as $name => $value) { foreach ($attributes as $name => $value) {
if (isset($this->data['attribute_'.htmlspecialchars(strtolower($name))])) {
$name = $this->data['attribute_'.htmlspecialchars(strtolower($name))];
}
$name = $this->getTranslator()->getAttributeTranslation($name); // translate
if (sizeof($value) > 1) { if (sizeof($value) > 1) {
echo "<li>".htmlspecialchars($name).":\n<ul>\n"; echo "<li>".htmlspecialchars($name).":\n<ul>\n";
foreach ($value as $v) { foreach ($value as $v) {
......
...@@ -229,6 +229,17 @@ foreach ($all_sp_metadata as $sp_entityid => $sp_values) { ...@@ -229,6 +229,17 @@ foreach ($all_sp_metadata as $sp_entityid => $sp_values) {
list($targeted_id, $attribute_hash, $attributes_new) = driveProcessingChain($idp_metadata, $source, $sp_metadata, list($targeted_id, $attribute_hash, $attributes_new) = driveProcessingChain($idp_metadata, $source, $sp_metadata,
$sp_entityid, $attributes, $userid, $hashAttributes, $excludeAttributes); $sp_entityid, $attributes, $userid, $hashAttributes, $excludeAttributes);
// Translate attribute-names
foreach ($attributes_new as $orig_name => $value) {
if (isset($template->data['attribute_'.htmlspecialchars(strtolower($orig_name))])) {
$old_name = $template->data['attribute_'.htmlspecialchars(strtolower($orig_name))];
}
$name = $translator->getAttributeTranslation(strtolower($orig_name)); // translate
$attributes_new[$name] = $value;
unset($attributes_new[$orig_name]);
}
// Check if consent exists // Check if consent exists
if (array_key_exists($targeted_id, $user_consent)) { if (array_key_exists($targeted_id, $user_consent)) {
$sp_status = "changed"; $sp_status = "changed";
......
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