Save the page admin settings.

@param Request $request
@param Page    $page
968020
public function postAdmin(Request $request, Page $page)
    {
        $this->authorize('editAdmin', $page);

        $page
            ->setInternalName($request->input('internal_name'))
            ->setAddPageBehaviour($request->input('add_behaviour'))
            ->setChildAddPageBehaviour($request->input('child_add_behaviour'))
            ->setDisableDelete($request->has('disable_delete'));

        PageFacade::save($page);
    }
1287830
public function update(Request $request, FormBuilder $formBuilder, $page)
    {
        // Set roles that have access
        $request->user()->authorizeRoles(['admin', 'editor']);

        // Get page
        $page = Page::withTrashed()->findOrFail($page);

        // Get pagetype, or fail..
        $pagetype = PageType::where('model', $page->pagetype_model)->first();

        // Get fields
        $fields = $pagetype->fields ?: [];

        // Build the form
        $form = $formBuilder->createByArray($fields, [
            'method' => 'POST',
            'url' => route('admin.pages.page.store'),
            'name' => 'content'
        ]);

        // It will automatically use current request, get the rules, and do the validation
        if (!$form->isValid()) {
            return redirect()->back()->withErrors($form->getErrors())->withInput();
        }

        // Page data
        $page->title = $request->input('title');
        $page->content = $request->input('content');
        $page->status = $request->input('status') ? 2 : 1;

        $page->update();

        flash('The page was successfully updated')->success();

        return redirect()->route('admin.pages.index');
    }
562518
public function postFeature(Request $request, Page $page)
    {
        $this->authorize('editFeature', $page);

        $page->setFeatureImageId($request->input('feature_image_id'));

        PageFacade::save($page);
    }
1096416
def save_form(self, request, form, change):
        """"""
        instance = super(PageAdmin, self).save_form(request, form, change)
        instance.template = form.cleaned_data['template']
        if not change:
            instance.author = request.user
        return instance
1271289
public function bindRequest(Request $request)
    {
        $query = $request->query;
        $session = $request->getSession();

        $adminListName = 'listconfig_'.$request->get('_route');

        $this->page = $request->query->getInt('page', 1);
        // Allow alphanumeric, _ & . in order by parameter!
        $this->orderBy = preg_replace('/[^[a-zA-Z0-9\_\.]]/', '', $request->query->get('orderBy', ''));
        $this->orderDirection = $request->query->getAlpha('orderDirection', '');

        // there is a session and the filter param is not set
        if ($session->has($adminListName) && !$query->has('filter')) {
            $adminListSessionData = $request->getSession()->get($adminListName);
            if (!$query->has('page')) {
                $this->page = $adminListSessionData['page'];
            }

            if (!$query->has('orderBy')) {
                $this->orderBy = $adminListSessionData['orderBy'];
            }

            if (!$query->has('orderDirection')) {
                $this->orderDirection = $adminListSessionData['orderDirection'];
            }
        }

        // save current parameters
        $session->set(
            $adminListName,
            array(
                'page' => $this->page,
                'orderBy' => $this->orderBy,
                'orderDirection' => $this->orderDirection,
            )
        );

        $this->getFilterBuilder()->bindRequest($request);
    }
10159
public function saveBlockConfiguration(ServerRequestInterface $request, int $block_id): void
    {
        $this->setBlockSetting($block_id, 'num', $request->get('num', self::DEFAULT_NUMBER));
        $this->setBlockSetting($block_id, 'infoStyle', $request->get('infoStyle', self::DEFAULT_STYLE));
    }
67492
public function indexAction(Request $request, $page = null)
    {
        $em = $this->getDoctrine()->getManager();

        $category = null;
        $category_slug = $request->get('category', null);
        $category = $em->getRepository('AmulenClassificationBundle:Category')->findOneBySlug($category_slug);

        /* seo metadata */
        $seoPage = $this->container->get('sonata.seo.page');
        $baseTitle = $seoPage->getTitle();
        $title = "Productos - " . $baseTitle;
        $seoPage->setTitle($title);

        /* @var SettingsService $settingSrv */
        $settingSrv = $this->get('amulen.shop.settings');
        $isAvailable = $settingSrv->shopIsAvailable();

        /* pagination */
        $pageNumber = $request->get('page') ? $request->get('page') : 1;
        $products = $this->getDoctrine()->getRepository("AmulenShopBundle:Product")->findEnabledByPageAndCategory($category_slug);

        /* Filter */
        $formFilter = $this->createForm($this->get("amulen.shop.form.filter.shop"), null, array(
            'action' => $this->generateUrl('product'),
            'method' => 'GET',
        ));
        $formFilter->handleRequest($request);
        if ($formFilter->isValid()) {
            $productService = $this->get("amulen.shop.product");
            $products = $productService->addFilterConditions($formFilter, $products, $request->get('search'));
        }

        $pagination = $this->get('knp_paginator')->paginate($products, $pageNumber, 4);

        return array(
            'shop_is_available' => $isAvailable,
            'pagination' => $pagination,
            'category' => $category,
            'page' => $page,
            'formFilter' => $formFilter->createView(),
            'search' => $request->get('search'),
            'priceSort' => $request->get('priceSort')
        );
    }
