You are here

public function DefaultMenuLinkContentHandler::getHandlerSettings in CMS Content Sync 8

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

Class

DefaultMenuLinkContentHandler
Class DefaultMenuLinkContentHandler, providing a minimalistic implementation for menu items, making sure they're referenced correctly by UUID.

Namespace

Drupal\cms_content_sync\Plugin\cms_content_sync\entity_handler

Code

public function getHandlerSettings($current_values, $type = 'both') {
  $menus = menu_ui_get_menus();
  return [
    'ignore_unpublished' => [
      '#type' => 'checkbox',
      '#title' => 'Ignore disabled',
      '#default_value' => isset($current_values['ignore_unpublished']) && 0 === $current_values['ignore_unpublished'] ? 0 : 1,
    ],
    'restrict_menus' => [
      '#type' => 'checkboxes',
      '#title' => 'Restrict to menus',
      '#default_value' => isset($current_values['restrict_menus']) ? $current_values['restrict_menus'] : [],
      '#options' => $menus,
      '#description' => t('When no checkbox is set, menu items from all menus will be pushed/pulled.'),
    ],
  ];
}