You are here

function computing_fetch_data in Drupal Computing 7.2

A helper function to get command definition in hook_computing_data(). No need to use cache because it's not going to be accessed a lot.

3 calls to computing_fetch_data()
computing_action_handle_output in ./computing.rules.inc
computing_add_command in ./computing.admin.inc
Generate a form for a command. We expect this function will create a computing record.
computing_list_command_page in ./computing.admin.inc
Generate the "Command" page. Code following the logic of system_admin_config_page().

File

./computing.module, line 591

Code

function computing_fetch_data($app_name = NULL, $command_name = NULL) {
  $computing_data = module_invoke_all("computing_data");
  drupal_alter('computing_data', $computing_data);
  if ($app_name != NULL && $command_name != NULL) {
    if (isset($computing_data[$app_name][$command_name]) && is_array($computing_data[$app_name][$command_name])) {

      // check data and return modified data.
      $command_data = $computing_data[$app_name][$command_name];
      if (empty($command_data['title'])) {
        $command_data['title'] = strtoupper($command_name);
      }
      if (empty($command_data['description'])) {
        $command_data['description'] = t('A command for !command', array(
          '!command' => $command_data['title'],
        ));
      }
      return $command_data;
    }

    // all other cases return FALSE.
    return FALSE;
  }
  else {
    return $computing_data;
  }
}