Edit account settings.

@param \Illuminate\Http\Request $request

@return \Illuminate\View\View
334046
public function edit(Request $request)
    {
        $countries = collect(countries())->map(function ($country, $code) {
            return [
                'id' => $code,
                'text' => $country['name'],
                'emoji' => $country['emoji'],
            ];
        })->values();
        $languages = collect(languages())->pluck('name', 'iso_639_1');
        $genders = ['male' => trans('cortex/auth::common.male'), 'female' => trans('cortex/auth::common.female')];

        return view('cortex/auth::adminarea.pages.account-settings', compact('countries', 'languages', 'genders'));
    }
1304217
public function edit(User $user)
    {
        $roles         = $this->getAllowedRoles();
        $selectedRoles = $user->roles()->pluck('roles.id');

        return view('administrator.users.edit', compact('user', 'roles', 'selectedRoles'));
    }
360736
public function update(Request $request)
    {
        $this->validate($request, [
            'navbar_color' => 'max:255',
            'favicon'      => 'url|max:2000',
        ]);
        Customization::first()->update([
            // 'color'             => $request->input('color'),
            // 'background_color'  => $request->input('background_color'),
            'navbar_color'      => $request->navbar_color,
            'favicon'           => $request->favicon,
        ]);

        return redirect()->route('laralum::settings.index', ['p' => 'Customization'])->with('success', __('laralum_customization::general.updated_settings'));
    }
217917
public function editAction(Request $request, $id)
    {
        /** @var ConfiguratorFactory $configuratorFactory */
        $configuratorFactory = $this->getConfiguratorFactory($this->getClassName());
        /** @var CrudConfigurator $crudConfigurator */
        $crudConfigurator = $configuratorFactory->getConfigurator(CrudConfigurator::class);

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

        $model = $this->findOr404Error($id);
        $form = $crudConfigurator->getForm($model);

        return $this->createOrUpdate($request, $model, $form, Constants::ACTION_UPDATE, $crudConfigurator->getTemplate()->getEdit());
    }
120322
public function store(Request $request)
    {
        try {
            $permission = $this->permissions->save($request);
        } catch (Exception $e) {
            return $this->handleException($e, trans('soda::errors.create', ['object' => 'permission']));
        }

        return redirect()->route('soda.permissions.edit', $permission->getKey())->with('success', trans('soda::messages.created', ['object' => 'permission']));
    }
1045194
public function edit($id)
    {
      $user  = $this->users->findOrFail($id);
      $roles = Role::pluck('name', 'id');
      return \View::make('admin.users.edit', [
        'user'              =>  $user,
        'roles'              =>  $roles,
        'title'              => 'edit',
      ]);
    }
935513
public function EditForm($request = null) {
		HtmlEditorField::include_js();

		$cur = $this->getCurrentPageID();
		if ($cur) {
			$record = $this->currentPage();
			if (!$record)
				return false;
			if ($record && !$record->canView())
				return Security::permissionFailure($this);
		}

		if ($this->hasMethod('getEditForm')) {
			return $this->getEditForm($this->getCurrentPageID());
		}

		return false;
	}
940869
public function store(Request $request)
    {
        $setting = new Setting();

        
        $setting->name = $request->name;

        
        $setting->description = $request->description;

        
        
        $setting->save();

        return redirect('setting');
    }
471141
public function patchSettingsAction(Request $request)
    {
        $settings = $request->request->all();

        try {
            $user = $this->tokenStorage->getToken()->getUser();

            foreach ($settings as $settingKey => $settingValue) {
                // get setting
                // TODO: move this logic into own service (UserSettingManager?)
                $setting = $this->userSettingRepository->findOneBy(['user' => $user, 'key' => $settingKey]);

                // or create new one
                if (!$setting) {
                    $setting = new UserSetting();
                    $setting->setKey($settingKey);
                    $setting->setUser($user);
                    $this->objectManager->persist($setting);
                }

                // persist setting
                $setting->setValue(json_encode($settingValue));
            }
            $this->objectManager->flush();

            //create view
            $view = View::create($settings, 200);
        } catch (RestException $exc) {
            $view = View::create($exc->toArray(), 400);
        }

        return $this->viewHandler->handle($view);
    }
