Builds the browser config.

@param Request $request

@return array
340883
private function buildConfig(Request $request)
    {
        $config = array(
            'mode' => $request->query->get('mode', 'browse'),
        );
        if (null !== $types = $request->query->get('types', array())) {
            // TODO validate types
            $config['types'] = $types;
        }
        return $config;
    }
911823
public function getMapping(Request $request): array
    {
        return $this->cache->load($this->getCacheKey($request), function (&$dependencies) use ($request) {
            return $this->loadMapping($request->getPresenterName(), $request->getParameters(), $dependencies);
        });
    }
1136202
protected function getData(Request $request)
    {
        return [
            'style' => $request->get('style'),
            'type' => $request->get('type', $this->container->getParameter('sulu_media.collection.type.default')),
            'parent' => $request->get('parent'),
            'locale' => $this->getRequestParameter($request, 'locale', true),
            'title' => $request->get('title'),
            'description' => $request->get('description'),
            'changer' => $request->get('changer'),
            'creator' => $request->get('creator'),
            'changed' => $request->get('changed'),
            'created' => $request->get('created'),
        ];
    }
911720
public function createThemeAction(Request $request)
    {
        $form = $this->formFactory->create(new ThemeType());
        $form->handleRequest($request);

        if ($form->isValid()) {
            $this->manager->createCustomTheme(
                $form['name']->getData(),
                $form['stylesheet']->getData()
            );

            return new RedirectResponse($this->router->generate('claro_admin_theme_list'));
        }

        return ['form' => $form];
    }
1000825
public function setAction(Request $request)
    {
        $ids = $request->get('ids');
        $ids = explode(',', $ids);

        $metaSetManager = $this->get('phlexible_meta_set.meta_set_manager');
        $metaSets = [];
        foreach ($ids as $id) {
            $metaSets[] = $metaSetManager->find($id);
        }

        $config = $this->createMetasetConfig($metaSets);

        return new JsonResponse($config);
    }
236277
private function send(Request $request)
    {
        $options = [
            'base_uri' => self::BASE_URI,
            'http_errors' => false,
        ];

        return $this->client->send($request, $options);
    }
243509
protected function getTagcacheConfig(Request $request)
    {
        if(!($tagcacheConfig = $this->loadAnnotationConfig($request))){
            return null;
        }

        if (!$tagcacheConfig->getCache()) {
            return null;
        }

        if($tagcacheConfig->getExpress() !== null){
            $key = $this->parseExpressKey($tagcacheConfig->getExpress(), $request);
            $tagcacheConfig->setKey($key);
        }

        if ($tagcacheConfig->getKey() === null) {
            $tagcacheConfig->setKey($request->attributes->get('_controller'));
        }

        return $tagcacheConfig;
    }
91604
public function suggestions(Request $request) {
    $name = $request->get('term');
    $config = $this->configFactory->get('mentions.settings');
    $suggestion_format = $config->get('suggestions_format');
    $suggestion_amount = $config->get('suggestions_amount');
    $result = $this->getUserIdsFromName($name, $suggestion_amount, $suggestion_format);
    $response = [];
    $accounts = User::loadMultiple($result);
    $storage = $this->entityTypeManager->getStorage('profile');
    $view_builder = $this->entityTypeManager->getViewBuilder('profile');

    /* @var \Drupal\Core\Session\AccountInterface $account */
    foreach ($accounts as $account) {
      $item = [
        'uid' => $account->id(),
        'username' => $account->getAccountName(),
        'value' => $account->getAccountName(),
        'html_item' => '<div>' . $account->getAccountName() . '</div>',
        'profile_id' => '',
      ];

      if ($storage && ($profile = $storage->loadByUser($account, 'profile', TRUE)) && $suggestion_format != SOCIAL_PROFILE_SUGGESTIONS_USERNAME) {
        $build = $view_builder->view($profile, 'autocomplete_item');
        $item['html_item'] = render($build);
        $item['profile_id'] = $profile->id();
        $item['value'] = strip_tags($account->getDisplayName());
      }

      $response[] = $item;
    }

    return new JsonResponse($response);
  }
916056
public function matchContentRouteRequest(Request $request)
    {
        $requestParams = $this->router->matchRequest($request);

        if (is_array($requestParams) && !empty($requestParams)) {
            $request->attributes->add($requestParams);

            unset($requestParams['_route']);
            unset($requestParams['_controller']);
            $request->attributes->set('_route_params', $requestParams);

            $configuration = $request->attributes->get('_template');
            $request->attributes->set('_template', $configuration->getTemplate());
            $request->attributes->set('_template_vars', $configuration->getVars());
            $request->attributes->set('_template_streamable', $configuration->isStreamable());
        }

        return $request;
    }
