Edits the given menu by ID.

@param int $id Menu's ID
@return void
777782
public function edit($id)
    {
        $this->loadModel('Menu.Menus');
        $menu = $this->Menus->get($id);

        if ($this->request->data()) {
            $menu = $this->Menus->patchEntity($menu, $this->request->data(), [
                'fieldList' => [
                    'title',
                    'description',
                    'settings',
                ],
                'validate' => false
            ]);

            if ($this->Menus->save($menu, ['atomic' => true])) {
                $this->Flash->success(__d('menu', 'Menu has been saved!'));
                $this->redirect($this->referer());
            } else {
                $this->Flash->danger(__d('menu', 'Menu could not be saved, please check your information'));
            }
        }

        $this->title(__d('menu', 'Editing Menu'));
        $this->set('menu', $menu);
        $this->Breadcrumb
            ->push('/admin/menu/manage')
            ->push(__d('menu', 'Editing menu {0}', $menu->title), '#');
    }
62070
public function edit($id)
	{
		// SECURITY:
		// if edit_permission is false, abort
		if (isset($this->crud['edit_permission']) && !$this->crud['edit_permission']) {
			abort(403, 'Not allowed.');
		}

		// get the info for that entry
		$model = $this->crud['model'];
		$this->data['entry'] = $model::find($id);
		$this->data['entry']->addFakes($this->getFakeColumnsAsArray());

		if (isset($this->data['crud']['update_fields']))
		{
			$this->crud['fields'] = $this->data['crud']['update_fields'];
		}

		// prepare the fields you need to show and prepopulate the values
		$this->prepareFields($this->data['entry']);
		$this->data['crud'] = $this->crud;

		// load the view from /resources/views/vendor/dick/crud/ if it exists, otherwise load the one in the package
		return $this->firstViewThatExists('vendor.dick.crud.edit', 'crud::edit', $this->data);
	}
685369
public function edit($id)
    {
        $user = UserRepository::find($id);
        $this->checkUser($user);

        $groups = GroupRepository::index();

        return View::make('credentials::users.edit', compact('user', 'groups'));
    }
819246
protected function setIds($id)
    {
        if ($id) {
            $this->props = $this->mergeProps(array(
                $this->props,
                array(
                    'attribsContainer' => array(
                        'id' => $id.'_container',
                    ),
                    'attribs' => array(
                        'id' => $id,
                    ),
                    'attribsLabel' => array(
                        'for' => $id,
                    ),
                    'attribsHelpBlock' => array(
                        'id' => $id.'_help_block',
                    ),
                ),
            ));
        }
    }
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]);
    }
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);
    }
1178948
public function onEditDevice($id)
    {
        $this->onDevicesList();
        Breadcrumbs::register('device-edit', function($breadcrumbs) use($id) {
            $breadcrumbs->parent('devices-list');
            $breadcrumbs->push('Device edit #' . $id, handles('antares::logger/devices/' . $id . '/edit'));
        });
        view()->share('breadcrumbs', Breadcrumbs::render('device-edit'));
    }
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));
        });
    }
999361
public function delete($id)
    {
        $this->request->allowMethod('post');

        $menu = $this->Menus->get($id);
        if ($this->Menus->delete($menu)) {
            $this->Flash->success(__d('wasabi_core', 'The menu <strong>{0}</strong> has been deleted.', $menu->name));
        } else {
            $this->Flash->error($this->dbErrorMessage);
        }
        $this->redirect(['action' => 'index']);
        return;
    }
1056018
public function edit($id)
    {
        $user = $this->service->find($id);
        return view('admin.users.edit')->with('user', $user);
    }
645037
public function edit($id)
    {
        $admin = $this->adminRepository->find($id);

        if (is_null($admin)) {
            return Redirect::route('admin.admin.index');
        }

        $authorizes = $this->adminPermissionRepository->authorizes;

        return view('admin::admin.edit')
            ->with('admin', $admin)
            ->with('authorizes', $authorizes);
    }