1154811
public function run(Request $request) {
		$page = $this->getServiceContainer()->getKernel()->getApplication()->getPage();
		$page->setTitle($this->getServiceContainer()->getTranslator()->trans('dashboard'));
		$user = $this->getServiceContainer()->getAuthManager()->getUser();
		$activities = ActivityQuery::create()->filterByActor($user)->limit(5)->orderById(Criteria::DESC)->find();
		$reg = $this->getServiceContainer()->getExtensionRegistry();
		return $this->responder->run($request, new Blank([
			'settings' => $reg->getExtensions(AccountModule::EXT_SETTINGS),
			'activities' => $activities
		]));
	}
209835
public function editAction(Request $request, $id)
    {
        /** @var Config $data */
        $data = $this->manager->find($id);

        if (!$data) {
            throw $this->createNotFoundException();
        }

        try {
            $adapter = $this->registry->getAdapter($data->getAdapter());
        } catch (Exception $e) {
            throw $this->createNotFoundException('Not Found', $e);
        }

        $event = new GetResponseConfigEvent($data, $request);

        if ($this->dispatcher->dispatch(IntegratedChannelEvents::CONFIG_EDIT_REQUEST, $event)->getResponse()) {
            return $event->getResponse();
        }

        $form = $this->createEditForm($data, $adapter);
        $form->handleRequest($request);

        if ($form->get('actions')->getData() == 'cancel') {
            return $this->redirect($this->generateUrl('integrated_channel_config_index'));
        }

        if ($form->isSubmitted() && $form->isValid()) {
            $event = $this->dispatcher->dispatch(
                IntegratedChannelEvents::CONFIG_EDIT_SUBMITTED,
                new FormConfigEvent($data, $request, $form)
            );

            $this->manager->persist($data);

            if (!$response = $event->getResponse()) {
                if ($message = $this->getFlashMessage()) {
                    $message->success(sprintf('The changes to the config %s are saved', $data->getName()));
                }

                $response = $this->redirect($this->generateUrl('integrated_channel_config_index'));
            }

            $this->dispatcher->dispatch(
                IntegratedChannelEvents::CONFIG_EDIT_RESPONSE,
                new FilterResponseConfigEvent($data, $request, $response)
            );

            return $response;
        }

        return $this->render('IntegratedChannelBundle:Config:edit.html.twig', [
            'adapter' => $adapter,
            'data'    => $data,
            'form'    => $form->createView()
        ]);
    }
96819
public function editAction(Request $request)
    {
        $user = $this->getUser();
        $repository = $this->get('ekyna_user.address.repository');

        if (null === $address = $repository->find($request->attributes->get('addressId'))) {
            throw new NotFoundHttpException('Address not found.');
        }
        if ($address->getUser()->getId() !== $user->getId()) {
            throw new AccessDeniedHttpException('Access denied');
        }

        $cancelPath = $this->generateUrl('ekyna_user_address_list');

        /** @var \Symfony\Component\Form\FormInterface $form */
        $form = $this
            ->createForm('ekyna_user_address', $address, [
                '_redirect_enabled' => true,
            ])
            ->add('actions', 'form_actions', [
                'buttons' => [
                    'save' => [
                        'type' => 'submit', 'options' => [
                            'button_class' => 'primary',
                            'label' => 'ekyna_core.button.save',
                            'attr' => [
                                'icon' => 'ok',
                            ],
                        ],
                    ],
                    'cancel' => [
                        'type' => 'button', 'options' => [
                            'label' => 'ekyna_core.button.cancel',
                            'button_class' => 'default',
                            'as_link' => true,
                            'attr' => [
                                'class' => 'form-cancel-btn',
                                'icon' => 'remove',
                                'href' => $cancelPath,
                            ],
                        ],
                    ],
                ],
            ])
        ;

        $form->handleRequest($request);
        if ($form->isValid()) {
            $event = $this->get('ekyna_user.address.operator')->update($address);
            if (!$event->isPropagationStopped()) {
                $this->addFlash('ekyna_user.address.message.edit.success', 'success');
                if (null !== $redirectPath = $form->get('_redirect')->getData()) {
                    return $this->redirect($redirectPath);
                }
                return $this->redirect($cancelPath);
            }
            $this->addFlash('ekyna_user.address.message.edit.failure', 'danger');
        }

        return $this->render('EkynaUserBundle:Address:edit.html.twig', [
            'address' => $address,
            'form' => $form->createView()
        ]);
    }