425845
protected function getExportConfig(Request $request)
    {
        $configKey = $request->get('configKey');
        if (!$configKey) {
            return [];
        }
        $session = $request->getSession();
        $selectedIds = null;
        $selectedColumns = null;
        if ($session) {
            $selectedIds = $session->get('export_selected_ids_'.$configKey);
            $selectedColumns = $session->get('export_selected_columns_'.$configKey);
        }
        $attributes = [];
        if (\is_array($selectedColumns)) {
            /** @var array $selectedColumns */
            foreach ($selectedColumns as $selectedColumn) {
                $attributes[$selectedColumn] = [
                    'enabled' => true,
                ];
            }
        }

        return [
            'selectedIds' => \is_array($selectedIds) ? implode('|', $selectedIds) : null,
            'onlySelectedEntities' => (bool) $selectedIds,
            'attributes' => $attributes,
        ];
    }
536209
public function functionAction(Request $request)
    {
        $selectFieldProviders = $this->get('phlexible_elementtype.select_field_providers');

        $providerName = $request->get('provider');
        $siterootId = $request->get('siterootId');
        $language = $request->get('language');
        $interfaceLanguage = $this->getUser()->getInterfaceLanguage('en');

        $provider = $selectFieldProviders->get($providerName);
        $data = $provider->getData($siterootId, $interfaceLanguage, $language);

        return new JsonResponse(['data' => $data]);
    }
912616
public function newAction(Request $request)
    {
        /** @var ConfiguratorFactory $configuratorFactory */
        $configuratorFactory = $this->getConfiguratorFactory($this->getClassName());
        /** @var CrudConfigurator $crudConfigurator */
        $crudConfigurator = $configuratorFactory->getConfigurator(CrudConfigurator::class);

        $this->isGrantedOr404Error($crudConfigurator, Constants::ACTION_CREATE);

        /** @var PluginConfigurator $pluginConfigurator */
        $pluginConfigurator = $configuratorFactory->getConfigurator(PluginConfigurator::class);
        $template = $pluginConfigurator->isBulkInsertEnabled() ? $crudConfigurator->getTemplate()->getBulkCreate() : $crudConfigurator->getTemplate()->getCreate();

        $modelClass = $crudConfigurator->getCrud()->getModelClass();
        $model = new $modelClass();
        $form = $crudConfigurator->getForm($model);

        return $this->createOrUpdate($request, $model, $form, Constants::ACTION_CREATE, $template);
    }
392381
public function store(Request $request)
    {
        $this->validate($request, [
            'theme' => 'required',
        ]);

        /** @var Configuration $config */
        $config        = Configuration::query()->firstOrCreate(['key' => 'theme.frontend']);
        $config->value = $request->get('theme');
        $config->save();

        flash()->success(trans('cms::theme.success', ['theme' => $request->get('theme')]));

        return back();
    }
680998
public function resolveRequest(Request $request)
    {
        $format = $request->attributes->get(
            'format',
            $request->attributes->get('_format', 'html')
        );
        
        switch ($format) {
            case 'html':
            case 'page':
                return new DefaultHtmlRenderer();
                break;
            case 'api':
            case 'json':
                return new JsonApiRenderer();
                break;
            default:
                throw new InvalidConfigurationException(sprintf("Unsupported response format %s", $format));
        }
    }
824020
protected function _buildHeaders(Request $request, $options)
    {
        $headers = [];
        foreach ($request->getHeaders() as $name => $values) {
            $headers[] = sprintf('%s: %s', $name, implode(', ', $values));
        }
        $this->_contextOptions['header'] = implode("\r\n", $headers);
    }
1096394
public function changeTypeAction(Request $request)
    {
        $block = $this->findBlockByRequest($request);
        $type = $request->request->get('type', null);
        $removed = [];

        if ($type != $block->getType()) {
            foreach ($this->getViewBuilder()->buildBlock($block)->widgets as $widget) {
                $removed[] = $widget->getAttributes()->getId();
            }

            try {
                $this->getEditor()->getBlockManager()->changeType($block, $type);
            } catch (EditorExceptionInterface $e) {
                return $this->handleException($e);
            }

            $this->validate($block);
            $this->persist($block);
        }

        $data = [
            'removed' => $removed,
            'blocks'  => [
                $this->getViewBuilder()->buildBlock($block),
            ],
        ];

        return $this->buildResponse($data, self::SERIALIZE_CONTENT);
    }
200730
public function bindParameters(Request $request)
    {
        // If the route has a regular expression for the host part of the URI, we will
        // compile that and get the parameter matches for this domain. We will then
        // merge them into this parameters array so that this array is completed.
        $params = $this->matchToKeys(
            array_slice($this->bindPathParameters($request), 1)
        );

        // If the route has a regular expression for the host part of the URI, we will
        // compile that and get the parameter matches for this domain. We will then
        // merge them into this parameters array so that this array is completed.
        if (! is_null($this->compiled->getHostRegex())) {
            $params = $this->bindHostParameters($request, $params);
        }

        return $this->parameters = $this->replaceDefaults($params);
    }