You are here

private function FormModeManagerLocalTasks::setDefaultTasks in Form mode manager 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/Derivative/FormModeManagerLocalTasks.php \Drupal\form_mode_manager\Plugin\Derivative\FormModeManagerLocalTasks::setDefaultTasks()

Set the default tasks on each entities.

Parameters

string $entity_type_id: The entity type ID.

1 call to FormModeManagerLocalTasks::setDefaultTasks()
FormModeManagerLocalTasks::getDerivativeDefinitions in src/Plugin/Derivative/FormModeManagerLocalTasks.php
Gets the definition of all derivatives of a base plugin.

File

src/Plugin/Derivative/FormModeManagerLocalTasks.php, line 112

Class

FormModeManagerLocalTasks
Defines dynamic 'Form Mode Manager' local tasks.

Namespace

Drupal\form_mode_manager\Plugin\Derivative

Code

private function setDefaultTasks($entity_type_id) {
  $this->derivatives["form_mode_manager.{$entity_type_id}.default.task_tab"] = [
    'route_name' => "entity.{$entity_type_id}.edit_form",
    'title' => $this
      ->t('Edit as Default'),
    'parent_id' => "entity.{$entity_type_id}.edit_form",
    'cache_tags' => $this->cacheTags,
  ];
  $element_name = "form_mode_manager.{$entity_type_id}.default.task_tab";
  $this
    ->blockContentEnhancer($element_name, $entity_type_id);
}