aboutsummaryrefslogtreecommitdiff
path: root/mod/diagnostics/start.php
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/start.php
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/start.php')
-rw-r--r--mod/diagnostics/start.php40
1 files changed, 7 insertions, 33 deletions
diff --git a/mod/diagnostics/start.php b/mod/diagnostics/start.php
index a80513b6c..b161e47c4 100644
--- a/mod/diagnostics/start.php
+++ b/mod/diagnostics/start.php
@@ -5,45 +5,23 @@
* @package ElggDiagnostics
*/
+elgg_register_event_handler('init', 'system', 'diagnostics_init');
+
/**
* Initialise the diagnostics tool
*
*/
function diagnostics_init() {
- global $CONFIG;
// Register a page handler, so we can have nice URLs
register_page_handler('diagnostics','diagnostics_page_handler');
- // Register some actions
- elgg_register_action("diagnostics/download", $CONFIG->pluginspath . "diagnostics/actions/download.php");
-}
+ // Add admin menu item
+ elgg_add_admin_menu_item('diagnostics', elgg_echo('diagnostics'), 'utilities');
-/**
- * Adding the diagnostics to the admin menu
- *
- */
-function diagnostics_pagesetup() {
- if (elgg_get_context() == 'admin' && isadminloggedin()) {
- elgg_register_menu_item('page', array(
- 'name' => 'diagnostics',
- 'title' => elgg_echo('diagnostics'),
- 'url' => 'pg/diagnostics/',
- 'context' => 'admin',
- ));
- }
-}
-
-/**
- * Diagnostics page.
- *
- * @param array $page Array of page elements, forwarded by the page handling mechanism
- */
-function diagnostics_page_handler($page) {
- global $CONFIG;
-
- // only interested in one page for now
- include($CONFIG->pluginspath . "diagnostics/index.php");
+ // Register some actions
+ $file = elgg_get_plugin_path() . "diagnostics/actions/download.php";
+ elgg_register_action("diagnostics/download", $file, 'admin');
}
/**
@@ -175,10 +153,6 @@ function diagnostics_globals_hook($hook, $entity_type, $returnvalue, $params) {
return $returnvalue;
}
-// Initialise log browser
-elgg_register_event_handler('init','system','diagnostics_init');
-elgg_register_event_handler('pagesetup','system','diagnostics_pagesetup');
-
elgg_register_plugin_hook_handler("diagnostics:report", "system", "diagnostics_basic_hook", 0); // show basics first
elgg_register_plugin_hook_handler("diagnostics:report", "system", "diagnostics_plugins_hook", 2); // Now the plugins
elgg_register_plugin_hook_handler("diagnostics:report", "system", "diagnostics_sigs_hook", 1); // Now the signatures