public function indexAction(Request $request)
{
$site = $request->attributes->get('site', $request->query->get('site', 'default'));
$lang = $request->attributes->get('lang', $request->query->get('lang', 'en'));
$tab = $request->attributes->get('tab', $request->query->get('tab', 0));
$context = $this->get('aimeos_context')->get(false, 'backend');
$context->setLocale($this->get('aimeos_locale')->getBackend($context, $site));
$aimeos = $this->get('aimeos');
$bootstrap = $aimeos->get();
$cntlPaths = $bootstrap->getCustomPaths('controller/extjs');
$controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths);
$cssFiles = array();
foreach ($bootstrap->getCustomPaths('admin/extjs') as $base => $paths) {
foreach ($paths as $path) {
$jsbAbsPath = $base . '/' . $path;
if (!is_file($jsbAbsPath)) {
throw new \Exception(sprintf('JSB2 file "%1$s" not found', $jsbAbsPath));
}
$jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($path));
$cssFiles = array_merge($cssFiles, $jsb2->getUrls('css'));
}
}
$params = array('site' => '{site}', 'lang' => '{lang}', 'tab' => '{tab}');
$adminUrl = $this->generateUrl('aimeos_shop_extadm', $params);
$token = $this->get('security.csrf.token_manager')->getToken('aimeos_admin_token')->getValue();
$jsonUrl = $this->generateUrl('aimeos_shop_extadm_json', array('_token' => $token, 'site' => $site));
$jqadmUrl = $this->generateUrl('aimeos_shop_jqadm_search', array('site' => $site, 'resource' => 'product'));
$vars = array('lang' => $lang, 'cssFiles' => $cssFiles, 'languages' => $this->getJsonLanguages(), 'config' => $this->getJsonClientConfig($context), 'site' => $this->getJsonSiteItem($context, $site), 'i18nContent' => $this->getJsonClientI18n($bootstrap->getI18nPaths(), $lang), 'searchSchemas' => $controller->getJsonSearchSchemas(), 'itemSchemas' => $controller->getJsonItemSchemas(), 'smd' => $controller->getJsonSmd($jsonUrl), 'urlTemplate' => urldecode($adminUrl), 'uploaddir' => $this->container->getParameter('aimeos_shop.uploaddir'), 'version' => $aimeos->getVersion(), 'jqadmurl' => $jqadmUrl, 'activeTab' => $tab);
return $this->render('AimeosShopBundle:Extadm:index.html.twig', $vars);
}