From df4bbb9e79c69b31b9b6b696bcb6f4773508d3f0 Mon Sep 17 00:00:00 2001 From: moyooo Date: Tue, 30 Oct 2012 09:23:30 +0000 Subject: [PATCH] add status hook git-svn-id: https://forge.glpi-project.org/svn/example/trunk@205 349b9182-4a13-0410-896f-e5e9767dd1b3 --- hook.php | 16 ++++++++++++++++ setup.php | 2 ++ 2 files changed, 18 insertions(+) diff --git a/hook.php b/hook.php index cc64124..88eb873 100644 --- a/hook.php +++ b/hook.php @@ -691,4 +691,20 @@ function plugin_retrieve_more_data_from_ldap_example(array $datas) { function plugin_retrieve_more_field_from_ldap_example($fields) { return $fields; } + +// Check to add to status page +function plugin_example_Status($param) { + // Do checks (no check for example) + $ok = true; + echo "example plugin: example"; + if ($ok) { + echo "_OK"; + } else { + echo "_PROBLEM"; + // Only set ok to false if trouble (global status) + $param['ok'] = false; + } + echo "\n"; + return $param; +} ?> \ No newline at end of file diff --git a/setup.php b/setup.php index d71ef92..f5e31a7 100755 --- a/setup.php +++ b/setup.php @@ -164,6 +164,8 @@ function plugin_init_example() { $PLUGIN_HOOKS['post_init']['example'] = 'plugin_example_postinit'; + $PLUGIN_HOOKS['status']['example'] = 'plugin_example_Status'; + // CSRF compliance : All actions must be done via POST and forms closed by Html::closeForm(); $PLUGIN_HOOKS['csrf_compliant']['example'] = true; }