Parse the defined container scoped operations and populate the definition.

@param Contao2BackendViewDefinitionInterface $view The backend view configuration definition to populate.

@return void
343397
protected function parseGlobalOperations(Contao2BackendViewDefinitionInterface $view)
    {
        $operationsDca = $this->getFromDca('list/global_operations');

        $collection = $view->getGlobalCommands();
        $collection->addCommand(new BackCommand());
        $collection->addCommand(new CreateModelCommand());

        if (!\is_array($operationsDca)) {
            return;
        }

        foreach (\array_keys($operationsDca) as $operationName) {
            $command = $this->createCommand($operationName, $operationsDca[$operationName]);
            $collection->addCommand($command);
        }
    }
1104320
protected function initializeView(ViewInterface $view)
    {
        parent::initializeView($view);

        $this->generateCoreSelectorMenuUsingPageTree();
        /* @var ModuleTemplate $module */ // holds the state of chosen tab
        $module = $this->objectManager->get(ModuleTemplate::class);
        $coreOptimizationTabs = $module->getDynamicTabMenu([], 'coreOptimization');
        $this->view->assign('tabs', $coreOptimizationTabs);
    }
221714
public function registerAssetFiles($view)
    {
        parent::registerAssetFiles($view);



        $localeEncoded = Json::encode(Yii::$app->language);
        $js = <<<js
var polyglot = new Polyglot({locale: $localeEncoded});
js;

        Yii::$app->controller->getView()->registerJs($js, \yii\web\View::POS_HEAD);


    }
812254
private function handleEditAllButton(CollectionInterface $collection, EnvironmentInterface $environment)
    {
        if (0 < $collection->count()) {
            return;
        }

        $dataDefinition = $environment->getDataDefinition();
        $backendView    = $dataDefinition->getDefinition(Contao2BackendViewDefinitionInterface::NAME);
        $globalCommands = $backendView->getGlobalCommands();

        if (!$globalCommands->hasCommandNamed('all')) {
            return;
        }

        $allCommand = $globalCommands->getCommandNamed('all');
        $allCommand->setDisabled(true);
    }
994534
private function handleGlobalCommands(EnvironmentInterface $environment)
    {
        $dataDefinition = $environment->getDataDefinition();
        $backendView    = $dataDefinition->getDefinition(Contao2BackendViewDefinitionInterface::NAME);

        $backButton = null;
        if ($backendView->getGlobalCommands()->hasCommandNamed('back_button')) {
            $backButton = $backendView->getGlobalCommands()->getCommandNamed('back_button');
        }

        if (!$backButton) {
            return;
        }

        $parametersBackButton = $backButton->getParameters();

        if (\in_array($this->getSelectAction($environment), ['properties', 'edit'])) {
            $parametersBackButton->offsetSet('act', 'select');
            $parametersBackButton->offsetSet(
                'select',
                ('edit' === $this->getSelectAction($environment)) ? 'properties' : 'models'
            );
            $parametersBackButton->offsetSet('mode', $this->getSubmitAction($environment, true));
        }

        $closeCommand = new Command();
        $backendView->getGlobalCommands()->addCommand($closeCommand);

        $closeExtra = [
            'href'       => $this->getReferrerUrl($environment),
            'class'      => 'header_icon header_stop',
            'accessKey'  => 'x',
            'attributes' => 'onclick="Backend.getScrollOffset();"'
        ];

        $closeCommand
            ->setName('close_all_button')
            ->setLabel('MSC.closeAll.0')
            ->setDescription('MSC.closeAll.1')
            ->setParameters(new \ArrayObject())
            ->setExtra(new \ArrayObject($closeExtra))
            ->setDisabled(false);
    }
866946
protected function populateView($view)
    {
        $view = $this->initViewVars($view);
        $view = $this->initViewContentBlocks($view);

        return $view;
    }
1180394
final protected function view(string $view, array $data = [])
    {       
        if ($data) extract($data);

        ob_start();
        require base_path().'/app/views/'.$view.'.php';
        $contentInLayout = ob_get_clean();

        require base_path().'/app/views/layouts/'.$this->layout.'.php';

        exit();
    }
451389
protected function setBasicVariablesNoneAdminView($view)
    {
        $view->clientSideConfig = PiwikConfig::getInstance()->getClientSideOptions();
        $view->isSuperUser = Access::getInstance()->hasSuperUserAccess();
        $view->hasSomeAdminAccess = Piwik::isUserHasSomeAdminAccess();
        $view->hasSomeViewAccess  = Piwik::isUserHasSomeViewAccess();
        $view->isUserIsAnonymous  = Piwik::isUserIsAnonymous();
        $view->hasSuperUserAccess = Piwik::hasUserSuperUserAccess();

        if (!Piwik::isUserIsAnonymous()) {
            $view->emailSuperUser = implode(',', Piwik::getAllSuperUserAccessEmailAddresses());
        }

        $capabilities = array();
        if ($this->idSite && $this->site) {
            $capabilityProvider = StaticContainer::get(Access\CapabilitiesProvider::class);
            foreach ($capabilityProvider->getAllCapabilities() as $capability) {
                if (Piwik::isUserHasCapability($this->idSite, $capability->getId())) {
                    $capabilities[] = $capability->getId();
                }
            }
        }

        $view->userCapabilities = $capabilities;

        $this->addCustomLogoInfo($view);

        $view->logoHeader = \Piwik\Plugins\API\API::getInstance()->getHeaderLogoUrl();
        $view->logoLarge = \Piwik\Plugins\API\API::getInstance()->getLogoUrl();
        $view->logoSVG = \Piwik\Plugins\API\API::getInstance()->getSVGLogoUrl();
        $view->hasSVGLogo = \Piwik\Plugins\API\API::getInstance()->hasSVGLogo();
        $view->superUserEmails = implode(',', Piwik::getAllSuperUserAccessEmailAddresses());
        $view->themeStyles = ThemeStyles::get();

        $general = PiwikConfig::getInstance()->General;
        $view->enableFrames = $general['enable_framed_pages']
            || (isset($general['enable_framed_logins']) && $general['enable_framed_logins']);
        $embeddedAsIframe = (Common::getRequestVar('module', '', 'string') == 'Widgetize');
        if (!$view->enableFrames && !$embeddedAsIframe) {
            $view->setXFrameOptions('sameorigin');
        }

        self::setHostValidationVariablesView($view);
    }
