Sets the view object and adds the required page data to the view

@param \Aimeos\MW\View\Iface $view The view object which generates the admin output
@return \Aimeos\Admin\JQAdm\Iface Reference to this object for fluent calls
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;
	}
955569
public function addView(string $view, array $data): void
    {
        $num = count($this->views) + 1;
        $key = '#' . $num . ' ' . $view;

        $this->views[$key] = $this->getDataFormatter()->formatVar($data);
    }
821565
final public function setView(View $view) {
        $this->view = $view;
        if (!$this->initializedView) {
            $this->initializedView = true;
            $this->init();
        }
        return $this;
    }
1060899
public function setView($view)
    {
        parent::setView($view);

        if (!$this->_view instanceof ComBaseViewAbstract) {
            $name = AnInflector::isPlural($this->view) ? 'actors' : 'actor';
            $defaults[] = 'ComActorsView'.ucfirst($view).ucfirst($this->_view->name);
            $defaults[] = 'ComActorsView'.ucfirst($name).ucfirst($this->_view->name);
            register_default(array(
                'identifier' => $this->_view,
                'default' => $defaults,
                ));
        }

        return $this;
    }
1090262
protected function updateProducts( \Aimeos\MW\View\Iface $view )
	{
		$controller = \Aimeos\Controller\Frontend::create( $this->getContext(), 'basket' );
		$products = (array) $view->param( 'b_prod', [] );

		if( ( $position = $view->param( 'b_position', '' ) ) !== '' )
		{
			$products[] = array(
				'position' => $position,
				'quantity' => $view->param( 'b_quantity', 1 )
			);
		}

		foreach( $products as $values )
		{
			$controller->updateProduct(
				( isset( $values['position'] ) ? (int) $values['position'] : 0 ),
				( isset( $values['quantity'] ) ? (int) $values['quantity'] : 1 )
			);
		}

		$this->clearCached();
	}
850012
protected function setAddress( \Aimeos\MW\View\Iface $view )
	{
		$address = null;
		$context = $this->getContext();
		$basketCtrl = \Aimeos\Controller\Frontend::create( $context, 'basket' );

		/** client/html/checkout/standard/address/delivery/disable-new
		 * Disables the option to enter a different delivery address for an order
		 *
		 * Besides the billing address, customers can usually enter a different
		 * delivery address as well. To suppress displaying the form fields for
		 * a delivery address, you can set this configuration option to "1".
		 *
		 * Until 2015-02, the configuration option was available as
		 * "client/html/common/address/delivery/disable-new" starting from 2014-03.
		 *
		 * @param boolean A value of "1" to disable, "0" enables the delivery address form
		 * @since 2015.02
		 * @category User
		 * @category Developer
		 * @see client/html/checkout/standard/address/delivery/salutations
		 * @see client/html/checkout/standard/address/delivery/mandatory
		 * @see client/html/checkout/standard/address/delivery/optional
		 * @see client/html/checkout/standard/address/delivery/hidden
		*/
		$disable = $view->config( 'client/html/checkout/standard/address/delivery/disable-new', false );
		$type = \Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_DELIVERY;

		if( ( $option = $view->param( 'ca_deliveryoption', 'null' ) ) === 'null' && $disable === false ) // new address
		{
			$params = $view->param( 'ca_delivery', [] );

			if( ( $view->deliveryError = $this->checkFields( $params ) ) !== [] ) {
				throw new \Aimeos\Client\Html\Exception( sprintf( 'At least one delivery address part is missing or invalid' ) );
			}

			$basketCtrl->addAddress( $type, $params );
		}
		else if( ( $option = $view->param( 'ca_deliveryoption', 'null' ) ) !== '-1' ) // existing address
		{
			$params = $view->param( 'ca_delivery_' . $option, [] );

			if( !empty( $params ) && ( $view->deliveryError = $this->checkFields( $params ) ) !== [] ) {
				throw new \Aimeos\Client\Html\Exception( sprintf( 'At least one delivery address part is missing or invalid' ) );
			}

			$cntl = \Aimeos\Controller\Frontend::create( $context, 'customer' );

			if( ( $address = $cntl->uses( ['customer/address'] )->get()->getAddressItem( $option ) ) !== null )
			{
				$cntl->addAddressItem( $address->fromArray( $params ), $option )->store();
				$params = $address->toArray();
			}

			$basketCtrl->addAddress( $type, $params );
		}
		else
		{
			$basketCtrl->deleteAddress( $type );
		}
	}
1224996
protected function addCsrf( \Aimeos\MW\View\Iface $view )
	{
		$helper = new \Aimeos\MW\View\Helper\Csrf\Standard( $view, '_token', csrf_token() );
		$view->addHelper( 'csrf', $helper );

		return $view;
	}
