You are here

public function NodeSaveHandler::configForm in Services Client 7.2

Configuration form.

Overrides EntitySaveHandler::configForm

File

include/event.inc, line 1144

Class

NodeSaveHandler
Adds extra logic for saving remote nodes.

Code

public function configForm(&$form, &$form_state) {
  parent::configForm($form, $form_state);
  $form['node'] = array(
    '#type' => 'fieldset',
    '#title' => t('Node configuration'),
    '#tree' => FALSE,
  );
  $form['node']['node_type'] = array(
    '#type' => 'textfield',
    '#title' => t('Node type'),
    '#description' => t('Override node type which will be sent to remote site'),
    '#default_value' => $this->config['node_type'],
  );
  $form['node']['node_author'] = array(
    '#type' => 'select',
    '#title' => t('Node author'),
    '#description' => t('How to set remote node author'),
    '#default_value' => $this->config['node_author'],
    '#options' => array(
      'value' => t('Hardcode value for each node'),
      'load_remote' => t('Map current user to remote site'),
      'no_value' => t("Don't send any author value"),
    ),
  );
  $form['node']['node_author_value'] = array(
    '#type' => 'textfield',
    '#title' => t('Hardcoded author value'),
    '#description' => t('Enter remote site UID'),
    '#default_value' => $this->config['node_author_value'],
    '#states' => array(
      'visible' => array(
        ':input[name="node_author"]' => array(
          'value' => 'value',
        ),
      ),
    ),
  );
  $form['node']['node_author_load_remote'] = array(
    '#type' => 'textfield',
    '#title' => t('Default author value'),
    '#description' => t('Enter remote site UID which will be used if mapping to remote uid will fail.'),
    '#default_value' => $this->config['node_author_load_remote'],
    '#states' => array(
      'visible' => array(
        ':input[name="node_author"]' => array(
          'value' => 'load_remote',
        ),
      ),
    ),
  );
}