Update the configuration for a block.

@param ServerRequestInterface $request
@param int     $block_id

@return void
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));
    }
833841
protected function updateBlock(array $block, $idLanguage, $idPage)
    {
        $block["LanguageId"] = $idLanguage;
        $block["PageId"] = $idPage;

        $className = $this->blockRepository->getRepositoryObjectClassName();
        $modelObject = new $className();

        $result = $this->blockRepository
                    ->setRepositoryObject($modelObject)
                    ->save($block);

        return $result;
    }
22875
public function editBlockConfiguration(Tree $tree, int $block_id): void
    {
        $show_other      = $this->getBlockSetting($block_id, 'show_other', self::DEFAULT_SHOW_OTHER);
        $show_unassigned = $this->getBlockSetting($block_id, 'show_unassigned', self::DEFAULT_SHOW_UNASSIGNED);
        $show_future     = $this->getBlockSetting($block_id, 'show_future', self::DEFAULT_SHOW_FUTURE);

        echo view('modules/todo/config', [
            'show_future'     => $show_future,
            'show_other'      => $show_other,
            'show_unassigned' => $show_unassigned,
        ]);
    }
1218323
public function show(BlockRequest $request, Block $block)
    {

        if ($block->exists) {
            $view = 'block::admin.block.show';
        } else {
            $view = 'block::admin.block.new';
        }

        return $this->response->setMetaTitle(trans('app.view') . ' ' . trans('block::block.name'))
            ->data(compact('block'))
            ->view($view)
            ->output();
    }
1054738
public function saveBlockConfiguration(ServerRequestInterface $request, int $block_id): void
    {
        $this->setBlockSetting($block_id, 'days', $request->get('days', self::DEFAULT_DAYS));
        $this->setBlockSetting($block_id, 'filter', $request->get('filter', ''));
        $this->setBlockSetting($block_id, 'infoStyle', $request->get('infoStyle', self::DEFAULT_STYLE));
        $this->setBlockSetting($block_id, 'sortStyle', $request->get('sortStyle', self::DEFAULT_SORT));
        $this->setBlockSetting($block_id, 'events', implode(',', (array) $request->get('events')));
    }
1323423
public function updateLists(ServerRequestInterface $request): ResponseInterface
    {
        $modules = $this->module_service->findByInterface(ModuleListInterface::class, true);

        $this->updateStatus($modules, $request);
        $this->updateAccessLevel($modules, ModuleListInterface::class, $request);

        return redirect(route('lists'));
    }
1008460
public function update(Request $request, $id)
    {
        /** @var \SymfonyId\AdminBundle\Configuration\ConfiguratorFactory $configuratorFactory */
        $configuratorFactory = $this->getConfiguratorFactory($this->getClassName());
        /** @var CrudConfigurator $crudConfigurator */
        $crudConfigurator = $configuratorFactory->getConfigurator(CrudConfigurator::class);

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

        /** @var ModelInterface $model */
        $model = $this->findOr404Error($id);
        $form = $crudConfigurator->getForm($model, 'PUT');

        return $this->save($request, $form, $crudConfigurator);
    }
959195
def setBlockRequested(blockInfo, bool)
      if bool
        @requestedBlocks.set blockInfo.blockIndex
      else
        @requestedBlocks.clear blockInfo.blockIndex
      end
    end
23732
public function getOptions(ServerRequestInterface $request): void
    {
        parent::getOptions($request);

        $this->surname = $request->get('surname', 'replace');
    }
995771
private function updateOrder(Collection $modules, string $column, ServerRequestInterface $request): void
    {
        $order = (array) ($request->getParsedBody()['order'] ?? []);
        $order = array_flip($order);

        foreach ($modules as $module) {
            DB::table('module')
                ->where('module_name', '=', $module->name())
                ->update([
                    $column => $order[$module->name()] ?? 0,
                ]);
        }
    }
886533
public function userPageUserUpdate(ServerRequestInterface $request): ResponseInterface
    {
        $user_id     = (int) $request->get('user_id');
        $main_blocks = (array) $request->get('main');
        $side_blocks = (array) $request->get('side');

        $this->updateUserBlocks($user_id, $main_blocks, $side_blocks);

        return redirect(route('admin-control-panel'));
    }
