data["srcMetadata"])'); assert('is_array($this->data["dstMetadata"])'); assert('is_string($this->data["yesTarget"])'); assert('is_array($this->data["yesData"])'); assert('is_string($this->data["noTarget"])'); assert('is_array($this->data["noData"])'); assert('is_array($this->data["attributes"])'); assert('is_array($this->data["hiddenAttributes"])'); assert('$this->data["sppp"] === false || is_string($this->data["sppp"])'); // Parse parameters if (array_key_exists('name', $this->data['srcMetadata'])) { $srcName = $this->data['srcMetadata']['name']; } elseif (array_key_exists('OrganizationDisplayName', $this->data['srcMetadata'])) { $srcName = $this->data['srcMetadata']['OrganizationDisplayName']; } else { $srcName = $this->data['srcMetadata']['entityid']; } if (is_array($srcName)) { $srcName = $this->t($srcName); } if (array_key_exists('name', $this->data['dstMetadata'])) { $dstName = $this->data['dstMetadata']['name']; } elseif (array_key_exists('OrganizationDisplayName', $this->data['dstMetadata'])) { $dstName = $this->data['dstMetadata']['OrganizationDisplayName']; } else { $dstName = $this->data['dstMetadata']['entityid']; } if (is_array($dstName)) { $dstName = $this->t($dstName); } $srcName = htmlspecialchars($srcName); $dstName = htmlspecialchars($dstName); $attributes = $this->data['attributes']; $this->data['header'] = $this->t('{consent:consent:consent_header}'); $this->data['jquery'] = array('core' => TRUE); $this->includeAtTemplateBase('includes/header.php'); ?> data['sppp'] !== false) { echo "

" . htmlspecialchars($this->t('{consent:consent:consent_privacypolicy}')) . " "; echo "" . $dstName . ""; echo "

"; } /** * Recursive attribute array listing function * * @param SimpleSAML_XHTML_Template $t Template object * @param array $attributes Attributes to be presented * @param string $nameParent Name of parent element * * @return string HTML representation of the attributes */ function present_attributes($t, $attributes, $nameParent) { $alternate = array('ssp-table--tr__odd', 'ssp-table--tr__even'); $i = 0; $summary = 'summary="' . $t->t('{consent:consent:table_summary}') . '"'; if (strlen($nameParent) > 0) { $parentStr = strtolower($nameParent) . '_'; $str = '
'; } else { $parentStr = ''; $str = '
'; } $mandatoryAttributeNames = array("sn", "mail", "givenName"); $mandatoryAttributes = array(); $editableAttributes = array("consentO"); foreach($mandatoryAttributeNames as $el) { $mandatoryAttributes[$el] = array(""); } if (empty($attributes['consentO']) && empty($attributes['o']) && empty($attributes['eduPersonScopedAffiliation']) && empty($attributes['eduPersonEntitlement'])) { $attributes['consentO'] = array(""); } $attributes = array_merge($mandatoryAttributes, $attributes); $attributeOrder = array( 'sn', 'givenName', 'displayName', 'mail', 'eduPersonScopedAffiliation', 'o', 'consentO', 'eduPersonEntitlement', 'Entitlement', 'eduPersonAssurance', 'eduPersonUniqueId', 'termsAccepted', ); $newAttributes = array(); foreach ($attributeOrder as $attrKey) { if (!empty($attributes[$attrKey])) { $newAttributes[$attrKey] = $attributes[$attrKey]; unset($attributes[$attrKey]); } } $attributes = array_merge($newAttributes, $attributes); foreach ($attributes as $name => $value) { $nameraw = $name; $affliation = $name === 'eduPersonScopedAffiliation'; $name = $t->getAttributeTranslation($parentStr . $nameraw); $missing = $value[0] === '' && in_array($nameraw, $mandatoryAttributeNames); $editable = in_array($nameraw, $editableAttributes); $isHidden = in_array($nameraw, $t->data['hiddenAttributes'], true); if ($isHidden) { continue; } if (preg_match('/^child_/', $nameraw)) { // insert child table $parentName = preg_replace('/^child_/', '', $nameraw); foreach ($value as $child) { $str .= "\n" . ''; } } else { // insert values directly if ($affliation) { $str .= "\n" . ''; } // end else: not child table } // end foreach $str .= isset($attributes)? '
' . present_attributes($t, $child, $parentName) . '
' . $t->t('{themeopenaire:consent:affiliation_input_label}'); } else { $str .= "\n" . '
' . htmlspecialchars($name); } if ($missing) { $str .= ' (*)'; } $str.= '
'; $str .= '
'; if (sizeof($value) > 1) { // we hawe several values $str .= '
    '; $index = 0; foreach ($value as $listitem) { $index++; if ($nameraw === 'jpegPhoto') { $str .= '
  • User photo
  • '; } elseif ($nameraw === 'mail') { $str .= '
  • '; $str .= '
'; if ($nameraw === 'mail') { $str .=''; $str .= $t->t('{themeopenaire:consent:multiple_mails_tip}'); $str .=''; } } elseif (isset($value[0])) { // we hawe only one value if ($nameraw === 'jpegPhoto') { $str .= 'User photo'; } elseif ($nameraw === 'termsAccepted') { $str .='
data['termsName'])) { $str .=' ' . $t->data['termsName']; } $str .= ''. $t->t('{themeopenaire:consent:terms_field_error}'). ''; $str .= '
'; if (!empty($t->data['termsUrl'])) { $str .='
'; $str .= $t->t('{themeopenaire:consent:accept_terms_tip}'); $str .= ' '.$t->t('{themeopenaire:consent:terms_link_tip}').'.
'; } } elseif ($editable) { $str .='
'; } elseif ($missing) { $str .='
'; $str .=''. $t->t('{themeopenaire:consent:mandatory_field_error}'). ''; if ($nameraw === 'mail') { $str .= ''. $t->t('{themeopenaire:consent:mail_field_error}'). ''; } $str .='
'; } else { $str .= htmlspecialchars($value[0]); } } // end of if multivalue $str .= '
'; $str .= '
':''; return $str; } echo '

' . $this->t( '{themeopenaire:consent:header}', array( 'SPNAME' => $dstName, 'IDPNAME' => $srcName)). '' . $this->t( '{themeopenaire:consent:subheader}', array( 'SPNAME' => $dstName, 'IDPNAME' => $srcName)). '' . '

'; ?>

data['usestorage']) { $checked = ($this->data['checked'] ? 'checked="checked"' : ''); echo ' ' . $this->t('{consent:consent:remember}'); } // Embed hidden fields... foreach ($this->data['yesData'] as $name => $value) { echo ''; } ?>

data['noData'] as $name => $value) { echo(''); } ?>
includeAtTemplateBase('includes/footer.php'); ?>