You are here

function computing_add_command in Drupal Computing 7.2

Generate a form for a command. We expect this function will create a computing record.

Parameters

$app_name:

$command_name:

Return value

array|mixed|void

1 string reference to 'computing_add_command'
computing_menu in ./computing.module
Implements hook_menu().

File

./computing.admin.inc, line 119

Code

function computing_add_command($app_name, $command_name) {
  $command_data = computing_fetch_data($app_name, $command_name);
  if (!$command_data) {
    return drupal_not_found();
  }
  if (!isset($command_data['application'])) {
    $command_data['application'] = $app_name;
  }
  if (!isset($command_data['command'])) {
    $command_data['command'] = $command_name;
  }

  // load file if necessary.
  if (isset($command_data['file']) && is_array($command_data['file'])) {
    call_user_func_array('module_load_include', $command_data['file']);
  }
  $form_callback = isset($command_data['form callback']) && function_exists($command_data['form callback']) ? $command_data['form callback'] : 'computing_command_form';
  return drupal_get_form($form_callback, $command_data);
}