ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
consentadmin.php
Go to the documentation of this file.
1 <?php $this->includeAtTemplateBase('includes/header.php'); ?>
2 <!-- default theme -->
3 
4 <script>
5  function setConsentText(consentStatus, show_spid) {
6  document.getElementById("consentText" + show_spid).innerHTML = consentStatus;
7  }
8 </script>
9 
10 <script src="includes/consentSimpleAjax.js"></script>
11 
12 <style>
13 .caSPName {
14  font-weight: bold;
15 }
16 
17 td.caSPName {
18  vertical-align: top;
19 }
20 
21 .caAllowed {
22 
23 }
24 
25 td.caAllowed {
26  vertical-align: top;
27 }
28 
29 td.caAttributes {
30 
31 }
32 
33 tr.row0 td {
34  background-color: #888888;
35  color: black;
36 }
37 
38 tr.row1 td {
39  background-color: #aaaaaa;
40  color: black;
41 }
42 
43 a.orange {
44  color: #ffd633;
45 }
46 
47 span.showhide {
48 
49 }
50 </style>
51 
52 
53  <!-- <h2><?php if (isset($this->data['header'])) { echo $this->t($this->data['header']); } else { echo "Some error occurred"; } ?></h2> -->
54  <h2><?php echo $this->t('{consentAdmin:consentadmin:consentadmin_header}') ?></h2>
55  <p>
56  <?php echo $this->t('{consentAdmin:consentadmin:consentadmin_description1}') ?> </p>
57 
58 
59  <table>
60  <tr>
61  <th width="80%"><?php echo $this->t('{consentAdmin:consentadmin:service_provider_header}') ?></th>
62  <th width="140"><?php echo $this->t('{consentAdmin:consentadmin:status_header}') ?></th>
63  </tr>
64  <?php
65  $spList = $this->data['spList'];
67  $show_text = $this->t('{consentAdmin:consentadmin:show}');
68  $hide_text = $this->t('{consentAdmin:consentadmin:hide}');
69  $attributes_text = $this->t('{consentAdmin:consentadmin:attributes_text}');
70  foreach ($spList AS $spName => $spValues) {
71  $this->getTranslator()->includeInlineTranslation('spname', $spValues['name']);
72  $this->getTranslator()->includeInlineTranslation('spdescription', $spValues['description']);
73  if (!is_null($spValues['serviceurl'])) {
74  $htmlSpName = '<a href="' . $spValues['serviceurl'] . '" style="color: black; font-weight: bold;">' . htmlspecialchars($this->t('spname', array(), false, true)) . '</a>';
75  } else {
76  $htmlSpName = htmlspecialchars($this->t('spname', array(), false, true));
77  }
78  $spDescription = htmlspecialchars($this->t('spdescription',array(), false, true));
79  $checkedAttr = $spValues['consentStatus'] == 'ok' ? 'checked="checked"' : '';
80  $consentValue = $spValues['consentValue'];
81  $consentText = $spValues['consentStatus'] == 'changed' ? "attributes has changed" : "";
82  $row_class = ($show_spid % 2) ? "row0" : "row1";
83  echo <<<TRSTART
84 <tr class="$row_class">
85 <td>
86  <table>
87  <tr class="$row_class"><td><span class='caSPName'><span title='$spDescription'>$htmlSpName</span>&emsp;<span style="font-size: 80%;"onclick="javascript:toggleShowAttributes('$show_spid');"><span id='showing_$show_spid'>$show_text</span><span id='hiding_$show_spid' style='display:none;'>$hide_text</span> $attributes_text</span></span></td>
88  <tr><td colspan="2" class="caAttributes"><div id="attributes_$show_spid" style="display: none;">
89 TRSTART;
90  $attributes = $spValues['attributes_by_sp'];
91  if ($this->data['showDescription']) {
92  echo '<p>' . $this->t('{consentAdmin:consentadmin:consentadmin_purpose}') . ' ' . $spDescription . '</p>';
93  }
94  echo "\n<ul>\n";
95  foreach ($attributes AS $name => $value) {
96 
97  if (isset($this->data['attribute_' . htmlspecialchars(strtolower($name)) ])) {
98  $name = $this->data['attribute_' . htmlspecialchars(strtolower($name))];
99  }
100  $name = $this->getTranslator()->getAttributeTranslation($name); // translate
101  if (sizeof($value) > 1) {
102  echo "<li>" . htmlspecialchars($name) . ":\n<ul>\n";
103  foreach ($value AS $v) {
104  echo '<li>' . htmlspecialchars($v) . "</li>\n";
105  }
106  echo "</ul>\n</li>\n";
107  } else {
108  echo "<li>" . htmlspecialchars($name) . ": " . htmlspecialchars($value[0]) . "</li>\n";
109  }
110  }
111  echo "</ul>";
112  echo <<<TRSTART
113  </div></td></tr>
114  </table>
115 </td>
116 
117 <td class='caAllowed'><input onclick="javascript:checkConsent(this.value, $show_spid, this.checked)" value='$consentValue' type='checkbox' $checkedAttr /><span id="consentText$show_spid">$consentText</span></td>
118 TRSTART;
119  echo "</tr>\n";
120  $show_spid++;
121  }
122  ?>
123  </table>
124 
125  <p>
126  <?php echo $this->t('{consentAdmin:consentadmin:consentadmin_description2}') ?> </p>
127 
128  <h2>Logout</h2>
129 
130  <p><a href="<?php echo \SimpleSAML\Module::getModuleURL('consentAdmin/consentAdmin.php', array('logout' => 1)); ?>">Logout</a></p>
131 
132 <?php $this->includeAtTemplateBase('includes/footer.php');
if(PHP_SAPI !='cli') color
Definition: langcheck.php:120
$attributes_text
"color:#CC0000 style
Definition: example_001.php:92
$show_spid
input
Definition: langcheck.php:166
$hide_text
if(array_key_exists('yes', $_REQUEST)) $attributes
Definition: getconsent.php:85
$show_text
$this data['403_header']