Commit c18853d4 authored by Tino Goratsch's avatar Tino Goratsch

added some global template variables to the AbstractWidgetAction class

parent a25344f7
......@@ -63,19 +63,11 @@ abstract class AbstractFrontendAction extends Core\Controller\AbstractWidgetActi
parent::preDispatch();
$this->view->assign([
'PHP_SELF' => $this->appPath->getPhpSelf(),
'REQUEST_URI' => $this->request->getServer()->get('REQUEST_URI'),
'ROOT_DIR' => $this->appPath->getWebRoot(),
'HOST_NAME' => $this->request->getHttpHost(),
'ROOT_DIR_ABSOLUTE' => $this->request->getScheme() . '://' . $this->request->getHttpHost() . $this->appPath->getWebRoot(),
'DESIGN_PATH' => $this->appPath->getDesignPathWeb(),
'DESIGN_PATH_ABSOLUTE' => $this->appPath->getDesignPathAbsolute(),
'UA_IS_MOBILE' => $this->request->getUserAgent()->isMobileBrowser(),
'IN_ADM' => $this->request->getArea() === AreaEnum::AREA_ADMIN,
'IS_HOMEPAGE' => $this->request->isHomepage(),
'IS_AJAX' => $this->request->isXmlHttpRequest(),
'LANG_DIRECTION' => $this->translator->getDirection(),
'LANG' => $this->translator->getShortIsoCode(),
]);
return $this;
......
......@@ -109,6 +109,17 @@ abstract class AbstractWidgetAction implements ActionInterface
throw new Core\ACL\Exception\AccessForbiddenException();
}
$this->view->assign([
'PHP_SELF' => $this->appPath->getPhpSelf(),
'ROOT_DIR' => $this->appPath->getWebRoot(),
'HOST_NAME' => $this->request->getHttpHost(),
'ROOT_DIR_ABSOLUTE' => $this->request->getScheme() . '://' . $this->request->getHttpHost() . $this->appPath->getWebRoot(),
'DESIGN_PATH' => $this->appPath->getDesignPathWeb(),
'DESIGN_PATH_ABSOLUTE' => $this->appPath->getDesignPathAbsolute(),
'LANG_DIRECTION' => $this->translator->getDirection(),
'LANG' => $this->translator->getShortIsoCode(),
]);
return $this;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment