Skip to content
Snippets Groups Projects
Unverified Commit b813e75f authored by Tim van Dijen's avatar Tim van Dijen Committed by GitHub
Browse files

Merge pull request #896 from tvdijen/consentadmin-assets

consentAdmin: Extract CSS/JS from template file
parents d5d067b8 37648fc3
No related branches found
No related tags found
No related merge requests found
<?php $this->includeAtTemplateBase('includes/header.php'); ?> <?php
<!-- default theme --> $this->data['head'] = '<link rel="stylesheet" type="text/css" href="'.SimpleSAML\Module::getModuleURL("consentAdmin/assets/css/consentAdmin.css").'" />'."\n";
$this->data['head'] .= '<script src="'.SimpleSAML\Module::getModuleURL("consentAdmin/assets/js/consentAdmin.js").'"></script>';
<script> $this->data['head'] .= '<script src="'.SimpleSAML\Module::getModuleURL("consentAdmin/assets/js/consentSimpleAjax.js").'"></script>';
function setConsentText(consentStatus, show_spid) { // default theme
document.getElementById("consentText" + show_spid).innerHTML = consentStatus; $this->includeAtTemplateBase('includes/header.php');
} ?>
</script>
<script src="includes/consentSimpleAjax.js"></script>
<style>
.caSPName {
font-weight: bold;
}
td.caSPName {
vertical-align: top;
}
.caAllowed {
}
td.caAllowed {
vertical-align: top;
}
td.caAttributes {
}
tr.row0 td {
background-color: #888888;
color: black;
}
tr.row1 td {
background-color: #aaaaaa;
color: black;
}
a.orange {
color: #ffd633;
}
span.showhide {
}
</style>
<!-- <h2><?php if (isset($this->data['header'])) { echo $this->t($this->data['header']); } else { echo "Some error occurred"; } ?></h2> --> <!-- <h2><?php if (isset($this->data['header'])) { echo $this->t($this->data['header']); } else { echo "Some error occurred"; } ?></h2> -->
<h2><?php echo $this->t('{consentAdmin:consentadmin:consentadmin_header}') ?></h2> <h2><?php echo $this->t('{consentAdmin:consentadmin:consentadmin_header}') ?></h2>
<p> <p>
...@@ -67,7 +22,7 @@ span.showhide { ...@@ -67,7 +22,7 @@ span.showhide {
$show_text = $this->t('{consentAdmin:consentadmin:show}'); $show_text = $this->t('{consentAdmin:consentadmin:show}');
$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('spname', $spValues['name']);
$this->getTranslator()->includeInlineTranslation('spdescription', $spValues['description']); $this->getTranslator()->includeInlineTranslation('spdescription', $spValues['description']);
if (!is_null($spValues['serviceurl'])) { if (!is_null($spValues['serviceurl'])) {
...@@ -92,7 +47,7 @@ TRSTART; ...@@ -92,7 +47,7 @@ TRSTART;
echo '<p>'.$this->t('{consentAdmin:consentadmin:consentadmin_purpose}').' '.$spDescription.'</p>'; echo '<p>'.$this->t('{consentAdmin:consentadmin:consentadmin_purpose}').' '.$spDescription.'</p>';
} }
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))])) { if (isset($this->data['attribute_'.htmlspecialchars(strtolower($name))])) {
$name = $this->data['attribute_'.htmlspecialchars(strtolower($name))]; $name = $this->data['attribute_'.htmlspecialchars(strtolower($name))];
...@@ -100,7 +55,7 @@ TRSTART; ...@@ -100,7 +55,7 @@ TRSTART;
$name = $this->getTranslator()->getAttributeTranslation($name); // translate $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) {
echo '<li>'.htmlspecialchars($v)."</li>\n"; echo '<li>'.htmlspecialchars($v)."</li>\n";
} }
echo "</ul>\n</li>\n"; echo "</ul>\n</li>\n";
......
.caSPName {
font-weight: bold;
}
td.caSPName {
vertical-align: top;
}
td.caAllowed {
vertical-align: top;
}
td.caAttributes {
}
tr.row0 td {
background-color: #888888;
color: black;
}
tr.row1 td {
background-color: #aaaaaa;
color: black;
}
a.orange {
color: #ffd633;
}
function setConsentText(consentStatus, show_spid) {
document.getElementById("consentText" + show_spid).innerHTML = consentStatus;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment