protected function EntityTranslationDefaultHandler::initPathVariables in Entity Translation 7
Initializes handler path variables based on the active path scheme.
Throws
Exception
2 calls to EntityTranslationDefaultHandler::initPathVariables()
- EntityTranslationDefaultHandler::setPathScheme in includes/
translation.handler.inc - EntityTranslationDefaultHandler::__construct in includes/
translation.handler.inc - Initializes an instance of the translation handler.
File
- includes/
translation.handler.inc, line 1749 - Default translation handler for the translation module.
Class
- EntityTranslationDefaultHandler
- Class implementing the default entity translation behaviours.
Code
protected function initPathVariables() {
if (empty($this->pathScheme) || !isset($this->entityInfo['translation']['entity_translation']['path schemes'][$this->pathScheme])) {
throw new Exception("Cannot initialize entity translation path variables (invalid path scheme).");
}
$path_scheme = $this->entityInfo['translation']['entity_translation']['path schemes'][$this->pathScheme];
$this->pathWildcard = $path_scheme['path wildcard'];
$this->basePath = isset($path_scheme['base path']) ? $this
->getPathInstance($path_scheme['base path']) : FALSE;
$this->editPath = isset($path_scheme['edit path']) ? $this
->getPathInstance($path_scheme['edit path']) : FALSE;
$this->translatePath = isset($path_scheme['translate path']) ? $this
->getPathInstance($path_scheme['translate path']) : FALSE;
$this->viewPath = isset($path_scheme['view path']) ? $this
->getPathInstance($path_scheme['view path']) : FALSE;
}