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

Move inline translations away from template

parent a59d2e63
No related branches found
No related tags found
No related merge requests found
...@@ -23,14 +23,12 @@ ...@@ -23,14 +23,12 @@
$hide_text = $this->t('{consentAdmin:consentadmin:hide}'); $hide_text = $this->t('{consentAdmin:consentadmin:hide}');
$attributes_text = $this->t('{consentAdmin:consentadmin:attributes_text}'); $attributes_text = $this->t('{consentAdmin:consentadmin:attributes_text}');
foreach ($spList as $spName => $spValues) { foreach ($spList as $spName => $spValues) {
$this->getTranslator()->includeInlineTranslation('spname', $spValues['name']);
$this->getTranslator()->includeInlineTranslation('spdescription', $spValues['description']);
if (!is_null($spValues['serviceurl'])) { if (!is_null($spValues['serviceurl'])) {
$htmlSpName = '<a href="'.$spValues['serviceurl'].'" style="color: black; font-weight: bold;">'.htmlspecialchars($this->t('spname', array(), false, true)).'</a>'; $htmlSpName = '<a href="'.$spValues['serviceurl'].'" style="color: black; font-weight: bold;">'.htmlspecialchars($spValues['name']).'</a>';
} else { } else {
$htmlSpName = htmlspecialchars($this->t('spname', array(), false, true)); $htmlSpName = htmlspecialchars($spValues['name']);
} }
$spDescription = htmlspecialchars($this->t('spdescription', array(), false, true)); $spDescription = htmlspecialchars($spValues['description']);
$checkedAttr = $spValues['consentStatus'] == 'ok' ? 'checked="checked"' : ''; $checkedAttr = $spValues['consentStatus'] == 'ok' ? 'checked="checked"' : '';
$consentValue = $spValues['consentValue']; $consentValue = $spValues['consentValue'];
$consentText = $spValues['consentStatus'] == 'changed' ? "attributes has changed" : ""; $consentText = $spValues['consentStatus'] == 'changed' ? "attributes has changed" : "";
......
...@@ -268,6 +268,13 @@ foreach ($all_sp_metadata as $sp_entityid => $sp_values) { ...@@ -268,6 +268,13 @@ foreach ($all_sp_metadata as $sp_entityid => $sp_values) {
// Add a URL to the service if present in metadata // Add a URL to the service if present in metadata
$sp_service_url = isset($sp_metadata['ServiceURL']) ? $sp_metadata['ServiceURL'] : null; $sp_service_url = isset($sp_metadata['ServiceURL']) ? $sp_metadata['ServiceURL'] : null;
// Translate SP name and description
$translator->includeInlineTranslation('spname', $sp_name);
$translator->includeInlineTranslation('spdescription', $sp_description);
$sp_name = $translator->getPreferredTranslation($translator->getTag('spname'));
$sp_description = $translator->getPreferredTranslation($translator->getTag('spdescription'));
// Fill out array for the template // Fill out array for the template
$sp_list[$sp_entityid] = array( $sp_list[$sp_entityid] = array(
'spentityid' => $sp_entityid, 'spentityid' => $sp_entityid,
......
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