894140
public function updateAction(Request $request)
    {
        $schemaAlias = $request->attributes->get('schema');

        $this->isGrantedOr403($schemaAlias);

        $settingsManager = $this->getSettingsManager();
        $settings = $settingsManager->load($schemaAlias);

        $isApiRequest = $this->isApiRequest($request);

        $form = $this
            ->getSettingsFormFactory()
            ->create($schemaAlias, $settings, $isApiRequest ? ['csrf_protection' => false] : [])
        ;

        if ($form->handleRequest($request)->isValid()) {
            $messageType = 'success';
            try {
                $settingsManager->save($settings);
                $message = $this->getTranslator()->trans('sylius.settings.update', [], 'flashes');
            } catch (ValidatorException $exception) {
                $message = $this->getTranslator()->trans($exception->getMessage(), [], 'validators');
                $messageType = 'error';
            }

            if ($isApiRequest) {
                return $this->handleView($this->view(null, Response::HTTP_NO_CONTENT));
            }

            $request->getSession()->getBag('flashes')->add($messageType, $message);

            if ($request->headers->has('referer')) {
                return $this->redirect($request->headers->get('referer'));
            }
        }

        return $this->render($request->attributes->get('template', 'SyliusSettingsBundle:Settings:update.html.twig'), [
            'settings' => $settings,
            'form' => $form->createView(),
        ]);
    }
1099744
public function edit(Request $request, $key)
    {
        if ($request->wantsJson()) {
            return $this->validNotFoundJsonResponse();
        }

        $model = $this->findFirstByKey($key);

        if (!$model) {
            abort(404);
        }

        $view = $this->getViewLocation(__FUNCTION__);
        $this->checkViewExists($view);

        return response()->view($view, compact('model'));
    }
164003
public function formAction(Request $request)
    {
        $this->denyAccessUnlessGranted(ContributionActionInterface::EDIT, WorkflowProfile::ENTITY_TYPE);
        $currentLocale = $this->get('open_orchestra_backoffice.context_backoffice_manager')->getBackOfficeLanguage();
        $profiles = $this->get('open_orchestra_model.repository.workflow_profile')
            ->findAllOrderedByLocale($currentLocale);

        $form = $this->createForm('oo_workflow_transitions', $profiles, array(
           'action' => $this->generateUrl('open_orchestra_workflow_admin_transitions_form')
        ));

        $form->handleRequest($request);
        $message = $this->get('translator')->trans('open_orchestra_workflow_admin.form.transitions.success');
        if ($this->handleForm($form, $message)) {
            foreach ($profiles as $profile) {
                $this->dispatchEvent(WorkflowProfileEvents::WORKFLOW_PROFILE_UPDATE, new WorkflowProfileEvent($profile));
            }
        }

        return $this->renderAdminForm($form);
    }
23399
public function update(Request $request)
    {
        $user = \App\User::findOrfail($request->user_id);

        $user->email = $request->email;
        $user->name = $request->name;
        $user->password = Hash::make($request->password);

        $user->save();

        return redirect('scaffold-users');
    }
33933
public function editIndexAction(Request $request)
    {
        /* @var $em EntityManager */
        $em = $this->getDoctrine()->getManager();

        /* @var DashboardConfiguration $dashboardConfiguration */
        $dashboardConfiguration = $em
            ->getRepository('KunstmaanAdminBundle:DashboardConfiguration')
            ->findOneBy(array());

        if (is_null($dashboardConfiguration)) {
            $dashboardConfiguration = new DashboardConfiguration();
        }
        $form = $this->createForm(DashboardConfigurationType::class, $dashboardConfiguration);

        if ($request->isMethod('POST')) {
            $form->handleRequest($request);
            if ($form->isSubmitted() && $form->isValid()) {
                $em->persist($dashboardConfiguration);
                $em->flush($dashboardConfiguration);

                $this->addFlash(
                    FlashTypes::SUCCESS,
                    $this->get('translator')->trans('kuma_admin.edit.flash.success')
                );

                return new RedirectResponse($this->generateUrl('KunstmaanAdminBundle_homepage'));
            }
        }

        return array(
            'form' => $form->createView(),
            'dashboardConfiguration' => $dashboardConfiguration,
        );
    }