diff options
Diffstat (limited to 'mod/diagnostics/views')
3 files changed, 43 insertions, 20 deletions
diff --git a/mod/diagnostics/views/default/admin/utilities/diagnostics.php b/mod/diagnostics/views/default/admin/utilities/diagnostics.php new file mode 100644 index 000000000..44e6fa17b --- /dev/null +++ b/mod/diagnostics/views/default/admin/utilities/diagnostics.php @@ -0,0 +1,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; diff --git a/mod/diagnostics/views/default/diagnostics/forms/download.php b/mod/diagnostics/views/default/diagnostics/forms/download.php index cbbd414df..e5d9af557 100644 --- a/mod/diagnostics/views/default/diagnostics/forms/download.php +++ b/mod/diagnostics/views/default/diagnostics/forms/download.php @@ -1,10 +1,9 @@ <?php - /** - * Elgg diagnostics - * - * @package ElggDiagnostics - */ - - $form_body = elgg_view('input/submit', array('value' => elgg_echo('diagnostics:download'))); - echo elgg_view('input/form', array('body' => $form_body, 'action' => "action/diagnostics/download")); -?>
\ No newline at end of file +/** + * Elgg diagnostics + * + * @package ElggDiagnostics + */ + +$form_body = elgg_view('input/submit', array('value' => elgg_echo('diagnostics:download'))); +echo elgg_view('input/form', array('body' => $form_body, 'action' => "action/diagnostics/download")); diff --git a/mod/diagnostics/views/default/diagnostics/runalltests.php b/mod/diagnostics/views/default/diagnostics/runalltests.php deleted file mode 100644 index 05dd05d4d..000000000 --- a/mod/diagnostics/views/default/diagnostics/runalltests.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php - /** - * Elgg diagnostics - unit tester - * - * @package ElggDiagnostics - */ - - $form_body .= elgg_view('input/submit', array('internalname' => 'execute', 'value' => elgg_echo('diagnostics:test:executeall'))); - - echo elgg_view('input/form', array('action' => "pg/diagnostics/tests/all", 'body' => $form_body)); -?>
\ No newline at end of file |