You are here

function clients_connection_drupal_services_6_2::getTestOperations in Web Service Clients 7

Provide buttons for the connection testing page.

Parameters

$form_state: This is passed in so you can set defaults based on user input.

Overrides clients_connection_base::getTestOperations

1 call to clients_connection_drupal_services_6_2::getTestOperations()
clients_connection_drupal_services_5::getTestOperations in backends/clients_drupal/clients_drupal.inc
Provide buttons for the connection testing page.
1 method overrides clients_connection_drupal_services_6_2::getTestOperations()
clients_connection_drupal_services_5::getTestOperations in backends/clients_drupal/clients_drupal.inc
Provide buttons for the connection testing page.

File

backends/clients_drupal/clients_drupal.inc, line 503
Defines methods and calls to Drupal services

Class

clients_connection_drupal_services_6_2
Drupal client for services on a Drupal 6 site for Services 6.x-2.x.

Code

function getTestOperations($form_state, $cid) {
  $buttons['connect'] = array(
    '#value' => 'Test connection',
    '#type' => 'submit',
    //'#name' => 'connect', // wtf does this do?
    '#action_type' => 'method',
    '#action_submit' => 'testConnectionConnect',
    '#description' => t('Test the connection settings by calling system.connect on the remote server.'),
  );
  $buttons['login'] = array(
    '#value' => 'Test user login',
    '#type' => 'submit',
    //'#name' => 'login',
    '#action_type' => 'method',
    '#action_submit' => 'testConnectionLogin',
    '#description' => t('Test the remote user settings and by calling user.login on the remote server.'),
  );
  $buttons['node_load'] = array(
    '#type' => 'fieldset',
  );
  $buttons['node_load']['nid'] = array(
    '#type' => 'textfield',
    '#title' => 'Node ID',
    '#size' => 6,
    '#default_value' => isset($form_state['values']['buttons']['node_load']['nid']) ? $form_state['values']['buttons']['node_load']['nid'] : NULL,
  );
  $buttons['node_load']['button'] = array(
    '#value' => 'Test node retrieval',
    '#type' => 'submit',
    //'#name' => 'login',

    // TODO: tidy up these method names!
    '#action_type' => 'method',
    '#action_submit' => 'testConnectionNodeLoad',
    '#action_validate' => 'testConnectionNodeLoadValidate',
    '#description' => t('Attempt to load a remote node.'),
  );
  return $buttons;
}