You are here

function domain_lang_domain_operations in Domain Lang 8

Implements hook_domain_operations().

File

./domain_lang.module, line 14
Domain Language detection and selection module.

Code

function domain_lang_domain_operations(DomainInterface $domain) {
  $operations = [];
  if (\Drupal::currentUser()
    ->hasPermission('administer domain language negotiation')) {
    $operations['domain_lang'] = [
      'title' => t('Language Detection and Selection'),
      'url' => Url::fromRoute('domain_lang.admin', [
        'domain' => $domain
          ->id(),
      ]),
      'weight' => 90,
    ];
  }
  return $operations;
}