Adds the "url" helper to the view object

@param \Aimeos\MW\View\Iface $view View object
@return \Aimeos\MW\View\Iface Modified view object
421564
protected function addUrl( \Aimeos\MW\View\Iface $view )
	{
		$fixed = array();

		if( Route::current() )
		{
			if( ( $value = Route::input( 'site' ) ) !== null ) {
				$fixed['site'] = $value;
			}

			if( ( $value = Route::input( 'locale' ) ) !== null ) {
				$fixed['locale'] = $value;
			}

			if( ( $value = Route::input( 'currency' ) ) !== null ) {
				$fixed['currency'] = $value;
			}
		}

		$helper = new \Aimeos\MW\View\Helper\Url\Laravel5( $view, app('url'), $fixed );
		$view->addHelper( 'url', $helper );

		return $view;
	}
490250
public function setView( \Aimeos\MW\View\Iface $view )
	{
		parent::setView( $view );

		// set first to be able to show errors occuring afterwards
		$view->pageParams = $this->getClientParams();
		$context = $this->getContext();

		$siteManager = \Aimeos\MShop::create( $context, 'locale/site' );
		$langManager = \Aimeos\MShop::create( $context, 'locale/language' );
		$customerManager = \Aimeos\MShop::create( $context, 'customer' );

		$siteItem = $siteManager->findItem( $view->param( 'site', 'default' ) );

		try {
			$siteid = $customerManager->getItem( $context->getUserId() )->getSiteId() ?: $siteItem->getSiteId();
		} catch( \Exception $e ) {
			$siteid = $siteItem->getSiteId();
		}

		if( $view->access( ['admin', 'super'] ) ) {
			$level = \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE;
		} else {
			$level = \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE;
		}

		$sitePath = $siteManager->getPath( $siteid );

		$view->pageI18nList = $this->getAimeos()->getI18nList( 'admin' );
		$view->pageLangItems = $langManager->searchItems( $langManager->createSearch( true ) );
		$view->pageSiteTree = $siteManager->getTree( $siteid, [], $level );
		$view->pageSitePath = $sitePath;
		$view->pageSiteItem = $siteItem;

		if( $view->access( ['super'] ) )
		{
			$search = $siteManager->createSearch()->setSlice( 0, 1000 );
			$search->setSortations( [$search->sort( '+', 'locale.site.label')] );
			$search->setConditions( $search->compare( '==', 'locale.site.level', 0 ) );

			$view->pageSiteList = $siteManager->searchItems( $search );

			if( ( $rootItem = reset( $sitePath ) ) !== false ) {
				$view->pageSiteTree = $siteManager->getTree( $rootItem->getId(), [], $level );
			}
		}
		else
		{
			$view->pageSiteList = [$view->pageSiteTree];
		}

		$this->getClient()->setView( $view );
		return $this;
	}
811165
protected function addCsrf( \Aimeos\MW\View\Iface $view )
	{
		$token = $this->container->get( 'security.csrf.token_manager' )->getToken( '_token' );
		$helper = new \Aimeos\MW\View\Helper\Csrf\Standard( $view, '_token', $token->getValue() );
		$view->addHelper( 'csrf', $helper );

		return $view;
	}
662594
public function getHelperLinks($view)
    {
        if (empty($this->helperLinks[$view])) {
            $this->helperLinks[$view] = [];
        }

        return $this->helperLinks[$view];
    }
