Skip to content

Commit

Permalink
Merge branch '1.7' into 1.13
Browse files Browse the repository at this point in the history
  • Loading branch information
andrerom committed Feb 15, 2018
2 parents e086652 + 55e24cc commit 9fd6ca9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Controller/PlatformUIController.php
Expand Up @@ -16,6 +16,7 @@
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Translation\TranslatorInterface;

class PlatformUIController extends Controller
{
Expand All @@ -25,23 +26,31 @@ class PlatformUIController extends Controller
/** @var \EzSystems\PlatformUIBundle\Loader\Loader */
private $loader;

/** @var \Symfony\Component\Translation\TranslatorInterface */
private $translator;

/** @var int */
private $comboCacheTtl;

public function __construct(Provider $configAggregator, Loader $loader, $comboCacheTtl = 0)
public function __construct(Provider $configAggregator, Loader $loader, TranslatorInterface $translator, $comboCacheTtl = 0)
{
$this->configAggregator = $configAggregator;
$this->loader = $loader;
$this->translator = $translator;
$this->comboCacheTtl = $comboCacheTtl;
}

/**
* Renders the "shell" page to run the JavaScript application.
*
* @param \Symfony\Component\HttpFoundation\Request $request
*
* @return \Symfony\Component\HttpFoundation\Response
*/
public function shellAction()
public function shellAction(Request $request)
{
$this->translator->setLocale($request->getPreferredLanguage() ?: $request->getDefaultLocale());

return $this->render(
'eZPlatformUIBundle:PlatformUI:shell.html.twig',
['parameters' => $this->configAggregator->getConfig()]
Expand Down
1 change: 1 addition & 0 deletions Resources/config/services.yml
Expand Up @@ -76,6 +76,7 @@ services:
arguments:
- "@ezsystems.platformui.application_config.aggregator"
- "@ezsystems.platformui.loader.combo_loader"
- "@translator"
- "@=container.getParameter('kernel.debug') ? 0 : parameter('ezsystems.platformui.application_config.combo_loader.cache_ttl')"
parent: ezsystems.platformui.controller.base

Expand Down

0 comments on commit 9fd6ca9

Please sign in to comment.