You are here

public function DefaultTaxonomyHandler::getHandlerSettings in CMS Content Sync 8

Same name and namespace in other branches
  1. 2.1.x src/Plugin/cms_content_sync/entity_handler/DefaultTaxonomyHandler.php \Drupal\cms_content_sync\Plugin\cms_content_sync\entity_handler\DefaultTaxonomyHandler::getHandlerSettings()
  2. 2.0.x src/Plugin/cms_content_sync/entity_handler/DefaultTaxonomyHandler.php \Drupal\cms_content_sync\Plugin\cms_content_sync\entity_handler\DefaultTaxonomyHandler::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 EntityHandlerBase::getHandlerSettings

File

src/Plugin/cms_content_sync/entity_handler/DefaultTaxonomyHandler.php, line 38

Class

DefaultTaxonomyHandler
Class DefaultTaxonomyHandler.

Namespace

Drupal\cms_content_sync\Plugin\cms_content_sync\entity_handler

Code

public function getHandlerSettings($current_values, $type = 'both') {
  $options = parent::getHandlerSettings($current_values, $type);
  if ('push' !== $type) {
    $options[self::MAP_BY_LABEL_SETTING] = [
      '#type' => 'checkbox',
      '#title' => 'Map by name',
      '#default_value' => isset($current_values[self::MAP_BY_LABEL_SETTING]) ? $current_values[self::MAP_BY_LABEL_SETTING] : ($this
        ->shouldMapByLabel() ? 1 : 0),
    ];
  }
  return $options;
}