You are here

public function DefaultNodeHandler::getHandlerSettings in CMS Content Sync 2.1.x

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

Class

DefaultNodeHandler
Class DefaultNodeHandler, providing proper handling for published/unpublished content.

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);

  // @todo Move to default handler for all entities that can be published.
  $options['ignore_unpublished'] = [
    '#type' => 'checkbox',
    '#title' => 'Ignore unpublished content',
    '#default_value' => isset($current_values['ignore_unpublished']) && 0 === $current_values['ignore_unpublished'] ? 0 : 1,
  ];
  $options['allow_explicit_unpublishing'] = [
    '#type' => 'checkbox',
    '#title' => 'Allow explicit unpublishing',
    '#default_value' => isset($current_values['allow_explicit_unpublishing']) && 0 === $current_values['allow_explicit_unpublishing'] ? 0 : 1,
  ];
  return $options;
}