220681
public function treePageBlock(ServerRequestInterface $request, Tree $tree): ResponseInterface
    {
        $block_id = $request->get('block_id');

        $block_id = (int) DB::table('block')
            ->where('block_id', '=', $block_id)
            ->where('gedcom_id', '=', $tree->id())
            ->value('block_id');

        $module = $this->getBlockModule($tree, $block_id);

        $html = view('layouts/ajax', [
            'content' => $module->getBlock($tree, $block_id, 'gedcom'),
        ]);

        return response($html);
    }
716818
public function postUpdate($object): void
    {
        /** @var BlockAdmin $block */
        $blockManager = $this->blockManager;

        $block = $blockManager->get($object);
        $block->postUpdate($object);

        $service = $blockManager->get($object);

        $this->cacheManager->invalidate($service->getCacheKeys($object));
    }
160993
public function updateBlocks(ServerRequestInterface $request): ResponseInterface
    {
        $modules = $this->module_service->findByInterface(ModuleBlockInterface::class, true);

        $this->updateStatus($modules, $request);
        $this->updateAccessLevel($modules, ModuleBlockInterface::class, $request);

        return redirect(route('blocks'));
    }
1009539
public function editBlockConfiguration(Tree $tree, int $block_id): void
    {
        $filter   = $this->getBlockSetting($block_id, 'filter', 'all');
        $controls = $this->getBlockSetting($block_id, 'controls', '1');
        $start    = $this->getBlockSetting($block_id, 'start', '0');

        $filters = [
            'audio'       => $this->getBlockSetting($block_id, 'filter_audio', '0'),
            'book'        => $this->getBlockSetting($block_id, 'filter_book', '1'),
            'card'        => $this->getBlockSetting($block_id, 'filter_card', '1'),
            'certificate' => $this->getBlockSetting($block_id, 'filter_certificate', '1'),
            'coat'        => $this->getBlockSetting($block_id, 'filter_coat', '1'),
            'document'    => $this->getBlockSetting($block_id, 'filter_document', '1'),
            'electronic'  => $this->getBlockSetting($block_id, 'filter_electronic', '1'),
            'fiche'       => $this->getBlockSetting($block_id, 'filter_fiche', '1'),
            'film'        => $this->getBlockSetting($block_id, 'filter_film', '1'),
            'magazine'    => $this->getBlockSetting($block_id, 'filter_magazine', '1'),
            'manuscript'  => $this->getBlockSetting($block_id, 'filter_manuscript', '1'),
            'map'         => $this->getBlockSetting($block_id, 'filter_map', '1'),
            'newspaper'   => $this->getBlockSetting($block_id, 'filter_newspaper', '1'),
            'other'       => $this->getBlockSetting($block_id, 'filter_other', '1'),
            'painting'    => $this->getBlockSetting($block_id, 'filter_painting', '1'),
            'photo'       => $this->getBlockSetting($block_id, 'filter_photo', '1'),
            'tombstone'   => $this->getBlockSetting($block_id, 'filter_tombstone', '1'),
            'video'       => $this->getBlockSetting($block_id, 'filter_video', '0'),
        ];

        $formats = GedcomTag::getFileFormTypes();

        echo view('modules/random_media/config', [
            'controls' => $controls,
            'filter'   => $filter,
            'filters'  => $filters,
            'formats'  => $formats,
            'start'    => $start,
        ]);
    }
723376
public function update(Request $request, $id)
    {
        $this->validate(
            $request,
            [
                'key' => 'required|string|unique:settings,key,' . $id,
                'value' => 'required'
            ]
        );
        $requestData = $request->all();

        $setting = Setting::findOrFail($id);
        $setting->update($requestData);

        return redirect('admin/settings')->with('flash_message', 'Setting updated!');
    }
1316503
public function blocksAction($page_id)
    {
        $em = $this->getDoctrine()->getManager();
        $availableLangs = $this->container->getParameter('flowcode_page.available_languages');
        $entities = array();
        $types = array("type_html", "type_text");
        foreach ($availableLangs as $key => $value) {
            $entities[] = array(
                'lang' => $key,
                'blocks' => $em->getRepository('AmulenPageBundle:Block')->findBlockByPageAndLangAndInType($page_id, $value, $types)
            );
        }
        $page = $em->getRepository('AmulenPageBundle:Page')->find($page_id);

        return array(
            'page' => $page,
            'entities' => $entities,
        );
    }