Show the form for editing the specified news.

@param News $news
@return Response
343000
public function edit(News $news)
    {
        $categories = NewsCategory::getAllList();

        return $this->view('titan::news_events.create_edit', compact('categories'))->with('item', $news);
    }
298480
public function update(NewsRequest $request, News $news)
    {
        try {
            $attributes = $request->all();

            $news->update($attributes);
            return $this->response->message(trans('messages.success.updated', ['Module' => trans('news::news.name')]))
                ->code(204)
                ->status('success')
                ->url(guard_url('news/news/' . $news->getRouteKey()))
                ->redirect();
        } catch (Exception $e) {
            return $this->response->message($e->getMessage())
                ->code(400)
                ->status('error')
                ->url(guard_url('news/news/' . $news->getRouteKey()))
                ->redirect();
        }

    }
111394
public function editAction()
    {
        $id = $this->params()->fromRoute('id');
        if (! is_numeric($id)) {
            $this->flashMessenger()->addMessage(
                $this->scTranslate('The article identifier was not specified.')
            );
            return $this->redirect()
                ->toRoute('sc-admin/content-manager')
                ->setStatusCode(303);
        }

        try {
            $article = $this->getArticleService()->getArticle($id);
        } catch (RuntimeException $e) {
            $this->flashMessenger()->addMessage($e->getMessage());
            return $this->redirect()
                ->toRoute('sc-admin/content-manager')
                ->setStatusCode(303);
        }

        $form = $this->getArticleForm();
        $form->setAttribute(
            'action',
            $this->url()->fromRoute('sc-admin/article/edit', ['id' => $id])
        );
        $form->bind($article);
        if ($this->getRequest()->isPost()) {
            $form->setData($this->getRequest()->getPost());
            if ($form->isValid()) {
                $this->getArticleService()->saveContent($form->getData());
            }
        }

        return new ViewModel([
            'content' => $article,
            'form' => $form,
        ]);
    }
1023576
public function edit($id)
    {
        $change = Change::findOrFail($id);
        $admin = $change->admin;
        return Response::json([
            'action' => __("decoy::changes.actions.$change->action"),
            'title' => $change->title,
            'admin' => $admin ? $admin->getAdminTitleHtmlAttribute() : 'someone',
            'admin_edit' => $admin ? $admin->getAdminEditAttribute() : null,
            'date' => $change->getHumanDateAttribute(),
            'attributes' => $change->attributesForModal(),
        ]);
    }
1214466
public function edit(View $view)
    {
        $handler = $this->get('metadata')->get('handler');
        if (class_exists($handler)) {
            $handler = new $handler();

            return $handler->edit($this, $view);
        }

        return '';
    }
426689
public function getEditNewsAction(ServerRequestInterface $request, Tree $tree): ResponseInterface
    {
        if (!Auth::isManager($tree)) {
            throw new AccessDeniedHttpException();
        }

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

        if ($news_id > 0) {
            $row = DB::table('news')
                ->where('news_id', '=', $news_id)
                ->where('gedcom_id', '=', $tree->id())
                ->first();
        } else {
            $row = (object) [
                'body'    => '',
                'subject' => '',
            ];
        }

        $title = I18N::translate('Add/edit a journal/news entry');

        return $this->viewResponse('modules/gedcom_news/edit', [
            'body'    => $row->body,
            'news_id' => $news_id,
            'subject' => $row->subject,
            'title'   => $title,
        ]);
    }
1097513
public function sendNews(){
        $news   = func_get_args();
        $openid = array_shift($news);
        return $this->messageCustomSend($openid, $news, self::MSG_TYPE_NEWS);
    }
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));
        });
    }
892225
public function create()
    {
        set_meta('title', 'Write a Page');

        $content = Content::newPageInstance();
        $content->setAttribute('format', $this->editorFormat);

        $this->authorize('create', $content);

        return view('orchestra/story::admin.editor', [
            'content' => $content,
            'url'     => handles('orchestra::storycms/pages'),
            'method'  => 'POST',
        ]);
    }
