You are here

function clients_connection_edit in Web Service Clients 7

Same name and namespace in other branches
  1. 6 clients.module \clients_connection_edit()

Form builder for editing a connection.

Parameters

$cid: The id of a connection.

See also

clients_connection_form_submit()

1 string reference to 'clients_connection_edit'
clients_menu in ./clients.module
Implementation of hook_menu()

File

./clients.connection.admin.inc, line 144
clients.connection.admin.inc Page callbacks relating to client connection admin.

Code

function clients_connection_edit(&$form_state, $cid) {
  $connection = clients_connection_load($cid);
  $type = $connection->type;
  $class = 'clients_connection_' . $type;

  //dsm($connection);
  $form['type'] = array(
    '#type' => 'textfield',
    '#title' => t('Connection type'),
    '#description' => t('The type of this connection. May not be changed.'),
    '#value' => $type,
    '#size' => 50,
    '#disabled' => TRUE,
  );
  $form += call_user_func(array(
    $class,
    'connectionSettingsForm',
  ), $form_state, $type, $cid);
  $form['#connection_type'] = $type;
  $form['#connection_class'] = $class;
  $form['buttons']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save connection'),
  );

  // Add our submit handler common with the add form.
  $form['#submit'] = array(
    'clients_connection_form_submit',
  );
  return $form;
}