/**
  * Returns the initial HTML view for the admin interface.
  *
  * @return Response Response object containing the generated output
  */
 public function indexAction()
 {
     $site = \Input::get('site', 'default');
     $lang = \Input::get('lang', 'en');
     $aimeos = app('\\Aimeos\\Shop\\Base\\Aimeos')->get();
     $cntlPaths = $aimeos->getCustomPaths('controller/extjs');
     $context = app('\\Aimeos\\Shop\\Base\\Context')->get(false);
     $context = $this->setLocale($context, $site, $lang);
     $controller = new \Controller_ExtJS_JsonRpc($context, $cntlPaths);
     $cssFiles = $jsFiles = array();
     foreach ($aimeos->getCustomPaths('client/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 \MW_Jsb2_Default($jsbAbsPath, dirname($path));
             $cssFiles = array_merge($cssFiles, $jsb2->getUrls('css'));
             $jsFiles = array_merge($jsFiles, $jsb2->getUrls('js'));
         }
     }
     $params = array('site' => '{site}', 'lang' => '{lang}', 'tab' => '{tab}');
     $adminUrl = route('aimeos_shop_admin', $params);
     $jsonUrl = route('aimeos_shop_admin_json', array('_token' => csrf_token()));
     $vars = array('lang' => $lang, 'jsFiles' => $jsFiles, 'cssFiles' => $cssFiles, 'languages' => $this->getJsonLanguages($context), 'config' => $this->getJsonClientConfig($context), 'site' => $this->getJsonSiteItem($context, \Input::get('site', 'default')), 'i18nContent' => $this->getJsonClientI18n($aimeos->getI18nPaths(), $lang), 'searchSchemas' => $controller->getJsonSearchSchemas(), 'itemSchemas' => $controller->getJsonItemSchemas(), 'smd' => $controller->getJsonSmd($jsonUrl), 'urlTemplate' => urldecode($adminUrl), 'uploaddir' => \Config::get('shop::uploaddir'), 'activeTab' => \Input::get('tab', 0), 'version' => $this->getVersion());
     return \View::make('shop::admin.index', $vars);
 }
Esempio n. 2
0
 /**
  * Returns the JS file content
  *
  * @return Response Response object
  */
 public function fileAction()
 {
     $jsFiles = array();
     $aimeos = $this->aimeos->get();
     foreach ($aimeos->getCustomPaths('client/extjs') as $base => $paths) {
         foreach ($paths as $path) {
             $jsbAbsPath = $base . '/' . $path;
             $jsb2 = new \MW_Jsb2_Default($jsbAbsPath, dirname($jsbAbsPath));
             $jsFiles = array_merge($jsFiles, $jsb2->getUrls('js', ''));
         }
     }
     foreach ($jsFiles as $file) {
         if (($content = file_get_contents($file)) !== false) {
             $this->response->appendContent($content);
         }
     }
     $this->response->setHeader('Content-Type', 'application/javascript');
     return $this->response;
 }
Esempio n. 3
0
 /**
  * Returns the JS file content
  *
  * @return Response Response object
  */
 public function fileAction()
 {
     $contents = '';
     $jsFiles = array();
     $aimeos = app('\\Aimeos\\Shop\\Base\\Aimeos')->get();
     foreach ($aimeos->getCustomPaths('client/extjs') as $base => $paths) {
         foreach ($paths as $path) {
             $jsbAbsPath = $base . '/' . $path;
             $jsb2 = new \MW_Jsb2_Default($jsbAbsPath, dirname($jsbAbsPath));
             $jsFiles = array_merge($jsFiles, $jsb2->getUrls('js', ''));
         }
     }
     foreach ($jsFiles as $file) {
         if (($content = file_get_contents($file)) !== false) {
             $contents .= $content;
         }
     }
     return response($contents)->header('Content-Type', 'application/javascript');
 }
Esempio n. 4
0
 /**
  * Returns the JS file content
  *
  * @return Response Response object
  */
 public function fileAction()
 {
     $contents = '';
     $jsFiles = array();
     foreach (Base::getAimeos()->getCustomPaths('client/extjs') as $base => $paths) {
         foreach ($paths as $path) {
             $jsbAbsPath = $base . '/' . $path;
             $jsb2 = new \MW_Jsb2_Default($jsbAbsPath, dirname($jsbAbsPath));
             $jsFiles = array_merge($jsFiles, $jsb2->getUrls('js', ''));
         }
     }
     foreach ($jsFiles as $file) {
         if (($content = file_get_contents($file)) === false) {
             throw new \Exception(sprintf('File "%1$s" not found', $jsbAbsPath));
         }
         $contents .= $content;
     }
     $response = $this->getControllerContext()->getResponse();
     $response->setHeader('Content-Type', 'application/javascript');
     $response->setContent($contents);
     return $response;
 }