From 4d20274076d4cf4338531333fb4acb23a231e907 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sat, 11 Oct 2008 22:46:22 +0000 Subject: #253569 by aaron, agentrickard, and Dave Reid: Add hook_modules_X to allow modules to react when other modules are enabled, disabled, installed, or uninstalled. --- modules/simpletest/tests/system_test.module | 36 +++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'modules/simpletest/tests') diff --git a/modules/simpletest/tests/system_test.module b/modules/simpletest/tests/system_test.module index d3db9b587..188facc96 100644 --- a/modules/simpletest/tests/system_test.module +++ b/modules/simpletest/tests/system_test.module @@ -84,3 +84,39 @@ function system_test_redirect_invalid_scheme() { function system_test_destination() { return 'The destination: ' . drupal_get_destination(); } + +/** + * Implementation of hook_modules_installed(). + */ +function system_test_modules_installed($modules) { + if (in_array('aggregator', $modules)) { + drupal_set_message(t('hook_modules_installed fired for aggregator')); + } +} + +/** + * Implementation of hook_modules_enabled(). + */ +function system_test_modules_enabled($modules) { + if (in_array('aggregator', $modules)) { + drupal_set_message(t('hook_modules_enabled fired for aggregator')); + } +} + +/** + * Implementation of hook_modules_disabled(). + */ +function system_test_modules_disabled($modules) { + if (in_array('aggregator', $modules)) { + drupal_set_message(t('hook_modules_disabled fired for aggregator')); + } +} + +/** + * Implementation of hook_modules_uninstalled(). + */ +function system_test_modules_uninstalled($modules) { + if (in_array('aggregator', $modules)) { + drupal_set_message(t('hook_modules_uninstalled fired for aggregator')); + } +} -- cgit v1.2.3