You are here

public function deploy_ui_endpoint::edit_form_authenticator in Deploy - Content Staging 7.3

Same name and namespace in other branches
  1. 7.2 modules/deploy_ui/plugins/export_ui/deploy_ui_endpoint.class.php \deploy_ui_endpoint::edit_form_authenticator()

Form for editing authentication configuration.

File

modules/deploy_ui/plugins/export_ui/deploy_ui_endpoint.class.php, line 123
CTools export UI implementation for deploy endpoints.

Class

deploy_ui_endpoint
Deploy endpoint UI class that extends CTools Export UI.

Code

public function edit_form_authenticator(&$form, &$form_state) {
  $item = $form_state['item'];
  if (!is_array($item->authenticator_config)) {
    $item->authenticator_config = unserialize($item->authenticator_config);
  }
  $service = new $item->service_plugin((array) $item->service_config);

  // Create the authenticator object.
  $authenticator = new $item->authenticator_plugin($service, (array) $item->authenticator_config);
  $form['authenticator_config'] = $authenticator
    ->configForm($form_state);
  if (!empty($form['authenticator_config'])) {
    $form['authenticator_config']['#tree'] = TRUE;
  }
  else {
    $form['authenticator_config'] = array(
      '#type' => 'markup',
      '#markup' => '<p>' . t('There are no settings for this authenticator plugin.') . '</p>',
    );
  }
}