예제 #1
0
 /**
  * Returns the output of the client and adds the header.
  *
  * @param string $clientName Html client name
  * @return string HTML code for inserting into the HTML body
  */
 protected function getOutput($clientName)
 {
     $tmplPaths = $this->aimeos->get()->getCustomPaths('client/html/templates');
     $context = $this->context->get($this->request);
     $langid = $context->getLocale()->getLanguageId();
     $view = $this->viewContainer->create($context, $this->uriBuilder, $tmplPaths, $this->request, $langid);
     $client = \Aimeos\Client\Html\Factory::createClient($context, $tmplPaths, $clientName);
     $client->setView($view);
     $client->process();
     $this->view->assign('aimeos_component_header', (string) $client->getHeader());
     return $client->getBody();
 }
예제 #2
0
 /**
  * Returns the output of the client and adds the header.
  *
  * @param Client_Html_Interface $client Html client object
  * @return string HTML code for inserting into the HTML body
  */
 protected function getOutput($clientName)
 {
     $tmplPaths = $this->aimeos->get()->getCustomPaths('client/html');
     $context = $this->context->get($this->request);
     $langid = $context->getLocale()->getLanguageId();
     $view = $this->viewContainer->create($context->getConfig(), $this->uriBuilder, $tmplPaths, $this->request, $langid);
     $client = \Client_Html_Factory::createClient($context, $tmplPaths, $clientName);
     $client->setView($view);
     $client->process();
     // $this->response->addAdditionalHeaderData( (string) $client->getHeader() );
     return $client->getBody();
 }
예제 #3
0
 /**
  * Single entry point for all JSON admin requests.
  */
 public function doAction()
 {
     $context = $this->context->get(null, 'backend');
     $context->setLocale($this->locale->getBackend($context, 'default'));
     $context->setView($this->viewcontainer->create($context, $this->uriBuilder, array(), $this->request));
     $cntlPaths = $this->aimeos->get()->getCustomPaths('controller/extjs');
     $controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths);
     if (($content = file_get_contents('php://input')) === false) {
         throw new \Exception('Unable to get request content');
     }
     return $controller->process($this->request->getArguments(), $content);
 }
예제 #4
0
 /**
  * Returns the resource controller
  *
  * @param string $sitecode Unique site code
  * @return \Aimeos\MShop\Context\Item\Iface Context item
  */
 protected function createClient($sitecode, $resource)
 {
     $lang = $this->request->hasArgument('lang') ? $this->request->getArgument('lang') : 'en';
     $templatePaths = $this->aimeos->get()->getCustomPaths('admin/jqadm/templates');
     $context = $this->context->get(null, 'backend');
     $context->setI18n($this->i18n->get(array($lang, 'en')));
     $context->setLocale($this->locale->getBackend($context, $sitecode));
     $context->setView($this->viewbase->create($context, $this->uriBuilder, $templatePaths, $this->request, $lang));
     return \Aimeos\Admin\JQAdm\Factory::createClient($context, $templatePaths, $resource);
 }
예제 #5
0
 /**
  * Returns the body and header sections created by the clients configured for the given page name.
  *
  * @param string $pageName Name of the configured page
  * @return array Associative list with body and header output separated by client name
  */
 public function getSections($pageName)
 {
     $context = $this->context->get();
     $langid = $context->getLocale()->getLanguageId();
     $tmplPaths = $this->aimeos->get()->getCustomPaths('client/html');
     $view = $this->view->create($context->getConfig(), $tmplPaths, $langid);
     $pagesConfig = $this->config->get('shop.page', array());
     $result = array('aibody' => array(), 'aiheader' => array());
     if (isset($pagesConfig[$pageName])) {
         foreach ((array) $pagesConfig[$pageName] as $clientName) {
             $client = \Client_Html_Factory::createClient($context, $tmplPaths, $clientName);
             $client->setView(clone $view);
             $client->process();
             $result['aibody'][$clientName] = $client->getBody();
             $result['aiheader'][$clientName] = $client->getHeader();
         }
     }
     return $result;
 }
예제 #6
0
파일: Page.php 프로젝트: aimeos/aimeos-flow
 /**
  * Returns the body and header sections created by the clients configured for the given page name.
  *
  * @param \TYPO3\Flow\Mvc\RequestInterface $request Request object
  * @param string $pageName Name of the configured page
  * @return array Associative list with body and header output separated by client name
  */
 public function getSections(\TYPO3\Flow\Mvc\RequestInterface $request, $pageName)
 {
     $this->uriBuilder->setRequest($request);
     $tmplPaths = $this->aimeos->get()->getCustomPaths('client/html/templates');
     $pagesConfig = $this->settings['page'];
     $result = array('aibody' => array(), 'aiheader' => array());
     $context = $this->context->get($request);
     $langid = $context->getLocale()->getLanguageId();
     $view = $this->view->create($context, $this->uriBuilder, $tmplPaths, $request, $langid);
     $context->setView($view);
     if (isset($pagesConfig[$pageName])) {
         foreach ((array) $pagesConfig[$pageName] as $clientName) {
             $client = \Aimeos\Client\Html\Factory::createClient($context, $tmplPaths, $clientName);
             $client->setView(clone $view);
             $client->process();
             $varName = str_replace('/', '_', $clientName);
             $result['aibody'][$varName] = $client->getBody();
             $result['aiheader'][$varName] = $client->getHeader();
         }
     }
     return $result;
 }