You are here

protected function AssignmentFormBase::setConfigTypeSelect in Features 8.3

Same name and namespace in other branches
  1. 8.4 modules/features_ui/src/Form/AssignmentFormBase.php \Drupal\features_ui\Form\AssignmentFormBase::setConfigTypeSelect()

Adds configuration types checkboxes.

6 calls to AssignmentFormBase::setConfigTypeSelect()
AssignmentBaseForm::buildForm in modules/features_ui/src/Form/AssignmentBaseForm.php
Form constructor.
AssignmentCoreForm::buildForm in modules/features_ui/src/Form/AssignmentCoreForm.php
Form constructor.
AssignmentExcludeForm::buildForm in modules/features_ui/src/Form/AssignmentExcludeForm.php
Form constructor.
AssignmentOptionalForm::buildForm in modules/features_ui/src/Form/AssignmentOptionalForm.php
Form constructor.
AssignmentProfileForm::buildForm in modules/features_ui/src/Form/AssignmentProfileForm.php
Form constructor.

... See full list

File

modules/features_ui/src/Form/AssignmentFormBase.php, line 76

Class

AssignmentFormBase
Configures the selected configuration assignment method for this site.

Namespace

Drupal\features_ui\Form

Code

protected function setConfigTypeSelect(&$form, $defaults, $type, $bundles_only = FALSE, $description = '') {
  $options = $this->featuresManager
    ->listConfigTypes($bundles_only);
  if (!isset($form['types'])) {
    $form['types'] = [
      '#type' => 'container',
      '#tree' => TRUE,
    ];
  }
  $form['types']['config'] = [
    '#type' => 'checkboxes',
    '#title' => $this
      ->t('Configuration types'),
    '#description' => !empty($description) ? $description : $this
      ->t('Select types of configuration that should be considered @type types.', [
      '@type' => $type,
    ]),
    '#options' => $options,
    '#default_value' => $defaults,
  ];
}