You are here

public function FormModeManager::tasksIsPrimary in Form mode manager 8

Same name and namespace in other branches
  1. 8.2 src/FormModeManager.php \Drupal\form_mode_manager\FormModeManager::tasksIsPrimary()

Determine Local tasks position for an entity.

Parameters

string $entity_type_id: The entity type id.

Return value

bool True if tasks does display at primary position.

Overrides FormModeManagerInterface::tasksIsPrimary

File

src/FormModeManager.php, line 251

Class

FormModeManager
FormDisplayManager service.

Namespace

Drupal\form_mode_manager

Code

public function tasksIsPrimary($entity_type_id) {
  $links_settings = $this->configFactory
    ->get('form_mode_manager.links')
    ->get("local_tasks.{$entity_type_id}.position");
  return isset($links_settings) && $links_settings === 'primary' ? TRUE : FALSE;
}