function clients_connection_drupal_services_6_2::connectionSettingsForm in Web Service Clients 7.2
Same name and namespace in other branches
- 6.2 connections/clients_drupal/clients_drupal.inc \clients_connection_drupal_services_6_2::connectionSettingsForm()
Extra form elements specific to a class's edit form.
This is the same pattern as node_form() -- just ignore the object behind the curtain ;)
This is common to versions 6-2 and 5 of Drupal Services.
Parameters
$form_state: The form state from the main form, which you probably don't need anyway.
Return value
A FormAPI form array. This will be merged in with basic data and the submit button added.
Overrides clients_connection_base::connectionSettingsForm
See also
clients_connection_form_submit()
File
- connections/
clients_drupal/ clients_drupal.inc, line 386 - Contains classes for Client connections handlers.
Class
- clients_connection_drupal_services_6_2
- Drupal client for services on a Drupal 6 site for Services 6.x-2.x.
Code
function connectionSettingsForm(&$form_state) {
$form = array();
$form['endpoint'] = array(
'#type' => 'textfield',
'#title' => t('Connection endpoint'),
'#default_value' => $this->new ? '' : $this->endpoint,
'#size' => 50,
'#maxlength' => 100,
'#description' => t('Remote service URL e.g. http://mysite.com/services/xmlrpc'),
'#required' => TRUE,
);
$form['configuration'] = array(
'#type' => 'fieldset',
'#title' => t('Configuration'),
'#collapsible' => FALSE,
'#tree' => TRUE,
);
$form['configuration']['domain'] = array(
'#type' => 'textfield',
'#title' => t('Domain'),
'#default_value' => $this->new ? '' : $this->configuration['domain'],
'#size' => 50,
'#maxlength' => 100,
'#description' => t('This should be same as the \'Domain\' field used by the Services authentication key on the server you are connecting to.'),
'#required' => TRUE,
);
$form['configuration']['servicekey'] = array(
'#type' => 'textfield',
'#title' => t('Service key'),
'#default_value' => $this->new ? '' : $this->configuration['servicekey'],
'#size' => 50,
'#maxlength' => 40,
'#attributes' => array(
'autocomplete' => 'off',
),
'#description' => t('This should be same as the \'Key\' field used by the Services authentication key on the server you are connecting to.'),
'#required' => TRUE,
);
$form['configuration']['username'] = array(
'#type' => 'textfield',
'#title' => t('Service username'),
'#default_value' => $this->new ? '' : $this->configuration['username'],
'#size' => 30,
'#maxlength' => 60,
'#attributes' => array(
'autocomplete' => 'off',
),
'#description' => t('This should be same as the username on the server you are connecting to.'),
'#required' => TRUE,
);
$password_desc = $this->new ? t('This should be same as the password on the server you are connecting to.') : t('This should be same as the password on the server you are connecting to. Leave blank unless you need to change this.');
$form['configuration']['password'] = array(
'#type' => 'password',
'#title' => t('Service password'),
'#size' => 30,
'#maxlength' => 60,
'#attributes' => array(
'autocomplete' => 'off',
),
'#description' => $password_desc,
'#required' => $this->new,
);
return $form;
}