Edits an existing Language entity.

@Route("/{id}", name="admin_language_update")
@Method("PUT")
@Security("has_role('ROLE_ADMIN')")
@Template("BaconLanguageBundle:Backend/Language:edit.html.twig")
543789
public function updateAction(Request $request, $id)
    {
        $breadcumbs = $this->container->get('bacon_breadcrumbs');

        $breadcumbs->addItem(array(
            'title' => 'Language',
            'route' => 'admin_language',
        ));

        $breadcumbs->addItem(array(
            'title' => 'Edit',
            'route' => '',
        ));

        $entity = $this->getDoctrine()->getRepository('BaconLanguageBundle:Language')->find($id);

        if (!$entity) {

            $this->get('session')->getFlashBag()->add('message', array(
                'type' => 'error',
                'message' => 'Registry not Found',
            ));

            return $this->redirect($this->generateUrl('admin_language'));
        }

        $form = $this->createForm(new LanguageFormType(), $entity);
        $deleteForm = $this->createDeleteForm($id);

        $handler = new LanguageFormHandler(
            $form,
            $request,
            $this->getDoctrine()->getManager(),
            $this->get('session')->getFlashBag()
        );

        if ($handler->save()) {
            return $this->redirect($this->generateUrl('admin_language'));
        }

        return array(
            'entity'      => $entity,
            'form'        => $form->createView(),
            'delete_form' => $deleteForm->createView(),
        );
    }
176960
public function saveinnlang()
    {
        parent::save();

        $soxId = $this->getEditObjectId();
        $aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval");

        $oAttr = oxNew(\OxidEsales\Eshop\Application\Model\Attribute::class);

        if ($soxId != "-1") {
            $oAttr->loadInLang($this->_iEditLang, $soxId);
        } else {
            $aParams['oxattribute__oxid'] = null;
        }

        //Disable editing for derived items
        if ($oAttr->isDerived()) {
            return;
        }

        $oAttr->setLanguage(0);
        $oAttr->assign($aParams);

        // apply new language
        $oAttr->setLanguage(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("new_lang"));
        $oAttr->save();

        // set oxid if inserted
        $this->setEditObjectId($oAttr->getId());
    }
121334
public function updateAction(Request $request, Role $role)
    {
        $this->isAllowed('BUSINESS_MANAGE_ROLE');

        $em = $this->getDoctrine()->getManager();

        if (!$role) {
            throw $this->createNotFoundException('Unable to find Role entity.');
        }

        $editForm = $this->createEditForm($role);
        $editForm->handleRequest($request);

        if ($editForm->isValid()) {
            $em->flush();
            $this->get('session')->getFlashBag()->add('success', 'role.flash.updated');

            return $this->redirect($this->generateUrl('sam_role'));
        }

        return $this->render('CanalTPSamEcoreSecurityBundle:Role:edit.html.twig', array(
            'entity'      => $role,
            'edit_form'   => $editForm->createView()
        ));
    }
928181
public function add()
    {
        $this->loadModel('Locale.Languages');
        $language = $this->Languages->newEntity();
        $languages = LocaleToolbox::languagesList(true);
        $icons = LocaleToolbox::flagsList();

        if (!empty($this->request->data['code'])) {
            $info = LocaleToolbox::info($this->request->data['code']);
            $language = $this->Languages->patchEntity($language, [
                'code' => normalizeLocale($this->request->data['code']),
                'name' => $info['language'],
                'direction' => $info['direction'],
                'status' => (isset($this->request->data['status']) ? $this->request->data['status'] : false),
                'icon' => (!empty($this->request->data['icon']) ? $this->request->data['icon'] : null)
            ]);

            if ($this->Languages->save($language)) {
                $this->Flash->success(__d('locale', 'Language was successfully registered!'));
                $this->redirect(['plugin' => 'Locale', 'controller' => 'manage', 'action' => 'index']);
            } else {
                $this->Flash->danger(__d('locale', 'Language could not be registered, please check your information'));
            }
        }

        $this->title(__d('locale', 'Register New Language'));
        $this->set(compact('language', 'languages', 'icons'));
        $this->Breadcrumb
            ->push('/admin/locale')
            ->push(__d('locale', 'Add new language'), '');
    }
