Drupal 8  8.0.2
LanguageNegotiationUserAdmin Class Reference
Inheritance diagram for LanguageNegotiationUserAdmin:

Public Member Functions

 __construct (AdminContext $admin_context, UrlMatcherInterface $router, PathProcessorManager $path_processor_manager, StackedRouteMatchInterface $stacked_route_match)
 
 getLangcode (Request $request=NULL)
 
- Public Member Functions inherited from LanguageNegotiationMethodBase
 setLanguageManager (ConfigurableLanguageManagerInterface $language_manager)
 
 setConfig (ConfigFactoryInterface $config)
 
 setCurrentUser (AccountInterface $current_user)
 
 persist (LanguageInterface $language)
 

Static Public Member Functions

static create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
 

Data Fields

const METHOD_ID = 'language-user-admin'
 

Protected Member Functions

 isAdminPath (Request $request)
 

Protected Attributes

 $adminContext
 
 $router
 
 $pathProcessorManager
 
 $stackedRouteMatch
 
- Protected Attributes inherited from LanguageNegotiationMethodBase
 $languageManager
 
 $config
 
 $currentUser
 

Detailed Description

Identifies admin language from the user preferences.

( id = Drupal::METHOD_ID, types = {Drupal::TYPE_INTERFACE}, weight = -10, name = ("Account administration pages"), description = ("Account administration pages language setting.") )

Constructor & Destructor Documentation

__construct ( AdminContext  $admin_context,
UrlMatcherInterface  $router,
PathProcessorManager  $path_processor_manager,
StackedRouteMatchInterface  $stacked_route_match 
)

Constructs a new LanguageNegotiationUserAdmin instance.

Parameters
\Drupal\Core\Routing\AdminContext$admin_contextThe admin context.
\Symfony\Component\Routing\Matcher\UrlMatcherInterface$routerThe router.
\Drupal\Core\PathProcessor\PathProcessorManager$path_processor_managerThe path processor manager.
\Drupal\Core\Routing\StackedRouteMatchInterface$stacked_route_matchThe stacked route match.

Member Function Documentation

static create ( ContainerInterface  $container,
array  $configuration,
  $plugin_id,
  $plugin_definition 
)
static

{Creates an instance of the plugin.

Parameters
\Symfony\Component\DependencyInjection\ContainerInterface$containerThe container to pull out services used in the plugin.
array$configurationA configuration array containing information about the plugin instance.
string$plugin_idThe plugin ID for the plugin instance.
mixed$plugin_definitionThe plugin implementation definition.
Returns
static Returns an instance of this plugin.
}

Implements ContainerFactoryPluginInterface.

getLangcode ( Request  $request = NULL)

{Performs language negotiation.

Parameters
\Symfony\Component\HttpFoundation\Request$request(optional) The current request. Defaults to NULL if it has not been initialized yet.
Returns
string A valid language code or FALSE if the negotiation was unsuccessful.
}

Implements LanguageNegotiationMethodInterface.

References Drupal\currentUser(), and LanguageNegotiationUserAdmin\isAdminPath().

Here is the call graph for this function:

isAdminPath ( Request  $request)
protected

Checks whether the given path is an administrative one.

Parameters
\Symfony\Component\HttpFoundation\Request$requestThe request object.
Returns
bool TRUE if the path is administrative, FALSE otherwise.

Referenced by LanguageNegotiationUserAdmin\getLangcode().

Here is the caller graph for this function:

Field Documentation

const METHOD_ID = 'language-user-admin'

The language negotiation method id.

Referenced by LanguageUILanguageNegotiationTest\testUILanguageNegotiation().


The documentation for this class was generated from the following file: