You are here

public function DefaultLinkHandler::getHandlerSettings in CMS Content Sync 2.0.x

Same name and namespace in other branches
  1. 8 src/Plugin/cms_content_sync/field_handler/DefaultLinkHandler.php \Drupal\cms_content_sync\Plugin\cms_content_sync\field_handler\DefaultLinkHandler::getHandlerSettings()
  2. 2.1.x src/Plugin/cms_content_sync/field_handler/DefaultLinkHandler.php \Drupal\cms_content_sync\Plugin\cms_content_sync\field_handler\DefaultLinkHandler::getHandlerSettings()

Get the handler settings.

Return the actual form elements for any additional settings for this handler.

Parameters

array $current_values: The current values that the user set, if any

string $type:: One of 'pull', 'push', 'both'

Return value

array

Overrides FieldHandlerBase::getHandlerSettings

File

src/Plugin/cms_content_sync/field_handler/DefaultLinkHandler.php, line 38

Class

DefaultLinkHandler
Providing a minimalistic implementation for any field type.

Namespace

Drupal\cms_content_sync\Plugin\cms_content_sync\field_handler

Code

public function getHandlerSettings($current_values, $type = 'both') {
  $options = [];
  if ('pull' !== $type) {
    $options['export_as_absolute_url'] = [
      '#type' => 'checkbox',
      '#title' => 'Push as absolute URL',
      '#default_value' => isset($current_values['export_as_absolute_url']) ? $current_values['export_as_absolute_url'] : false,
    ];
  }
  return array_merge(parent::getHandlerSettings($current_values, $type), $options);
}