13985
def edit
      @menu = Menu.find(params[:id])

      # add breadcrumb and set title
      add_breadcrumb I18n.t("controllers.admin.menus.edit.breadcrumb", menu_name: @menu.name)
      set_title(I18n.t("controllers.admin.menus.edit.title", menu_name: @menu.name))
    end
815428
public function editAction(Request $request)
    {
        $entityManager = $this->getDoctrine()->getManager();
        /** @var GlobalConfigRepository $globalConfigRepository */
        $globalConfigRepository = $entityManager->getRepository(GlobalConfig::class);
        $globalConfig = $globalConfigRepository->findLast() ?: new GlobalConfig();
        $form = $this->createForm(GlobalConfigType::class, $globalConfig, []);
        $initialLogo = $globalConfig->getLogo();
        $form->handleRequest($request);

        $success = true;
        if ($form->isSubmitted()) {
            if (true === $success = $form->isValid()) {
                //cloning the entity will give it a new id in order to invalidate browser cache (in meta.html.twig)
                $entityManager->clear(GlobalConfig::class);
                $entityManager->persist($globalConfig);
                $entityManager->flush();
                if ($initialLogo !== $globalConfig->getLogo() && $globalConfig->getLogo() !== null) {
                    $this->container->get(FaviconGenerator::class)->generate(
                        $globalConfig,
                        $this->getParameter('kernel.project_dir').'/faviconConfig.json'
                    );
                }
                $this->congrat('victoire.config.global.edit.success');

                return new JsonResponse([
                    'url'     => $this->generateUrl('victoire_core_homepage_show'),
                    'success' => true,
                ]);
            }
        }

        return new JsonResponse([
            'html' => $this->renderView('VictoireConfigBundle:global:edit.html.twig', [
                'form' => $form->createView(),
            ]),
            'success' => $success,
        ]);
    }
1200178
public function updateManyToManyAction(Request $request)
    {
        /** @var AbstractAdmin $admin */
        $admin = $this->getAdmin();

        $admin->checkAccess('edit');

        $em = $admin->getDoctrine()->getManager();

        $ids = $request->request->get('value');
        $id = $request->request->get('pk');

        $field = $request->request->get('field');

        $object = $admin->getObject($id);

        /** @var \Sonata\DoctrineORMAdminBundle\Model\ModelManager $mm */
        $mm = $admin->getModelManager();

        $ClassMetadata = $mm->getMetadata($admin->getClass());

        $associationMapping = $ClassMetadata->getAssociationMapping($field);

        $items = $em->getRepository($associationMapping['targetEntity'])->findBy([
            'id' => $ids,
        ]);

        \call_user_func([$object, 'set' . ucfirst($field)], $items);

        $admin->update($object);

        $result = [
        ];

        $associationAdmin = $admin->getAdminByClass($associationMapping['targetEntity']);

        foreach ($items as $item) {
            if (method_exists($item, 'getId') && method_exists($item, 'getName')) {
                $result[] = [
                    'id' => $item->getId(),
                    'label' => $item->getName(),
                    'edit_url' => $associationAdmin->generateObjectUrl('edit', $item),
                ];
            }
        }

        return new JsonResponse([
            'items' => $result,
        ]);
    }
1342286
public function changeAdminLanguageAction(Request $request, $locale)
    {
        $request->getSession()->set('admin/_locale', $locale);

        return new RedirectResponse($request->headers->get('referer'));
    }
