Edits page
@param string $id Page ID
@return \Cake\Network\Response|null|void
762227
public function edit($id = null)
    {
        $page = $this->Pages->findById($id)
            ->formatResults(function (ResultSet $results) {
                return $results->map(function (Page $page) {
                    return $page->set('created', $page->created->i18nFormat(FORMAT_FOR_MYSQL));
                });
            })
            ->firstOrFail();

        if ($this->request->is(['patch', 'post', 'put'])) {
            $page = $this->Pages->patchEntity($page, $this->request->getData());

            if ($this->Pages->save($page)) {
                $this->Flash->success(I18N_OPERATION_OK);

                return $this->redirect(['action' => 'index']);
            }

            $this->Flash->error(I18N_OPERATION_NOT_OK);
        }

        $this->set(compact('page'));
    }
550857
public function edit($id)
    {
        if (!$role = $this->roleRepositoryInterface->getById($id)) {
            Flash::error(trans('dashboard::dashboard.errors.role.found'));

            return redirect()->route('roles.index');
        }

        $permissions = $this->permissionRepositoryInterface->getAll();

        return $this->view('roles.edit')->with(['role' => $role, 'permissions' => $permissions]);
    }
165054
public function edit($id = null)
    {
        $album = $this->PhotosAlbums->get($id);

        if ($this->request->is(['patch', 'post', 'put'])) {
            $album = $this->PhotosAlbums->patchEntity($album, $this->request->getData());

            if ($this->PhotosAlbums->save($album)) {
                $this->Flash->success(I18N_OPERATION_OK);

                return $this->redirect(['action' => 'index']);
            }

            $this->Flash->error(I18N_OPERATION_NOT_OK);
        }

        $this->set(compact('album'));
    }
171245
public function editPage($page_id = null)
    {
        $this->setPage($page_id);
        $this->setTitleEditPage();
        $this->setBreadcrumbEditPage();

        $this->setData('page', $this->data_page);
        $this->setData('languages', $this->language->getList(array('enabled' => true)));

        $this->submitEditPage();
        $this->setDataImagesEditPage();
        $this->setDataCategoriesEditPage();
        $this->outputEditPage();
    }
646525
public function edit($id)
    {
        $record = $this->model->findOrFail($id);

        $this->viewData['record'] = $record;

        $this->viewData['formMethod'] = 'PUT';
        $this->viewData['formAction'] = 'user.update';

        return view($this->defaultFormView, $this->viewData);
    }
