t('example perm for module_test module'), ); } /** * Implements hook_system_info_alter(). * * Manipulate module dependencies to test dependency chains. */ function module_test_system_info_alter(&$info, $file, $type) { if (variable_get('dependency_test', FALSE) == 'missing dependency') { if ($file->name == 'forum') { // Make forum module depend on poll. $info['dependencies'][] = 'poll'; } elseif ($file->name == 'poll') { // Make poll depend on a made-up module. $info['dependencies'][] = 'foo'; } } elseif (variable_get('dependency_test', FALSE) == 'dependency') { if ($file->name == 'forum') { // Make the forum module depend on poll. $info['dependencies'][] = 'poll'; } elseif ($file->name == 'poll') { // Make poll depend on php module. $info['dependencies'][] = 'php'; } } if ($file->name == 'seven' && $type == 'theme') { $info['regions']['test_region'] = t('Test region'); } } /** * Implements hook_hook_info(). */ function module_test_hook_info() { $hooks['test_hook'] = array( 'group' => 'file', ); return $hooks; } /** * Implements hook_modules_enabled(). */ function module_test_modules_enabled($modules) { // Record the ordered list of modules that were passed in to this hook so we // can check that the modules were enabled in the correct sequence. variable_set('test_module_enable_order', $modules); } /** * Implements hook_modules_disabled(). */ function module_test_modules_disabled($modules) { // Record the ordered list of modules that were passed in to this hook so we // can check that the modules were disabled in the correct sequence. variable_set('test_module_disable_order', $modules); } /** * Implements hook_modules_uninstalled(). */ function module_test_modules_uninstalled($modules) { // Record the ordered list of modules that were passed in to this hook so we // can check that the modules were uninstalled in the correct sequence. variable_set('test_module_uninstall_order', $modules); }