41015
public function createForm(bool $edit = false)
    {
        $this->prefix = '';

        $form = [
            'storageURL' => route('admin.api.galleries'),
            'buttons'    => [
                [
                    "class" => "col-centered",
                    "label" => trans('HCTranslations::core.buttons.submit'),
                    "type"  => "submit",
                ],
            ],
            'structure'  => $this->getNewStructure(),
        ];

        if ($this->multiLanguage)
            $form['availableLanguages'] = getHCContentLanguages();

        if (!$edit)
            return $form;

        //Make changes to edit form if needed
        $form['structure'] = array_merge($form['structure'], $this->getEditStructure(true));

        return $form;
    }
395662
public function edit(Request $request)
    {
        $post = $this->api('post.fetch', $request->route('post'))->get();

        event(new UserEditingPost($post));

        if ($post->trashed()) {
            return abort(404);
        }

        $this->authorize('edit', $post);

        $thread = $post->thread;
        $category = $post->thread->category;

        return view('forum::post.edit', compact('category', 'thread', 'post'));
    }
953177
public function getEditJournalAction(ServerRequestInterface $request): ResponseInterface
    {
        if (!Auth::check()) {
            throw new AccessDeniedHttpException();
        }

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

        if ($news_id > 0) {
            $row = DB::table('news')
                ->where('news_id', '=', $news_id)
                ->where('user_id', '=', Auth::id())
                ->first();
        } else {
            $row = (object) [
                'body'    => '',
                'subject' => '',
            ];
        }

        $title = I18N::translate('Add/edit a journal/news entry');

        return $this->viewResponse('modules/user_blog/edit', [
            'body'    => $row->body,
            'news_id' => $news_id,
            'subject' => $row->subject,
            'title'   => $title,
        ]);
    }
1244887
public function news($newsData=array())
	{

		$count = count($newsData);

		$msg = array(
			'ToUserName' => $this->getRevFrom(),
			'FromUserName'=>$this->getRevTo(),
			'MsgType'=>self::MSGTYPE_NEWS,
			'CreateTime'=>time(),
			'ArticleCount'=>$count,
			'Articles'=>$newsData,

		);
		$this->Message($msg);
		return $this;
	}
1044623
public function destroy(News $news, Request $request)
    {
        $this->deleteEntry($news, $request);

        return redirect_to_resource();
    }
971262
public function edit($content)
    {
        $dotName = str_replace(['[', ']'], ['.', ''], $this->_getInputHTMLKey());
        $submittedData = Request::input($dotName);
        return CmsBlockInput::make($this->_block->type, $this->_editViewData + [
                'label' => $this->_block->label,
                'name' => $this->_getInputHTMLKey(),
                'content' => $content,
                'submitted_data' => $submittedData ? $this->_defaultData($submittedData) : null,
                'note' => $this->_block->note,
                '_block' => $this->_block,
                '_blockType' => $this
            ]);
    }
