You are here

function computing_command_form_submit in Drupal Computing 7.2

1 string reference to 'computing_command_form_submit'
computing_command_form in ./computing.admin.inc
This is similar to system_settings_form(). Make all data in 'input', and add "Add" button and other generic fields.

File

./computing.admin.inc, line 235

Code

function computing_command_form_submit($form, &$form_state) {

  // Exclude unnecessary elements.

  //form_state_values_clean($form_state);
  $input_data = NULL;
  if (isset($form_state['values']['input'])) {
    $input_data = $form_state['values']['input'];
  }
  $common_data = $form_state['values']['common'];
  $result = computing_create($common_data['application'], $common_data['command'], $common_data['label'], $input_data, $common_data);
  if ($result) {
    drupal_set_message(t('Adding new command successfully.'));
  }
  else {
    drupal_set_message(t('Cannot add new command. Please inform site administrators.'), 'error');
  }
  $form_state['redirect'] = COMPUTING_MODULE_ADMIN_PATH;
}