144228
public function body(View $view)
    {
        if ($view->getType() !== View::PART_BODY) {
            throw new RendererException("You are replacing the body with a non-body view!");
        }

        if ($this->bodyKey === null) {
            throw new RendererException("No body is defined in the template!");
        }

        $this->stack[$this->bodyKey] = $view;
    }
377622
public function compose(View $view)
    {
        $userGroupRepository = app(UserGroupInterface::class);
        $userGroupOptions = $userGroupRepository->all()->pluck('name', 'id');
        $view->with('userGroupOptions', $userGroupOptions);
    }
1126735
protected function initializeView(ViewInterface $view)
    {
        parent::initializeView($view);

        /* @var ModuleTemplate $module */ // holds the state of chosen tab
        $module = GeneralUtility::makeInstance(ModuleTemplate::class);
        $coreOptimizationTabs = $module->getDynamicTabMenu([], 'coreOptimization');
        $this->view->assign('tabs', $coreOptimizationTabs);
    }
195955
public function compose(View $view)
    {
        $status = $this->system->getStatus();

        $view->withSystemStatus(Arr::get($status, 'system_status'));
        $view->withSystemMessage(Arr::get($status, 'system_message'));
    }
924432
protected function createBackendViewDefinition($container)
    {
        if ($container->hasDefinition(Contao2BackendViewDefinitionInterface::NAME)) {
            $view = $container->getDefinition(Contao2BackendViewDefinitionInterface::NAME);
        } else {
            $view = new Contao2BackendViewDefinition();
            $container->setDefinition(Contao2BackendViewDefinitionInterface::NAME, $view);
        }

        return $view;
    }
232205
public function compose(View $view)
    {
        $view->withThemeBackgroundColor($this->config->get('setting.style_background_color', '#F0F3F4'));
        $view->withThemeBackgroundFills($this->config->get('setting.style_background_fills', '#FFFFFF'));
        $view->withThemeBannerBackgroundColor($this->config->get('setting.style_banner_background_color', ''));
        $view->withThemeBannerPadding($this->config->get('setting.style_banner_padding', '40px 0'));
        $view->withThemeTextColor($this->config->get('setting.style_text_color', '#333333'));
        $view->withThemeReds($this->config->get('setting.style_reds', '#FF6F6F'));
        $view->withThemeBlues($this->config->get('setting.style_blues', '#3498DB'));
        $view->withThemeGreens($this->config->get('setting.style_greens', '#7ED321'));
        $view->withThemeYellows($this->config->get('setting.style_yellows', '#F7CA18'));
        $view->withThemeOranges($this->config->get('setting.style_oranges', '#FF8800'));
        $view->withThemeGreys($this->config->get('setting.style_greys', '#888888'));
        $view->withThemeMetrics($this->config->get('setting.style_metrics', '#0DCCC0'));
        $view->withThemeLinks($this->config->get('setting.style_links', '#7ED321'));
    }
868598
public function setView($view)
	{
		$this->view = $view;

		// construct the view if needed
		if ( ! $this->view instanceof View)
		{
			$this->view = $this->viewManager->forge($this->view);
		}
	}
712878
public function setViewLayout($view)
    {
        $this->layout         = $this->viewLayout->change($view);
        $this->layout->layout = $this->viewPath->setUp($this->layout->layout, null);
    }
1295900
private function deriveView($view)
    {
        // Check if the view already exists as specified
        if(self::exists($view))
        {
            // It does so just return it
            return $view;
        }

        // Check if there are any namespaces yet
        if($this->namespaces === NULL)
        {
            // There aren't so grab the namespace information from the configuration file
            $this->namespaces = config('layout-view.namespaces');
        }

        // Check if the selected layout has been set
        if($this->selected_layout === NULL)
        {
            // It hasn't been, so set it based on the config values
            $this->selected_layout = config('layout-view.layout.selected');
        }

        // Check if the fallback layout has been set
        if($this->fallback_layout === NULL)
        {
            // It hasn't been, so set it based on the config values
            $this->fallback_layout = config('layout-view.layout.fallback');
        }

        // The view that will be rendered
        $target = NULL;

        // Cycle through all of the namespaces
        foreach($this->namespaces as $namespace)
        {
            // Does the namespace have the colons in it?
            if($namespace != '' && stripos($namespace, '::') === FALSE)
            {
                // Didn't exist, so append it
                $namespace .= '::';
            }

            // Derive the base view
            $derived = $namespace . (is_null($this->selected_layout) ? '' :  $this->selected_layout . '.') . $view;

            // Look to see if the view exists
            if(self::exists($derived))
            {
                // It does, so render it
                $target = $derived;
            }
            else
            {
                // It didn't so try in the fallback
                $derived = $namespace . (is_null($this->fallback_layout) ? '' : $this->fallback_layout .  '.') . $view;

                // Check if the fallback view exists
                if(self::exists($derived))
                {
                    $target = $derived;
                }
            }

            // Check if we found a match
            if($target !== NULL)
            {
                // We did, so no sense looping
                break;
            }
        }

        // Return the name of the view we found.
        return $target === NULL ? $view : $target;
    }