Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect which other modules are enabled in a new Drupal module

I'm creating a Drupal module which doesn't necessarily depend on other modules, but could offer other options if, for example, the Path module is enabled.

What I'd like to know, and can't seem to find by searching, is whether it is possible to detect which modules are currently enabled from another module so that that module can offer options which use those modules?

like image 397
HorusKol Avatar asked Oct 06 '09 23:10

HorusKol


1 Answers

  • http://api.drupal.org/api/function/module_exists/6
  • http://api.drupal.org/api/function/module_list/6

You can also check like this:

if(function_exists('a_function_you_know_the_module_provides')) { }
like image 161
ceejayoz Avatar answered Sep 28 '22 10:09

ceejayoz