Exemplo n.º 1
0
 /**
  * Generates the index file for the admin interface.
  */
 public function indexAction()
 {
     $cssFiles = array();
     $abslen = strlen(PATH_site);
     $controller = $this->getController();
     $locale = $this->getContextBackend()->getLocale();
     $site = $locale->getSite()->getCode();
     $langid = 'en';
     if (isset($GLOBALS['BE_USER']->uc['lang']) && $GLOBALS['BE_USER']->uc['lang'] != '') {
         $langid = $GLOBALS['BE_USER']->uc['lang'];
     }
     foreach (Base::getAimeos()->getCustomPaths('admin/extjs') as $base => $paths) {
         $relJsbPath = '../' . substr($base, $abslen);
         foreach ($paths as $path) {
             $jsbAbsPath = $base . '/' . $path;
             if (!is_file($jsbAbsPath)) {
                 throw new \RuntimeException(sprintf('JSB2 file "%1$s" not found', $jsbAbsPath));
             }
             $jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, '');
             $cssFiles = array_merge($cssFiles, $jsb2->getUrls('css'));
         }
     }
     // rawurldecode() is necessary for ExtJS templates to replace "{site}" properly
     $urlTemplate = rawurldecode(BackendUtility::getModuleUrl($this->request->getPluginName(), array('tx_aimeos_web_aimeostxaimeosadmin' => array('controller' => 'Extadm', 'action' => 'index', 'site' => '{site}', 'tab' => '{tab}'))));
     $serviceUrl = BackendUtility::getModuleUrl($this->request->getPluginName(), array('tx_aimeos_web_aimeostxaimeosadmin' => array('controller' => 'Extadm', 'action' => 'do')));
     $jqadmUrl = BackendUtility::getModuleUrl($this->request->getPluginName(), array('tx_aimeos_web_aimeostxaimeosadmin' => array('controller' => 'Jqadm', 'action' => 'search', 'site' => $site, 'resource' => 'product')));
     $this->view->assign('cssFiles', $cssFiles);
     $this->view->assign('lang', $langid);
     $this->view->assign('i18nContent', $this->getJsonClientI18n($langid));
     $this->view->assign('config', $this->getJsonClientConfig());
     $this->view->assign('site', $this->getSite($this->request));
     $this->view->assign('smd', $controller->getJsonSmd($serviceUrl));
     $this->view->assign('itemSchemas', $controller->getJsonItemSchemas());
     $this->view->assign('searchSchemas', $controller->getJsonSearchSchemas());
     $this->view->assign('activeTab', $this->request->hasArgument('tab') ? (int) $this->request->getArgument('tab') : 0);
     $this->view->assign('version', Base::getVersion());
     $this->view->assign('urlTemplate', $urlTemplate);
     $this->view->assign('jqadmurl', $jqadmUrl);
 }
Exemplo n.º 2
0
 /**
  * Adds the generated HTML code to the view
  *
  * @param string $content Content from admin client
  */
 protected function setHtml($content)
 {
     $content = str_replace(['{type}', '{version}'], ['TYPO3', Base::getVersion()], $content);
     $this->view->assign('formparam', 'tx_aimeos_web_aimeostxaimeosadmin');
     $this->view->assign('content', $content);
 }