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


$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;