1332703
public function edit($id = null) {
        $this->loadModel('CmsContent');
        $cmsContent = $this->CmsContent->get($id, [
            'contain' => []
        ]);

        /**
         * 
         */
        if ($cmsContent->content_type != 'news') :
            $this->Flash->error('The cms content is not NEWS object');
            return $this->redirect(['action' => 'index']);
        endif;

        /**
         * 
         */
        if ($this->request->is(['patch', 'post', 'put'])) {

            /**
             * Before save the Content
             */
            $cmsContent->parent = 0;
            $cmsContent->name = parent::_permittedContentName($id, trim($this->request->data['name']));
            $cmsContent->content_title = $this->request->data['content_title'];
            $cmsContent->content_description = $this->request->data['content_description'];
            $cmsContent->content_excerpt = '';
            $cmsContent->content_deadline = $this->request->data['content_deadline'];
            $cmsContent->password = $this->request->data['content_password'];
            $cmsContent->content_status = $this->request->data['content_status'];
            $cmsContent->publish_start = $this->request->data['publish_start'];
            $cmsContent->publish_end = $this->request->data['publish_end'];
            $cmsContent->author = '';
            $cmsContent->modified = date('Y-m-d H:i:s');
            
            /**
             * Default button_publish_action
             */
            if (isset($this->request->data['button_publish_action']))
                $cmsContent->content_status = 'publish';


            if ($this->CmsContent->save($cmsContent)) {

                /**
                 * Save all related elements
                 */
                if (isset($this->request->data['related']['page']) && count($this->request->data['related']['page']))
                    parent::saveRelatedPage($id, $this->request->data['related']['page']);
                if (isset($this->request->data['related']['attached']) && count($this->request->data['related']['attached']))
                    parent::saveRelatedAttached($id, $this->request->data['related']['attached']);
                if (isset($this->request->data['related']['image']) && count($this->request->data['related']['image']))
                    parent::saveRelatedImage($id, $this->request->data['related']['image']);
                if (isset($this->request->data['related']['meta']) && count($this->request->data['related']['meta']))
                    parent::saveRelatedMeta($id, $this->request->data['related']['meta']);

                /**
                 * Delete related contents
                 */
                if (isset($this->request->data['delete_ck']['content_id']))
                    foreach ($this->request->data['delete_ck']['content_id'] as $key => $val) :
                        parent::deleteRelatedContent($key);
                    endforeach;

                /**
                 * Delete related meta
                 */
                if (isset($this->request->data['delete_ck']['meta_id']))
                    foreach ($this->request->data['delete_ck']['meta_id'] as $key => $val) :
                        parent::deleteRelatedMeta($key);
                    endforeach;

                /**
                 * Set FLASH and redirect
                 */
                $this->Flash->success('The cms content has been saved.');
                if (isset($this->request->data['button_save_action']))
                    return $this->redirect(['action' => 'edit', $id]);
                return $this->redirect(['action' => 'index']);
            } else {
                $this->Flash->error('The cms content could not be saved. Please, try again.');
            }
        }

        /**
         * Set parent_news_list
         */
        $cmsContent['parent_news_list'] = $this->_getParentNewsList($id);

        /**
         * Set content_status_list
         */
        $cmsContent['content_status_list'] = ['draft' => 'Draft', 'publish' => 'Publish'];

        /**
         * Set list of taxonomy
         */
        $where = ['taxonomy' => 'news'];
        $cmsContent['list_of_taxonomy'] = parent::getListOfTaxonomy($where);

        /**
         * Set list of taxonomy checked
         */
        $relationTable = TableRegistry::get('CmsTermRelation');
        $query = $relationTable->find()
                ->select(['cms_term_taxonomy_id'])
                ->where(['cms_content_id' => $id]);
        $cmsContent['list_of_taxonomy_checked'] = $query->all();

        /**
         * Set list of user
         */
        $cmsContent['list_of_user'] = parent::getListOfUser();

        /**
         * Set list of user checked
         */
        $cmsPermissionTable = TableRegistry::get('CmsPermission');
        $query = $cmsPermissionTable->find()
                ->select(['sys_user_id'])
                ->where(['cms_content_id' => $id]);
        $cmsContent['list_of_user_checked'] = $query->all();

        /**
         * Set list of role
         */
        $cmsContent['list_of_role'] = parent::getListOfRole();

        /**
         * Set list of role checked
         */
        $cmsPermissionTable = TableRegistry::get('CmsPermission');
        $query = $cmsPermissionTable->find()
                ->select(['sys_role_id'])
                ->where(['cms_content_id' => $id]);
        $cmsContent['list_of_role_checked'] = $query->all();

        /**
         * Create related array
         */
        $cmsContent['related'] = array();

        /**
         * Set related news
         */
        $where = ['parent' => $id, 'content_type' => 'news'];
        $cmsContent['related']['news'] = parent::getListOfContent($where);

        /**
         * Set related image
         */
        $where = ['parent' => $id, 'content_type' => 'image'];
        $cmsContent['related']['image'] = parent::getListOfContent($where);

        /**
         * Set related attached
         */
        $where = ['parent' => $id, 'content_type' => 'attached'];
        $cmsContent['related']['attached'] = parent::getListOfContent($where);

        /**
         * Set related meta
         */
        $where = ['cms_content_id' => $id];
        $cmsContent['related']['meta'] = parent::getListOfMeta($where);

        /**
         * 
         */
        $this->set('data', $cmsContent);
        $this->set('_serialize', ['data']);
    }
1067056
public function edit($id)
    {
      if ( \Auth::user()->roles[0]->can('menu-update' ) ) {
        $menu = $this->menus->findOrFail($id);
        $items = $this->menus->pluck('name', 'id')->toarray();
        $roles = Role::lists('name', 'id')->toarray();
        $selected = $menu->roles->pluck('id')->toarray();
        return view('admin.menus.edit', compact('menu', 'selected', 'roles', 'items'));
      }
      return \Redirect::route('admin.menus.index')->withErrors(trans('acl::dashboard.unauthorized_access'));

    }
383747
public function edit($page, $id)
    {
        $this->authorize('update', $eloquent = app('scaffold.model'));

        return view(app('scaffold.template')->edit('index'), [
            'item' => $eloquent,
        ]);
    }
