From 9a789a17e1f9c389ab4ba8df57ebaf76e9d682b7 Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Thu, 7 Feb 2008 14:57:52 +0000
Subject: [PATCH] Template: Added status table template.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@263 44740490-163a-0410-bde0-09ae8108e29a
---
 templates/default/en/status-table.php | 56 +++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)
 create mode 100644 templates/default/en/status-table.php

diff --git a/templates/default/en/status-table.php b/templates/default/en/status-table.php
new file mode 100644
index 000000000..8d8612b50
--- /dev/null
+++ b/templates/default/en/status-table.php
@@ -0,0 +1,56 @@
+<?php
+$this->includeAtTemplateBase('includes/header.php');
+
+$title = $data['title'];
+$table = $data['table'];
+
+/* Identify column headings. */
+$column_titles = array();
+foreach($table as $row_title => $row_data) {
+	foreach($row_data as $ct => $data) {
+		if(!in_array($ct, $column_titles)) {
+			$column_titles[] = $ct;
+		}
+	}
+}
+
+?>
+
+<div id="content">
+<h2><?php echo htmlspecialchars($title); ?></h2>
+
+<table>
+
+<tr>
+<th></th>
+<?php
+foreach($column_titles as $ct) {
+	echo '<th>' . htmlspecialchars($ct) . '</th>' . "\n";
+}
+?>
+</tr>
+
+<?php
+foreach($table as $row_title => $row_data) {
+	echo '<tr>' . "\n";
+	echo '<th class="rowtitle">' . htmlspecialchars($row_title) . '</th>' . "\n";
+
+	foreach($column_titles as $ct) {
+		echo '<td>';
+
+		if(array_key_exists($ct, $row_data)) {
+			echo htmlspecialchars($row_data[$ct]);
+		}
+
+		echo '</td>' . "\n";
+	}
+
+	echo '</tr>' . "\n";
+}
+?>
+
+</table>
+
+<?php
+$this->includeAtTemplateBase('includes/footer.php');
+?>
\ No newline at end of file
-- 
GitLab