1075961
public function deleteAction(Request $request, $id)
    {

        $handler = new LanguageFormHandler(
            $this->createDeleteForm(),
            $request,
            $this->get('doctrine')->getManager(),
            $this->get('session')->getFlashBag()
        );


        $entity = $this->getDoctrine()->getRepository('BaconLanguageBundle:Language')->find($id);

        if ($handler->delete($entity)) {
            return $this->redirect($this->generateUrl('admin_language'));
        }

        return $this->redirect($this->generateUrl('admin_language_show', array('id' => $id)));
    }
714658
public function edit($slug)
    {
        $this->loadModel('Content.ContentTypes');
        $this->loadModel('User.Roles');

        $type = $this->ContentTypes
            ->find()
            ->where(['slug' => $slug])
            ->first();

        if (!$type) {
            throw new NotFoundException(__d('content', 'Content type was not found!'));
        }

        if ($this->request->data()) {
            $type->accessible(['id', 'slug'], false);
            $data = $this->request->data();
            $type = $this->ContentTypes->patchEntity($type, $data);

            if ($this->ContentTypes->save($type, ['associated' => ['Roles']])) {
                $this->Flash->success(__d('content', 'Content type updated!'));
                $this->redirect(['plugin' => 'Content', 'controller' => 'types', 'action' => 'edit', $type->slug]);
            } else {
                $this->Flash->danger(__d('content', 'Content type could not be updated, check your information.'));
            }
        } else {
            // fix for auto-fill "defaults.*" by FormHelper
            $this->request->data = $type->toArray();
        }

        $roles = $this->Roles->find('list');
        $this->title(__d('content', 'Configure Content Type'));
        $this->set(compact('type', 'roles'));
        $this->set('languages', LocaleToolbox::languagesList());
        $this->Breadcrumb
            ->push('/admin/content/manage')
            ->push(__d('content', 'Content Types'), '/admin/content/types')
            ->push(__d('content', 'Editing "{0}" Content Type', $type->name), '');
    }
986243
public function addAction(Request $request, $id)
    {
        $this->init($request);
        /* @var Node $parentNode */
        $parentNode = $this->em->getRepository('KunstmaanNodeBundle:Node')->find($id);

        // Check with Acl
        $this->denyAccessUnlessGranted(PermissionMap::PERMISSION_EDIT, $parentNode);

        $parentNodeTranslation = $parentNode->getNodeTranslation($this->locale, true);
        $parentNodeVersion = $parentNodeTranslation->getPublicNodeVersion();
        $parentPage = $parentNodeVersion->getRef($this->em);

        $type = $this->validatePageType($request);
        $newPage = $this->createNewPage($request, $type);
        $newPage->setParent($parentPage);

        /* @var Node $nodeNewPage */
        $nodeNewPage = $this->em->getRepository('KunstmaanNodeBundle:Node')
            ->createNodeFor($newPage, $this->locale, $this->user);
        $nodeTranslation = $nodeNewPage->getNodeTranslation(
            $this->locale,
            true
        );
        $weight = $this->em->getRepository('KunstmaanNodeBundle:NodeTranslation')
                ->getMaxChildrenWeight($parentNode, $this->locale) + 1;
        $nodeTranslation->setWeight($weight);

        if ($newPage->isStructureNode()) {
            $nodeTranslation->setSlug('');
        }

        $this->em->persist($nodeTranslation);
        $this->em->flush();

        $this->aclManager->updateNodeAcl($parentNode, $nodeNewPage);

        $nodeVersion = $nodeTranslation->getPublicNodeVersion();

        $this->get('event_dispatcher')->dispatch(
            Events::ADD_NODE,
            new NodeEvent(
                $nodeNewPage, $nodeTranslation, $nodeVersion, $newPage
            )
        );

        return $this->redirect(
            $this->generateUrl(
                'KunstmaanNodeBundle_nodes_edit',
                array('id' => $nodeNewPage->getId())
            )
        );
    }
