You are here

protected function AssignmentFormBase::setActions 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::setActions()

Adds a "Save settings" submit action.

7 calls to AssignmentFormBase::setActions()
AssignmentAlterForm::buildForm in modules/features_ui/src/Form/AssignmentAlterForm.php
Form constructor.
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.

... See full list

File

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

Class

AssignmentFormBase
Configures the selected configuration assignment method for this site.

Namespace

Drupal\features_ui\Form

Code

protected function setActions(&$form, $method_id = NULL) {
  $assignment_info = $this->assigner
    ->getAssignmentMethods();
  if (isset($method_id) && isset($assignment_info[$method_id])) {
    $method = $assignment_info[$method_id];
    $form['help_text'] = [
      '#markup' => $method['description'],
      '#prefix' => '<p class="messages messages--status">',
      '#suffix' => '</p>',
      '#weight' => -99,
    ];
  }
  $form['actions'] = [
    '#type' => 'actions',
  ];
  $form['actions']['submit'] = [
    '#type' => 'submit',
    '#button_type' => 'primary',
    '#value' => $this
      ->t('Save settings'),
  ];
  $form['#attributes']['class'][] = 'features-assignment-settings-form';
  $form['#attached'] = [
    'library' => [
      'features_ui/drupal.features_ui.admin',
    ],
  ];
}