X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fcore%2Fmodules%2Fpath%2Fsrc%2FForm%2FEditForm.php;fp=web%2Fcore%2Fmodules%2Fpath%2Fsrc%2FForm%2FEditForm.php;h=7d4a3693022c8fbf1298e9fdfe845896fb2c6264;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/web/core/modules/path/src/Form/EditForm.php b/web/core/modules/path/src/Form/EditForm.php new file mode 100644 index 000000000..7d4a36930 --- /dev/null +++ b/web/core/modules/path/src/Form/EditForm.php @@ -0,0 +1,59 @@ +aliasStorage->load(['pid' => $pid]); + } + + /** + * {@inheritdoc} + */ + public function buildForm(array $form, FormStateInterface $form_state, $pid = NULL) { + $form = parent::buildForm($form, $form_state, $pid); + + $form['#title'] = $this->path['alias']; + $form['pid'] = [ + '#type' => 'hidden', + '#value' => $this->path['pid'], + ]; + + $url = new Url('path.delete', [ + 'pid' => $this->path['pid'], + ]); + + if ($this->getRequest()->query->has('destination')) { + $url->setOption('query', $this->getDestinationArray()); + } + + $form['actions']['delete'] = [ + '#type' => 'link', + '#title' => $this->t('Delete'), + '#url' => $url, + '#attributes' => [ + 'class' => ['button', 'button--danger'], + ], + ]; + + return $form; + } + +}