You are here

domain_lang.module in Domain Lang 8

Same filename and directory in other branches
  1. 7 domain_lang.module

Domain Language detection and selection module.

File

domain_lang.module
View source
<?php

/**
 * @file
 * Domain Language detection and selection module.
 */
use Drupal\domain\DomainInterface;
use Drupal\Core\Url;

/**
 * Implements hook_domain_operations().
 */
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;
}

Functions