aboutsummaryrefslogtreecommitdiff
path: root/mod/diagnostics/views
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-29 22:39:25 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-29 22:39:25 +0000
commitdcba493d8defdeb9ab6f41bf07826474bc41e9a6 (patch)
treee25c5cf752750bd021cef50a9e0c48810c0d51a9 /mod/diagnostics/views
parent7355326146c6dd1f3e54f023510095c5fb0eb51c (diff)
downloadelgg-dcba493d8defdeb9ab6f41bf07826474bc41e9a6.tar.gz
elgg-dcba493d8defdeb9ab6f41bf07826474bc41e9a6.tar.bz2
updated the diagnostics plugin to use the new admin backend
git-svn-id: http://code.elgg.org/elgg/trunk@7762 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/diagnostics/views')
-rw-r--r--mod/diagnostics/views/default/admin/utilities/diagnostics.php35
-rw-r--r--mod/diagnostics/views/default/diagnostics/forms/download.php17
-rw-r--r--mod/diagnostics/views/default/diagnostics/runalltests.php11
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