783161
public function edit($id)
    {
        $record = $this->modelRepository->findOrFail($id);

        $fields = array_only(
            $this->modelInformation->form->fields,
            $this->getRelevantFormFieldKeys()
        );

        $this->checkListParents(false);

        $values = $this->getFormFieldValuesFromModel($record, array_keys($fields));
        $errors = $this->getNormalizedFormFieldErrors();

        $renderedFields = $this->renderedFormFieldStrategies($record, $fields, $values, $errors);

        return view($this->getEditView(), [
            'moduleKey'           => $this->moduleKey,
            'routePrefix'         => $this->routePrefix,
            'permissionPrefix'    => $this->permissionPrefix,
            'model'               => $this->modelInformation,
            'record'              => $record,
            'recordReference'     => $this->getReferenceRepository()->getReferenceForModel($record),
            'creating'            => false,
            'fields'              => $fields,
            'fieldStrategies'     => $renderedFields,
            'values'              => $values,
            'fieldErrors'         => $errors,
            'activeTab'           => $this->getActiveTab(),
            'errorsPerTab'        => $this->getErrorCountsPerTabPane(),
            'hasActiveListParent' => (bool) $this->listParentRelation,
            'topListParentOnly'   => $this->showsTopParentsOnly(),
            'listParents'         => $this->listParents,
        ]);
    }
305843
public function edit($id)
    {
        $role = $this->roles->findOrFail($id);
        return \View::make('admin.roles.edit', [
            'role'              =>  $role,
            'title'              => 'edit',
         ]);
    }
929467
public function edit($id)
    {
        $user = \App\User::findOrfail($id);
        $roles = Role::all()->pluck('name');
        $permissions = Permission::all()->pluck('name');
        $userRoles = $user->roles;
        $userPermissions = $user->permissions;

        return view('scaffold-interface.users.edit', compact('user', 'roles', 'permissions', 'userRoles', 'userPermissions'));
    }
932655
public function edit($id = null)
    {
        $cmsTerm = $this->CmsTerm->get($id, [
            'contain' => []
        ]);
        if ($this->request->is(['patch', 'post', 'put'])) {
            $cmsTerm = $this->CmsTerm->patchEntity($cmsTerm, $this->request->data);
            if ($this->CmsTerm->save($cmsTerm)) {
                $this->Flash->success('The cms term has been saved.');
                return $this->redirect(['action' => 'index']);
            } else {
                $this->Flash->error('The cms term could not be saved. Please, try again.');
            }
        }
        $this->set(compact('cmsTerm'));
        $this->set('_serialize', ['cmsTerm']);
    }
239736
public function edit($id = null)
    {
        /** @var User $user */
        $user = $this->Users->get($id);
        $groups = $this->Users->Groups->getTreeList();

        if ($this->request->is(['patch', 'post', 'put'])) {
            $user = $this->Users->patchEntity($user, $this->request->getData());
            if ($result = $this->Users->save($user)) {
                $this->Flash->success(__d('community', 'The user {0} has been saved.', sprintf(
                    '<strong>«%s»</strong>',
                    $result->get('login')
                )));
                return $this->App->redirect([
                    'apply' => ['action' => 'edit', $result->id]
                ]);
            } else {
                $this->Flash->error(__d('community', 'User could not be updated. Please, try again.'));
            }
        }

        $this
            ->set(compact('user', 'groups'))
            ->set('page_title', __d('community', 'Profiles: Edit user - {0}', $user->name));
    }
394854
public function edit($id)
    {
        $this->loadModel('User.Roles');
        $role = $this->Roles->get($id);

        if ($this->request->data()) {
            if (empty($this->request->data['regenerate_slug'])) {
                $this->Roles->behaviors()->Sluggable->config(['on' => 'create']);
            }

            $role = $this->Roles->patchEntity($role, $this->request->data(), ['fieldList' => 'name']);
            if ($this->Roles->save($role)) {
                $this->Flash->success(__d('user', 'Role successfully updated.'));
            } else {
                $this->Flash->danger(__d('user', 'Role could not be updated.'));
            }
        }

        $this->title(__d('user', 'Editing User Role'));
        $this->set(compact('role'));
        $this->Breadcrumb
            ->push('/admin/user/manage')
            ->push(__d('user', 'Roles'), ['plugin' => 'User', 'controller' => 'roles', 'action' => 'index'])
            ->push(__d('user', 'Edit role'), '');
    }
76914
public function edit($id = null)
    {
        $category = $this->PagesCategories->get($id);

        if ($this->request->is(['patch', 'post', 'put'])) {
            $category = $this->PagesCategories->patchEntity($category, $this->request->getData());

            if ($this->PagesCategories->save($category)) {
                $this->Flash->success(I18N_OPERATION_OK);

                return $this->redirect(['action' => 'index']);
            }

            $this->Flash->error(I18N_OPERATION_NOT_OK);
        }

        $this->set(compact('category'));
    }
393460
public function edit($id)
    {
        return Admin::content(function (Content $content) use ($id) {
            $content->header(trans('admin.administrator'));
            $content->description(trans('admin.edit'));
            $content->body($this->form()->edit($id));
        });
    }
999860
public function edit($id)
    {
        $notification = $this->service->find($id);
        return view('admin.notifications.edit')->with('notification', $notification);
    }