1112181
def edit
      @admin = current_admin.id == params[:id].to_i ? @current_admin : Admin.find(params[:id])

      # add breadcrumb and set title
      set_title(I18n.t("controllers.admin.administrators.edit.title", username: @admin.username))
      add_breadcrumb I18n.t("controllers.admin.administrators.edit.breadcrumb")

      # action for the form as both edit/new are using the same form.
      @action = 'update'

      # only allowed to edit the super user if you are the super user.
      if @admin.overlord == 'Y' && @admin.id != session[:admin_id]

        respond_to do |format|

          flash[:error] = I18n.t("controllers.admin.administrators.edit.flash.error")
          format.html { redirect_to admin_administrators_path }

        end

      end
    end
854132
public function edit(Language $language)
    {
        $extends = $this->viewExtends;
        $section = $this->viewSection;

        return view($this->viewNamespace . '.edit', compact('language', 'extends', 'section'));
    }
1148693
public function updateLanguageAction()
    {
        $response = array();
        $success = 0;
        $excludeModules = array('.', '..', '.gitignore', 'MelisSites', 'MelisInstaller');

        $textTitle = 'tr_meliscore_header_language_Language';
        $textMessage = 'tr_meliscore_tool_language_update_failed';

        $this->getEventManager()->trigger('meliscore_language_update_start', $this, $response);
        $translationSvc = $this->getServiceLocator()->get('MelisCoreTranslation');
        $moduleSvc = $this->getServiceLocator()->get('ModulesService');
        $vendorModules = $moduleSvc->getVendorModules();
        $melisCoreConfig = $this->getServiceLocator()->get('MelisCoreConfig');
        $directory = $melisCoreConfig->getItem('meliscore/datas/default/langauges/default_trans_dir');
        $melisTool = $this->getServiceLocator()->get('MelisCoreTool');
        $fullPathVendorModules = null;
        
        if($this->getRequest()->isPost()){
            $id = (int) $this->getRequest()->getPost('id');
            $locale = $melisTool->sanitize($this->getRequest()->getPost('locale'));
            if(!empty($locale)){
                foreach($vendorModules as $vModule) {

                    $vPath = $moduleSvc->getModulePath($vModule) . '/language/';
                    if(file_exists($vPath) && is_writable($vPath)) {
                        $fullPathVendorModules[] = array('module' => $vModule, 'path' => $vPath);
                    }
                }

                if($fullPathVendorModules) {
                    foreach($fullPathVendorModules as $vModuleConf) {
                        $success = $translationSvc->createOrUpdateTranslationFiles($vModuleConf['path'], $vModuleConf['module'], $locale);
                        if(!$success){
                            break;
                        }
                    }
                }

                if($success){
                    $textMessage = 'tr_meliscore_tool_language_edit_success';
                }
            }

        }

        $response = array(
            'textTitle' => $textTitle,
            'textMessage' => $textMessage,
            'success' => $success
        );
        $this->getEventManager()->trigger('meliscore_language_update_end', $this, $response);

        return new JsonModel($response);

    }
743303
public function updateAction()
    {
        // Check current user authorization
        if (null !== $response = $this->checkAuth(AdminResources::MODULE, Team::getModuleCode(),
                AccessManager::UPDATE)
        ) {
            return $response;
        }

        // Load object if exist
        if (null !== $object = $this->getExistingObject()) {
            // Hydrate the form abd pass it to the parser
            $changeForm = $this->hydrateObjectForm($object);

            // Pass it to the parser
            $this->getParserContext()->addForm($changeForm);
        }

        // Render the edition template.
        return $this->getEditRenderTemplate();
    }
84185
public function update(Requests\CreateBlogRequest $request, $id)
    {
        $data = $request->all();
        $data['user_id'] = \Auth::user()->id;
        $this->service->edit($id, $data);
        flash()->success('Se ha editado el articulo');
        return redirect()->to('backend/blog');
    }
732986
public function edit($id)
    {
        if (! $role = $this->role->find($id)) {
            flash(trans('core::messages.resource.resource not found', ['name' => trans('user::roles.title.role')]));

            return redirect()->route('backend::user.role.index');
        }

        return view('user::backend.roles.edit', compact('role'));
    }