1013510
public static function setView($view)
    {
        if (count(self::$execContexts)) {
            self::$execContexts[count(self::$execContexts) - 1]['view'] = $view;
        }
    }
555098
public function setView($view)
    {
        $this->view = $view;

        $this->setDisplay(function ($model) {
            $this->data['model'] = $model;

            return view($this->getView(), $this->data);
        });

        return $this;
    }
369668
protected function getUrlConfirm( \Aimeos\MW\View\Iface $view, array $params, array $config )
	{
		/** client/html/checkout/confirm/url/target
		 * Destination of the URL where the controller specified in the URL is known
		 *
		 * The destination can be a page ID like in a content management system or the
		 * module of a software development framework. This "target" must contain or know
		 * the controller that should be called by the generated URL.
		 *
		 * @param string Destination of the URL
		 * @since 2014.03
		 * @category Developer
		 * @see client/html/checkout/confirm/url/controller
		 * @see client/html/checkout/confirm/url/action
		 * @see client/html/checkout/confirm/url/config
		 */
		$target = $view->config( 'client/html/checkout/confirm/url/target' );

		/** client/html/checkout/confirm/url/controller
		 * Name of the controller whose action should be called
		 *
		 * In Model-View-Controller (MVC) applications, the controller contains the methods
		 * that create parts of the output displayed in the generated HTML page. Controller
		 * names are usually alpha-numeric.
		 *
		 * @param string Name of the controller
		 * @since 2014.03
		 * @category Developer
		 * @see client/html/checkout/confirm/url/target
		 * @see client/html/checkout/confirm/url/action
		 * @see client/html/checkout/confirm/url/config
		 */
		$cntl = $view->config( 'client/html/checkout/confirm/url/controller', 'checkout' );

		/** client/html/checkout/confirm/url/action
		 * Name of the action that should create the output
		 *
		 * In Model-View-Controller (MVC) applications, actions are the methods of a
		 * controller that create parts of the output displayed in the generated HTML page.
		 * Action names are usually alpha-numeric.
		 *
		 * @param string Name of the action
		 * @since 2014.03
		 * @category Developer
		 * @see client/html/checkout/confirm/url/target
		 * @see client/html/checkout/confirm/url/controller
		 * @see client/html/checkout/confirm/url/config
		 */
		$action = $view->config( 'client/html/checkout/confirm/url/action', 'confirm' );

		/** client/html/checkout/confirm/url/config
		 * Associative list of configuration options used for generating the URL
		 *
		 * You can specify additional options as key/value pairs used when generating
		 * the URLs, like
		 *
		 *  client/html/<clientname>/url/config = array( 'absoluteUri' => true )
		 *
		 * The available key/value pairs depend on the application that embeds the e-commerce
		 * framework. This is because the infrastructure of the application is used for
		 * generating the URLs. The full list of available config options is referenced
		 * in the "see also" section of this page.
		 *
		 * @param string Associative list of configuration options
		 * @since 2014.03
		 * @category Developer
		 * @see client/html/checkout/confirm/url/target
		 * @see client/html/checkout/confirm/url/controller
		 * @see client/html/checkout/confirm/url/action
		 * @see client/html/url/config
		 */
		$config = $view->config( 'client/html/checkout/confirm/url/config', $config );

		return $view->url( $target, $cntl, $action, $params, [], $config );
	}
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;
	}
334027
public function setView(\Zend_View_Interface $view = null)
    {
        $element = parent::setView($view);
        if (null !== $view) {
            if (false === $view->getPluginLoader('helper')->getPaths('Gems_JQuery_View_Helper')) {
                $view->addHelperPath('Gems/JQuery/View/Helper', 'Gems_JQuery_View_Helper');
            }
        }
        return $element;
    }
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();
	}
605229
public function & SetView (\MvcCore\IView & $view) {
		parent::SetView($view);
		return $this->SetLangAndLocale($this->request->GetLang(), $this->request->GetLocale());
	}
436282
protected function getAllowedResources( \Aimeos\MW\View\Iface $view, array $resources )
	{
		$config = $this->getContext()->getConfig();
		$allowed = [];

		foreach( $resources as $resource )
		{
			if( $view->access( $config->get( 'admin/jsonadm/resource/' . $resource . '/groups', [] ) ) === true ) {
				$allowed[] = $resource;
			}
		}

		return $allowed;
	}
950602
public function setView(\Zend\View\Renderer\RendererInterface $view)
    {
        $this->view = $view;
        return $this;
    }
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;
	}