You are here

function farm_client_farm_info in farmOS 7

Implements hook_farm_info().

File

modules/farm/farm_client/farm_client.module, line 44
Farm Client module.

Code

function farm_client_farm_info() {

  // Ask modules for client module info.
  $client_modules = module_invoke_all('farm_client_module_info');

  // Replace the JavaScript file path with the one that is served by Drupal.
  foreach ($client_modules as $name => &$client_module) {
    if (!empty($client_module['js'])) {
      $client_module['js'] = 'farm/client/js/' . $name . '/index.js';
    }
  }

  // Add the client module info to /farm.json.
  $info = array();
  if (!empty($client_modules)) {
    $info['client'] = array(
      'modules' => $client_modules,
    );
  }
  return $info;
}