Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
$this->data['header'] = 'Configuration check';
if(array_key_exists('file', $this->data)) {
$this->data['header'] .= ' - ' . htmlspecialchars($this->data['file']);
}
$this->includeAtTemplateBase('includes/header.php');
?>
<div id="content">
<h2><?php echo $this->data['header']; ?></h2>
<?php
if(array_key_exists('files', $this->data)) {
/* File list. */
echo('<p>Select configuration file to check:</p>');
echo('<ul>');
foreach($this->data['files'] as $file) {
$fileName = htmlspecialchars($file['name']);
if($file['available']) {
$fileUrl = htmlspecialchars($this->data['url'] . '?file=' . urlencode($file['name']));
echo('<li><a href="' . $fileUrl . '">' . $fileName . '</a></li>');
} else {
$reason = htmlspecialchars($file['reason']);
echo('<li>' . $fileName . ' - ' . $reason . '</li>');
}
}
echo('</ul>');
} else {
/* File details. */
$notices = $this->data['notices'];
$missing = $this->data['missing'];
$superfluous = $this->data['superfluous'];
if(count($notices) > 0) {
echo('<h3>Notices</h3>');
echo('<ul>');
foreach($notices as $i) {
$type = $i['type'];
if($type === 'error') {
$image = 'bomb.png';
} elseif($type === 'warning') {
$image = 'caution.png';
}
$imageUrl = '/' . $this->data['baseurlpath'] . 'resources/icons/' . $image;
echo('<p>');
echo('<img style="display: inline; float: left; width: 1.7em; height: 1.7em;" src="' . htmlspecialchars($imageUrl) . '" alt="' . htmlspecialchars($type) . '" />');
echo(htmlspecialchars($i['message']));
echo('</p>');
}
echo('</ul>');
}
if(count($missing) > 0) {
echo('<h3>Options missing from config file</h3>');
echo('<ul>');
foreach($missing as $i) {
echo('<li>' . htmlspecialchars($i) . '</li>');
}
echo('</ul>');
}
if(count($superfluous) > 0) {
echo('<h3>Superfluous options in config file</h3>');
echo('<ul>');
foreach($superfluous as $i) {
echo('<li>' . htmlspecialchars($i) . '</li>');
}
echo('</ul>');
}
if(count($notices) === 0 && count($missing) === 0 && count($superfluous) === 0) {
echo('<p>No errors found.</p>');
}
echo('<p><a href="' . htmlspecialchars($this->data['url']) . '">Go back to the file list</a></p>');
}
$this->includeAtTemplateBase('includes/footer.php');
?>