aboutsummaryrefslogtreecommitdiff
path: root/mod/diagnostics/views/default/admin/utilities/diagnostics.php
blob: 44e6fa17b5aa7b9ea53ba9f7a9e7fad487721d05 (plain)
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
<?php


$title = elgg_view_title(elgg_echo('diagnostics'));

$diagnostics = "<h3>".elgg_echo('diagnostics:report')."</h3>";
$diagnostics .= elgg_echo('diagnostics:description');
$diagnostics .= elgg_view('diagnostics/forms/download');

// unit tests
$unit_tests = "<h3>".elgg_echo('diagnostics:unittester')."</h3>";
$unit_tests .= "<p>" . elgg_echo('diagnostics:unittester:description') . "</p>";
$unit_tests .= "<p>" . elgg_echo('diagnostics:unittester:warning') . "</p>";

if (isset($CONFIG->debug)) {
	// create a button to run tests
	$params = array(
		'text' => elgg_echo('diagnostics:test:executeall'),
		'href' => elgg_get_site_url() . 'engine/tests/suite.php',
		'class' => 'elgg-submit-button',
	);
	$unit_tests .= elgg_view('output/url', $params);
} else {
	// no tests when not in debug mode
	$unit_tests .= elgg_echo('diagnostics:unittester:debug');
}

// display admin body
echo <<<HTML
$title
<div class="admin_settings diagnostics">
	$diagnostics
	$unit_tests
</div>
HTML;