866334
public function addData( \Aimeos\MW\View\Iface $view, array &$tags = [], &$expire = null )
	{
		$context = $this->getContext();
		$config = $context->getConfig();

		/** client/html/catalog/count/tree/aggregate
		 * Enables or disables generating product counts for the category catalog filter
		 *
		 * This configuration option allows shop owners to enable or disable product counts
		 * for the tree section of the catalog filter HTML client.
		 *
		 * @param boolean Disabled if "0", enabled if "1"
		 * @since 2014.03
		 * @see client/html/catalog/count/limit
		 */
		if( $config->get( 'client/html/catalog/count/tree/aggregate', true ) == true )
		{
			/** client/html/catalog/count/limit
			 * @see client/html/catalog/count/tree/aggregate
			 */
			$limit = $config->get( 'client/html/catalog/count/limit', 10000 );
			$startid = $view->config( 'client/html/catalog/filter/tree/startid' );
			$level = $view->config( 'client/html/catalog/lists/levels', \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE );

			$cntl = \Aimeos\Controller\Frontend::create( $context, 'catalog' )->root( $startid );
			$root = $cntl->getTree( \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE );

			if( ( $catId = $view->param( 'f_catid', $root->getId() ) ) != null && $catId != $root->getId() ) {
				$cntl->visible( array_keys( $cntl->getPath( $catId ) ) );
			} elseif( $level !== \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE ) {
				$cntl->visible( [$root->getId()] );
			}

			$tree = $cntl->getTree();
			$view->treeCountList = \Aimeos\Controller\Frontend::create( $context, 'product' )
				->category( array_keys( $tree->toList() ) )->slice( 0, $limit )->sort()
				->aggregate( 'index.catalog.id' );

			if( $level === \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE ) {
				$view->treeCountList = $this->counts( $this->traverse( $tree, $view->treeCountList ) );
			}
		}

		return parent::addData( $view, $tags, $expire );
	}
