You are here

function _opigno_lms_install_module_has_dependent in Opigno LMS 7

Check if a module has some dependencies

1 call to _opigno_lms_install_module_has_dependent()
opigno_lms_update_7112 in ./opigno_lms.install
Change the modules used for discussing with the LRS (learning locker -> opigno tincan api)

File

./opigno_lms.install, line 1140
Install, update and uninstall functions for the Opigno LMS installation profile.

Code

function _opigno_lms_install_module_has_dependent($module_name, $modules_excluded, $rebuild_modules_list = false) {

  // Get all the modules
  $modules_data =& drupal_static(__FUNCTION__);
  if (!isset($modules_data) || $rebuild_modules_list) {
    $modules_data = system_rebuild_module_data();
  }
  if (isset($modules_data[$module_name]->required_by)) {
    $dependent_modules = array_keys($modules_data[$module_name]->required_by);
    foreach ($dependent_modules as $dependent_module) {
      if (!in_array($dependent_module, $modules_excluded) && module_exists($dependent_module)) {
        return true;
      }
    }
  }
  return false;
}