public function EntityTranslationDefaultHandler::initPathScheme in Entity Translation 7
Overrides EntityTranslationHandlerInterface::initPathScheme
See also
EntityTranslationHandlerInterface::initPathScheme()
File
- includes/
translation.handler.inc, line 1107 - Default translation handler for the translation module.
Class
- EntityTranslationDefaultHandler
- Class implementing the default entity translation behaviours.
Code
public function initPathScheme($path = NULL) {
$scheme = 'default';
// If only one path scheme is defined no need to find one.
if (count($this->entityInfo['translation']['entity_translation']['path schemes']) > 1) {
$item = menu_get_item($path);
if (!empty($item['path'])) {
$current_path_scheme = $this
->findMatchingPathScheme($item['path']);
if ($current_path_scheme) {
$scheme = $current_path_scheme;
$this->routerMap = $item['original_map'];
}
}
}
$this
->setPathScheme($scheme);
return $scheme;
}