840246
public function update(Page $page, FormRequest $request)
    {
        $data = $request->all();
        $data['parent_id'] = $data['parent_id'] ?: null;
        $this->repository->update($page->id, $data);
        event('page.resetChildrenUri', [$page]);
        Menulinks::forgetCache();

        return $this->redirect($request, $page);
    }
601770
public function savePositionAction(Request $request = null)
    {
        $this->admin->checkAccess('savePosition');

        try {
            $params = $request->get('disposition');

            if (!\is_array($params)) {
                throw new HttpException(400, 'wrong parameters');
            }

            $result = $this->get('sonata.page.block_interactor')->saveBlocksPosition($params, false);

            $status = 200;

            $pageAdmin = $this->get('sonata.page.admin.page');
            $pageAdmin->setRequest($request);
            $pageAdmin->update($pageAdmin->getSubject());
        } catch (HttpException $e) {
            $status = $e->getStatusCode();
            $result = [
                'exception' => \get_class($e),
                'message' => $e->getMessage(),
                'code' => $e->getCode(),
            ];
        } catch (\Exception $e) {
            $status = 500;
            $result = [
                'exception' => \get_class($e),
                'message' => $e->getMessage(),
                'code' => $e->getCode(),
            ];
        }

        $result = (true === $result) ? 'ok' : $result;

        return $this->renderJson(['result' => $result], $status);
    }
955388
public function settingsPostAction(Request $request, View $view)
    {
        $em = $this->getDoctrine()->getManager();

        $pageSeo = $view->getSeo() ?: new PageSeo();
        $form = $this->createSettingsForm($pageSeo, $view);

        $form->handleRequest($request);
        $novalidate = $request->query->get('novalidate', false);

        if (false === $novalidate && $form->isValid()) {
            $em->persist($pageSeo);
            $view->setSeo($pageSeo);
            $em->persist($view);
            $em->flush();

            $this->get('victoire_core.current_view')->setCurrentView($view);
            $this->congrat('victoire_seo.save.success');

            $response = [
                'success' => true,
                'url'     => $this->getViewUrl($view),
            ];
        } else {
            $response = $this->getNotPersistedSettingsResponse($form, $view, $novalidate);
        }

        return new JsonResponse($response);
    }
718069
public function saveBlockConfiguration(ServerRequestInterface $request, int $block_id): void
    {
        $days = $request->get('days', self::DEFAULT_DAYS);

        if ((int) $days > self::MAX_DAYS || (int) $days < 1) {
            $days = self::DEFAULT_DAYS;
        }

        $this->setBlockSetting($block_id, 'days', $days);
        $this->setBlockSetting($block_id, 'infoStyle', $request->get('infoStyle', self::DEFAULT_INFO_STYLE));
        $this->setBlockSetting($block_id, 'sortStyle', $request->get('sortStyle', self::DEFAULT_SORT_STYLE));
        $this->setBlockSetting($block_id, 'show_user', $request->get('show_user', self::DEFAULT_SHOW_USER));
    }
1242671
public function saveOptionsForm(Request $request)
    {
        $this->config->save('editor.concrete.enable_filemanager', (bool) $request->request->get('enable_filemanager'));
        $this->config->save('editor.concrete.enable_sitemap', (bool) $request->request->get('enable_sitemap'));

        $selected = $this->config->get('editor.ckeditor4.plugins.selected_hidden');
        $post = $request->request->get('plugin');
        if (is_array($post)) {
            $selected = array_merge($selected, $post);
        }
        $plugins = [];
        foreach ($selected as $plugin) {
            if ($this->pluginManager->isAvailable($plugin)) {
                $plugins[] = $plugin;
            }
        }

        $this->config->save('editor.ckeditor4.plugins.selected', $plugins);
    }
1085429
protected function settingsAction(Request $request, BasePage $page)
    {
        $form = $this->createSettingsForm($page);

        return  [
            'success' => true,
            'html'    => $this->get('templating')->render(
                $this->getBaseTemplatePath().':settings.html.twig',
                [
                    'page'               => $page,
                    'form'               => $form->createView(),
                    'businessProperties' => $this->getBusinessProperties($page),
                ]
            ),
        ];
    }
998987
public function restore(Request $request, $page)
    {
        // Set roles that have access
        $request->user()->authorizeRoles(['admin', 'editor']);

        $page = Page::withTrashed()->findOrFail($page);
        $page->restore();

        flash('Page has been successfully restored')->success();

        return back();
    }
1179036
public function save(\Illuminate\Http\Request $request)
    {
        if (($content = $this->getContent()) instanceof FormElementInterface) {
            $content->save($request);
        }
    }
1235844
public function save(\Illuminate\Http\Request $request)
    {
        if (is_null($this->getModelForOptions())) {
            parent::save($request);
        }
    }
307203
public function store(Request $request)
    {
        $this->validate($request, [
            'slug'      => 'required',
            'default'   => 'required',
            'value'     => 'required',
        ]);

        $input = $request->all();

        $configuration = new Configuration();
        $configuration->create($input);

        Session::flash('configuration', 'Setting saved successfully.');
        \Cache::forget('ticketit::settings'); // refresh cached settings
        return redirect()->action('\Kordy\Ticketit\Controllers\ConfigurationsController@index');
    }