You are here

function rotor_check_dependencies in Rotor Banner 7

Same name and namespace in other branches
  1. 6.2 rotor.install \rotor_check_dependencies()

Helper function for determining new module dependencies.

Parameters

$modules: An associative array of modules to check. Key is module name, value is human-readable name.

Return value

A string containing the error message, if any -- FALSE otherwise.

1 call to rotor_check_dependencies()
rotor_check_update_abort in ./rotor.install
Helper function for rolling back updates if dependency checks fail.

File

./rotor.install, line 163
Provides install and uninstall functions for rotor.

Code

function rotor_check_dependencies($modules) {
  $message = FALSE;
  $messages = array();
  foreach ($modules as $module => $name) {
    if (!module_exists($module)) {
      $messages[] = t('The %module module is not enabled.', array(
        '%module' => $name,
      ));
    }
  }
  if (!empty($messages)) {
    $message = t('The update was aborted for the following reasons: !messages', array(
      '!messages' => theme('item_list', $messages),
    ));
  }
  return $message;
}