1317075
public function active($id)
    {
        $menu = $this->getMenu($this->area());
        foreach ($menu as $key => $item) {
            if ($menu[$key]['id'] == $id) {
                $menu[$key]['active'] = true;
            }
        }
        $data = self::$data;
        $data[$this->area] = $menu;
        self::$data = $data;
    }
1242999
public function edit($id)
    {
        if (!$this->request->is(['get', 'put'])) {
            throw new MethodNotAllowedException();
        }

        /** @var Language $language */
        $language = $this->Languages->get($id);
        if ($this->request->is('put')) {
            $this->Languages->patchEntity($language, $this->request->data);
            if ($this->Languages->save($language)) {
                $this->Flash->success(__d('wasabi_core', 'The language <strong>{0}</strong> has been saved.', $language->name));
            } else {
                $this->Flash->error($this->dbErrorMessage);
            }
            $this->redirect(['action' => 'index']);
            return;
        }

        $this->set('language', $language);
        $this->render('add');
    }
822177
public function setNavigationID($id) {
        if(is_string($id) && !empty(trim($id))){
            $this->menuElements['ul_id'] = $id;
        }
        if((is_string($id) && empty(trim($id))) || $id === false){
            $this->menuElements['ul_id'] = '';
        }
        return $this;
    }
630472
public function renderAdd(int $id = null): void
	{
		$this['editForm']->setDefaults([
			'locale' => $this->localeService->defaultLocaleId,
			'parent' => $id
		]);
		$this->setView('edit');
		$this->template->viewLinks = false;
	}
943221
public function edit(string $id)
    {
        $savedWidgetData = [];
        $dashboard = $this->Dashboards->get($id, [
            'contain' => ['Widgets']
        ]);

        $dashboardWidgets = $dashboard->get('widgets');
        $dashboard->unsetProperty('widgets');

        /**
         * @var \Search\Model\Table\WidgetsTable $widgetsTable
         */
        $widgetsTable = TableRegistry::get('Search.Widgets');
        $widgets = $widgetsTable->getWidgets();

        $sequence = 0;

        foreach ($dashboardWidgets as $dw) {
            foreach ($widgets as $widget) {
                if ($dw->widget_id !== $widget['data']['id']) {
                    continue;
                }

                $widgetOptions = $widgetsTable->getWidgetOptions($dw, ['sequence' => $sequence]);

                $item = array_merge(
                    [
                        'id' => $widget['data']['id']
                    ],
                    [
                        'data' => $widget['data']
                    ],
                    $widgetOptions
                );
                unset($item['data']['content'], $item['data']['created'], $item['data']['modified']);
                if (!empty($item['data']['query'])) {
                    unset($item['data']['query']);
                }
                array_push($savedWidgetData, $item);

                $sequence++;
            }
        }

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

            $dashboard->unsetProperty('widgets');

            $dashboard = $this->Dashboards->patchEntity($dashboard, [
                'name' => $data['name'],
                'role_id' => $data['role_id']
            ]);

            if ($this->Dashboards->save($dashboard)) {
                $this->Flash->success((string)__('The dashboard has been saved.'));
                /** @var \Search\Model\Table\WidgetsTable */
                $widgetTable = TableRegistry::get('Search.Widgets');
                $widgetTable->trashAll([
                    'dashboard_id' => $dashboard->id
                ]);

                $data['widgets'] = !empty($data['options']) ? json_decode($data['options'], true) : [];
                if (!empty($data['widgets'])) {
                    $widgetsTable->saveDashboardWidgets($id, $data['widgets']);
                }

                return $this->redirect(['action' => 'view', $id]);
            } else {
                $this->Flash->error((string)__('The dashboard could not be saved. Please, try again.'));
            }
        }

        $roles = $this->Dashboards->Roles->find('list', ['limit' => 200]);

        $this->set(compact('dashboard', 'roles', 'widgets', 'savedWidgetData'));
        $this->set('columns', Configure::readOrFail('Search.dashboard.columns'));
        $this->set('_serialize', ['dashboard']);
    }
690821
public function edit($id)
    {
        $role = $this->service->find($id);
        return view('admin.roles.edit')->with('role', $role);
    }