285977
protected static function addRequest( \Aimeos\MW\View\Iface $view, \TYPO3\CMS\Extbase\Mvc\RequestInterface $request = null )
	{
		if( isset( $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_request'] )
			&& is_callable( ( $fcn = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_request'] ) )
		) {
			return $fcn( $view, $request );
		}

		$target = $GLOBALS["TSFE"]->id;
		$get = \TYPO3\CMS\Core\Utility\GeneralUtility::_GET();
		$post = \TYPO3\CMS\Core\Utility\GeneralUtility::_POST();

		$helper = new \Aimeos\MW\View\Helper\Request\Typo3( $view, $target, $_FILES, $get, $post, $_COOKIE, $_SERVER );
		$view->addHelper( 'request', $helper );

		return $view;
	}
892854
protected function addProducts( \Aimeos\MW\View\Iface $view )
	{
		$context = $this->getContext();
		$domains = ['attribute', 'media', 'price', 'product', 'text'];

		$basketCntl = \Aimeos\Controller\Frontend::create( $context, 'basket' );
		$productCntl = \Aimeos\Controller\Frontend::create( $context, 'product' )->uses( $domains );

		if( ( $prodid = $view->param( 'b_prodid', '' ) ) !== '' )
		{
			$basketCntl->addProduct(
				$productCntl->get( $prodid ),
				$view->param( 'b_quantity', 1 ),
				$view->param( 'b_attrvarid', [] ),
				$this->getAttributeMap( $view->param( 'b_attrconfid', [] ) ),
				$view->param( 'b_attrcustid', [] ),
				$view->param( 'b_stocktype', 'default' ),
				$view->param( 'b_supplier' )
			);
		}
		else
		{
			$list = [];
			$entries = (array) $view->param( 'b_prod', [] );

			foreach( $entries as $values )
			{
				if( isset( $values['prodid'] ) ) {
					$list[] = $values['prodid'];
				}
			}

			$products = $productCntl->product( $list )->slice( 0, count( $list ) )->search();

			foreach( $entries as $values )
			{
				if( isset( $values['prodid'] ) && isset( $products[$values['prodid']] ) )
				{
					$basketCntl->addProduct( $products[$values['prodid']],
						( isset( $values['quantity'] ) ? (int) $values['quantity'] : 1 ),
						( isset( $values['attrvarid'] ) ? array_filter( (array) $values['attrvarid'] ) : [] ),
						$this->getAttributeMap( isset( $values['attrconfid'] ) ? $values['attrconfid'] : [] ),
						( isset( $values['attrcustid'] ) ? array_filter( (array) $values['attrcustid'] ) : [] ),
						( isset( $values['stocktype'] ) ? (string) $values['stocktype'] : 'default' ),
						( isset( $values['supplier'] ) ? (string) $values['supplier'] : null )
					);
				}
			}
		}

		$this->clearCached();
	}
1294047
protected function addTranslate( \Aimeos\MW\View\Iface $view, $locale )
	{
		if( $locale !== null )
		{
			$i18n = $this->container->get( 'aimeos.i18n' )->get( array( $locale ) );
			$translation = $i18n[$locale];
		}
		else
		{
			$translation = new \Aimeos\MW\Translation\None( 'en' );
		}

		$helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $translation );
		$view->addHelper( 'translate', $helper );

		return $view;
	}
386963
protected function addViewData( \Aimeos\MW\View\Iface $view )
	{
		$context = $this->getContext();

		$textTypeManager = \Aimeos\MShop::create( $context, 'text/type' );
		$listTypeManager = \Aimeos\MShop::create( $context, 'product/lists/type' );

		$search = $textTypeManager->createSearch( true )->setSlice( 0, 10000 );
		$search->setConditions( $search->compare( '==', 'text.type.domain', 'product' ) );
		$search->setSortations( array( $search->sort( '+', 'text.type.position' ) ) );

		$listSearch = $listTypeManager->createSearch( true )->setSlice( 0, 10000 );
		$listSearch->setConditions( $listSearch->compare( '==', 'product.lists.type.domain', 'text' ) );
		$listSearch->setSortations( array( $listSearch->sort( '+', 'product.lists.type.position' ) ) );

		$view->textTypes = $this->map( $textTypeManager->searchItems( $search ) );
		$view->textListTypes = $this->map( $listTypeManager->searchItems( $listSearch ) );

		return $view;
	}
1374479
public static function view($url, $view, $data = null)
    {
        $callback = function () use ($view, $data) {
            $view = view($view);

            if (!is_null($data)) {
                foreach ($data as $key => $value) {
                    $view = $view->with($key, $value);
                }
            }

            return $view;
        };

        static::get($url, $callback);
    }
911602
public function load($view, $args = array())
    {
        $view = ltrim($view, '/');

        $segments = explode('/', str_replace('.', '/', $view));

        // Pop file from segments.
        $view = array_pop($segments);

        // Custom directory path.
        $pathOfView = app('path.base').'/'.implode('/', $segments);

        // Add temporary path with a hint type.
        $this->view->addNamespace('custom', $pathOfView);

        return $this->of('custom::'.$view, $args);
    }
694302
protected static function addResponse( \Aimeos\MW\View\Iface $view )
	{
		if( isset( $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_response'] )
			&& is_callable( ( $fcn = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_response'] ) )
		) {
			return $fcn( $view );
		}

		$helper = new \Aimeos\MW\View\Helper\Response\Typo3( $view );
		$view->addHelper( 'response', $helper );

		return $view;
	}
1368540
public function setView(ViewComponentInterface $view = null)
    {
        if ($view === $this->view) {
            return $this;
        }
        $this->view && $this->view->detach();
        $view && $view->attachTo($this);
        $this->view = $view;
        return $this;
    }
950776
protected function insertBaseTag($view)
    {
        if (is_null($this->baseUrl)) {
            return $view;
        }

        return str_replace('<head>', '<head><base href="'.$this->baseUrl.'">', $view);
    }
1013510
public static function setView($view)
    {
        if (count(self::$execContexts)) {
            self::$execContexts[count(self::$execContexts) - 1]['view'] = $view;
        }
    }
857280
function hasViewResult( $view = '' )
    {
        if ( $view == '' )
            $view = $this->currentView();
        return isset( $this->ViewResult[$view] );
    }
109828
protected function addParam( \Aimeos\MW\View\Iface $view )
	{
		$params = array();
		$request = $this->requestStack->getMasterRequest();

		if( $request !== null ) {
			$params = $request->request->all() + $request->query->all() + $request->attributes->get( '_route_params' );
		}

		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $params );
		$view->addHelper( 'param', $helper );

		return $view;
	}