Skip to content
Snippets Groups Projects
Commit b87e010c authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg
Browse files

General improvements, visual, css and html and a assert() bugfix. Thanks to...

General improvements, visual, css and html and a assert() bugfix. Thanks to Thomas G for part of this patch.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1054 44740490-163a-0410-bde0-09ae8108e29a
parent 8c0131ca
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,7 @@ 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('$this->data["sppp"] === FALSE || is_string($this->data["spp"])');
assert('$this->data["sppp"] === FALSE || is_string($this->data["sppp"])');
/* Parse parameters. */
......@@ -107,68 +107,91 @@ $this->includeAtTemplateBase('includes/header.php');
)) ?>
</p>
<form style="display: inline; margin: 0px; padding: 0px" action="<?php echo htmlspecialchars($this->data['yesTarget']); ?>">
<?php
if ($this->data['sppp'] !== FALSE) {
echo "<p>" . htmlspecialchars($this->t('consent_privacypolicy')) . " ";
echo "<a target='_new_window' href='" . htmlspecialchars($this->data['sppp']) . "'>" . htmlspecialchars($dstName) . "</a>";
echo "</p>";
}
// Embed hidden fields...
foreach ($this->data['yesData'] as $name => $value) {
echo('<input type="hidden" name="' . htmlspecialchars($name) . '" value="' . htmlspecialchars($value) . '" />');
}
?>
<p style="margin: 1em">
<input type="submit" name="yes" id="yesbutton" value="<?php echo htmlspecialchars($this->t('{consent:yes}')) ?>" />
<form style="display: inline" action="<?php echo htmlspecialchars($this->data['yesTarget']); ?>">
<input type="submit" name="yes" id="yesbutton" value="<?php echo $this->t('{consent:yes}') ?>" />
<?php
if ($this->data['usestorage']) {
$checked = ($this->data['checked'] ? 'checked="checked"' : '');
echo('<input type="checkbox" name="saveconsent" ' . $checked . ' value="1" /> ' . $this->t('{consent:remember}') . '');
}
?>
foreach ($this->data['yesData'] as $name => $value) {
echo('<input type="hidden" name="' . htmlspecialchars($name) . '" value="' . htmlspecialchars($value) . '" />');
}
if ($this->data['usestorage']) {
$checked = ($this->data['checked'] ? 'checked="checked"' : '');
echo('<input type="checkbox" name="saveconsent" ' . $checked . ' value="1" /> ' . $this->t('{consent:remember}'));
<input type="submit" name="no" id="nobutton" value="<?php echo htmlspecialchars($this->t('{consent:no}')) ?>" />
</p>
<!-- /form -->
<?php
if ($this->data['sppp'] !== FALSE) {
echo "<p>" . htmlspecialchars($this->t('{consent:consent_privacypolicy}')) . " ";
echo "<a target='_new_window' href='" . htmlspecialchars($this->data['sppp']) . "'>" . htmlspecialchars($dstName) . "</a>";
echo "</p>";
}
?>
</form>
<form style="display: inline; margin-left: .5em;" action="<?php echo htmlspecialchars($this->data['noTarget']); ?>" method="GET">
<!-- form style="display: inline; margin-left: .5em;" action="<?php echo htmlspecialchars($this->data['noTarget']); ?>" method="GET" -->
<?php
foreach ($this->data['noData'] as $name => $value) {
echo('<input type="hidden" name="' . htmlspecialchars($name) . '" value="' . htmlspecialchars($value) . '" />');
}
?>
<input type="submit" id="nobutton" value="<?php echo htmlspecialchars($this->t('{consent:no}')) ?>" />
<fieldset>
<legend id="attribute_switch"> » <?php echo $this->t('{consent:consent_attributes_header}'); ?></legend>
<div id="addattributes"><a id="addattributesb"><?php echo $this->t('{consent:show_attributes}'); ?></a></div>
<table id="table_with_attributes" class="attributes">
<?php
$alternate = array('odd', 'even'); $i = 0;
foreach ($attributes as $name => $value) {
$nameTag = '{attributes:attribute_' . strtolower($name) . '}';
if ($this->getTag($nameTag) !== NULL) {
$name = $this->t($nameTag);
}
if (sizeof($value) > 1) {
echo '<tr class="' . $alternate[($i++ % 2)] . '"><td class="attrname">' . htmlspecialchars($name) . '</td><td class="attrvalue"><ul>';
foreach ($value AS $v) {
echo '<li>' . htmlspecialchars($v) . '</li>';
<!-- Show attributes that are sent to the service in a fieldset.
This fieldset is not expanded by default, but can be shown by clicking on the legend.
-->
<fieldset>
<legend id="attribute_switch"> » <?php echo $this->t('{consent:consent_attributes_header}'); ?></legend>
<div id="addattributes"><a id="addattributesb"><?php echo $this->t('{consent:show_attributes}'); ?></a></div>
<table id="table_with_attributes" class="attributes">
<?php
$alternate = array('odd', 'even'); $i = 0;
foreach ($attributes as $name => $value) {
$nameTag = '{attributes:attribute_' . str_replace(":", "_", strtolower($name) ) . '}';
if ($this->getTag($nameTag) !== NULL) {
$name = $this->t($nameTag);
}
if (sizeof($value) > 1) {
echo '<tr class="' . $alternate[($i++ % 2)] . '"><td class="attrname">' . htmlspecialchars($name) . '</td><td class="attrvalue"><ul>';
foreach ($value AS $v) {
echo '<li>' . htmlspecialchars($v) . '</li>';
}
echo '</ul></td></tr>';
} else {
echo '<tr class="' . $alternate[($i++ % 2)] . '"><td class="attrname">' . htmlspecialchars($name) . '</td><td class="attrvalue">' . htmlspecialchars($value[0]) . '</td></tr>';
}
echo '</ul></td></tr>';
} else {
echo '<tr class="' . $alternate[($i++ % 2)] . '"><td class="attrname">' . htmlspecialchars($name) . '</td><td class="attrvalue">' . htmlspecialchars($value[0]) . '</td></tr>';
echo("\n");
}
}
?>
</table>
</fieldset>
<!-- end attribute view -->
?>
</table>
</fieldset>
</form>
<?php
$this->includeAtTemplateBase('includes/footer.php');
......
......@@ -28,7 +28,7 @@ fieldset legend:hover {
}
table.attributes {
width: 100%;
margin: 0px 0px 1em 0px;
margin: 0px;
border: 0px;
border-collapse: collapse;
}
......@@ -51,5 +51,7 @@ table.attributes tr td {
vertical-align: top;
}
table#table_with_attributes tr:last-child td {
border-bottom: none;
}
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