You are here

function clients_connection_drupal_services::getTestOperations in Web Service Clients 7.2

Same name and namespace in other branches
  1. 6.2 connections/clients_drupal/clients_drupal.inc \clients_connection_drupal_services::getTestOperations()

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::getTestOperations()
clients_connection_drupal_services_5::getTestOperations in connections/clients_drupal/clients_drupal.inc
Provide buttons for the connection testing page.
1 method overrides clients_connection_drupal_services::getTestOperations()
clients_connection_drupal_services_5::getTestOperations in connections/clients_drupal/clients_drupal.inc
Provide buttons for the connection testing page.

File

connections/clients_drupal/clients_drupal.inc, line 55
Contains classes for Client connections handlers.

Class

clients_connection_drupal_services
Base class for Drupal client connections.

Code

function getTestOperations($form_state, $connection_name) {
  $buttons['connect'] = array(
    '#value' => t('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' => t('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' => t('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' => t('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;
}