aboutsummaryrefslogtreecommitdiff
path: root/mod/diagnostics/views/default/admin/develop_utilities/diagnostics.php
blob: b41907da2b36813f848b6a28a6642e0b4620c0ce (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
<?php
/**
 * Diagnostics admin page
 */

$diagnostics_title = elgg_echo('diagnostics:report');
$diagnostics = elgg_echo('diagnostics:description');
$diagnostics .= elgg_view_form('diagnostics/download');

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

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

// display admin body
echo elgg_view_module('inline', $diagnostics_title, $diagnostics);
echo elgg_view_module('inline', $unit_tests_title, $unit_tests);