You are here

function services_client_wizard_form_details in Services Client 7.2

Form step 1; Initial event details.

1 string reference to 'services_client_wizard_form_details'
services_client_wizard in ./services_client.admin.inc
Create new mapping wizard.

File

./services_client.admin.inc, line 117
Administration pages for configuring services client module.

Code

function services_client_wizard_form_details($form, &$form_state) {

  // Initialize empty object.
  $_SESSION['services_client_wizard'] = new stdClass();
  $form['connection'] = array(
    '#type' => 'select',
    '#title' => t('Connection'),
    '#options' => array_map(function ($item) {
      return $item->name;
    }, services_client_connection_load_all()),
    '#description' => t('Select remote connection where will be new object mapped. !add_connection', array(
      '!add_connection' => l(t('Add connection'), 'admin/structure/services_client/connection/add', array(
        'query' => drupal_get_destination(),
      )),
    )),
  );
  $form['title'] = array(
    '#type' => 'textfield',
    '#title' => t('Name'),
    '#description' => t('Enter event administrative name.'),
  );
  $form['name'] = array(
    '#type' => 'machine_name',
    '#machine_name' => array(
      'exists' => function ($name) {
        ctools_include('export');
        return ctools_export_crud_load('services_client_connection_event', $name);
      },
      'source' => array(
        'title',
      ),
    ),
  );
  $form['handler'] = array(
    '#type' => 'select',
    '#title' => t('Handler'),
    '#options' => services_client_get_plugins('event_handler', TRUE, function ($item) {
      return $item['type'] == 'save';
    }),
  );
  return $form;
}