/** * Creates the initial HTML view for the admin interface. * * @param string $site Shop site code * @param string $lang ISO language code * @param integer $tab Number of the current active tab */ public function indexAction($site = 'default', $lang = 'en', $tab = 0) { $context = $this->context->get(null, 'backend'); $context->setLocale($this->locale->getBackend($context, $site)); $aimeos = $this->aimeos->get(); $cntlPaths = $aimeos->getCustomPaths('controller/extjs'); $controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths); $cssFiles = array(); foreach ($aimeos->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->uriBuilder->uriFor('index', $params); $jsonUrl = $this->uriBuilder->uriFor('do', array('site' => 'default')); $jqadmUrl = $this->uriBuilder->uriFor('search', array('site' => $site, 'resource' => 'product'), 'Jqadm'); $vars = array('lang' => $lang, 'cssFiles' => $cssFiles, 'languages' => $this->getJsonLanguages(), 'config' => $this->getJsonClientConfig($context), 'site' => $this->getJsonSiteItem($context, $site), 'i18nContent' => $this->getJsonClientI18n($aimeos->getI18nPaths(), $lang), 'searchSchemas' => $controller->getJsonSearchSchemas(), 'itemSchemas' => $controller->getJsonItemSchemas(), 'smd' => $controller->getJsonSmd($jsonUrl), 'uploaddir' => $context->getConfig()->get('flow/uploaddir', '/.'), 'version' => $this->aimeos->getVersion(), 'urlTemplate' => urldecode($adminUrl), 'jqadmurl' => $jqadmUrl, 'activeTab' => $tab); $this->view->assignMultiple($vars); }
/** * Returns the generated view including the HTML code * * @param string $content Content from admin client */ protected function getHtml($content) { $version = $this->aimeos->getVersion(); $content = str_replace(['{type}', '{version}'], ['Flow', $version], $content); $this->view->assign('content', $content); return $this->view->render('index'); }