680427
public function createForm(bool $edit = false)
    {
        $form = [
            'storageURL' => route('admin.api.pages'),
            'buttons'    => [
                [
                    "class" => "col-centered",
                    "label" => trans('HCTranslations::core.buttons.submit'),
                    "type"  => "submit",
                ],
            ],
            'structure'  => [
                [
                    "type"            => "radioList",
                    "fieldID"         => "type",
                    "tabID"           => trans("Page"),
                    "label"           => trans("HCPages::pages.type"),
                    "required"        => 1,
                    "requiredVisible" => 1,
                    "options"         => HCPages::getTableEnumList('type', 'label'),
                ],
                [
                    "type"            => "resource",
                    "fieldID"         => "cover_photo_id",
                    "tabID"           => trans("Page"),
                    "uploadURL"       => route("admin.api.resources"),
                    "viewURL"         => route("resource.get", ['/']),
                    "label"           => trans("HCPages::pages.cover_photo_id"),
                    "fileCount"       => 1,
                ], [
                    "type"            => "dropDownList",
                    "fieldID"         => "categories",
                    "tabID"           => trans ("Page"),
                    "label"           => trans ("HCPages::pages.categories"),
                    "options"         => HCPagesCategories::with ('translations')->get (),
                    "search"          => [
                        "showNodes" => ['translations.{lang}.title'],
                        "minimumSelectionLength" => 1,
                    ]
                ], [
                    "type"            => "dateTimePicker",
                    "properties"      => [
                        "format" => "YYYY-MM-DD HH:mm:ss",
                    ],
                    "fieldID"         => "publish_at",
                    "tabID"           => trans("Page"),
                    "label"           => trans("HCPages::pages.publish_at"),
                ], [
                    "type"            => "resource",
                    "fieldID"         => "translations.cover_photo_id",
                    "tabID"           => trans("HCTranslations::core.translations"),
                    "uploadURL"       => route("admin.api.resources"),
                    "viewURL"         => route("resource.get", ['/']),
                    "label"           => trans("HCPages::pages.cover_photo_id"),
                    "fileCount"       => 1,
                    "multiLanguage"   => 1,
                ], [
                    "type"            => "singleLine",
                    "fieldID"         => "translations.title",
                    "tabID"           => trans("HCTranslations::core.translations"),
                    "label"           => trans("HCPages::pages.title"),
                    "required"        => 1,
                    "requiredVisible" => 1,
                    "multiLanguage"   => 1,
                ], [
                    "type"            => "singleLine",
                    "fieldID"         => "translations.summary",
                    "tabID"           => trans("HCTranslations::core.translations"),
                    "label"           => trans("HCPages::pages.summary"),
                    "multiLanguage"   => 1,
                ], [
                    "type"            => "richTextArea",
                    "fieldID"         => "translations.content",
                    "tabID"           => trans("HCTranslations::core.translations"),
                    "label"           => trans("HCPages::pages.content"),
                    "multiLanguage"   => 1,
                ],
            ],
        ];

        formManagerSeo($form, $this->multiLanguage);

        /*$form['structure'][] = [
            "type"            => "dropDownList",
            "fieldID"         => "userGroups",
            "tabID"           => trans("HCTranslations::core.ownership"),
            "label"           => trans ("HCTranslations::core.groups"),
            "options"         => HCGroups::get(),
            "search"          => [
                "showNodes" => ['label']
            ]
        ];

        $form['structure'][] = [
            "type"            => "dropDownList",
            "fieldID"         => "users",
            "tabID"           => trans("HCTranslations::core.ownership"),
            "label"           => trans ("HCTranslations::core.users"),
            "options"         => HCUsers::get(),
            "search"          => [
                "showNodes" => ['email'],
                "tabs"      => true
            ]
        ];*/

        if ($this->multiLanguage)
            $form['availableLanguages'] = getHCContentLanguages();

        if (!$edit)
            return $form;

        //Make changes to edit form if needed

        $form['structure'][] = [
            "type"          => "singleLine",
            "fieldID"       => "translations.slug",
            "tabID"         => trans("HCTranslations::core.translations"),
            "label"         => trans("HCPages::pages.slug"),
            "readonly"      => 1,
            "multiLanguage" => 1,
        ];

        return $form;
    }
114368
public function getEditForm($id = null, $fields = null)
    {
        $form = parent::getEditForm($id, $fields);
        $siteConfig = SiteConfig::current_site_config();
        /**
         * SortOrder is ignored unless sortable is enabled.
         */
        if ($this->modelClass === "Tag" && $siteConfig->AllowTags) {
            $form->Fields()
                ->fieldByName('Tag')
                ->getConfig()
                ->addComponent(
                    new GridFieldOrderableRows(
                        'SortOrder'
                    )
                );
        }
        if ($this->modelClass === "News" && !$siteConfig->AllowExport) {
            $form->Fields()
                ->fieldByName("News")
                ->getConfig()
                ->removeComponentsByType('GridFieldExportButton')
                ->addComponent(
                    new GridfieldNewsPublishAction()
                );
        }

        return $form;
    }