From 0865ed266d742c711ecf1629b6080773d589e031 Mon Sep 17 00:00:00 2001 From: Anh Nhan Nguyen Date: Thu, 7 Mar 2013 08:20:13 -0800 Subject: [PATCH] Simplified Phriction Move form Summary: Refs T2686 - only dialog remains, no wrangling between ajax / non-ajax Test Plan: verified everything still works Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T2686 Differential Revision: https://secure.phabricator.com/D5274 --- .../controller/PhrictionMoveController.php | 58 +++++-------------- 1 file changed, 13 insertions(+), 45 deletions(-) diff --git a/src/applications/phriction/controller/PhrictionMoveController.php b/src/applications/phriction/controller/PhrictionMoveController.php index fb8019adb3..abc90a275b 100644 --- a/src/applications/phriction/controller/PhrictionMoveController.php +++ b/src/applications/phriction/controller/PhrictionMoveController.php @@ -122,21 +122,12 @@ final class PhrictionMoveController $descr_caption = $is_serious ? pht('A reason for the move.') : pht('You better give a good reason for this.'); - if ($request->isAjax()) { - $form = new AphrontFormLayoutView(); - } else { - $form = new AphrontFormView(); - $form->setAction($submit_uri) - // Append title so the user can verify that he's touching - // the right document - ->appendChild( - id(new AphrontFormStaticControl()) - ->setLabel(pht('Title')) - ->setValue($content->getTitle())); - } - - $form + $form = id(new AphrontFormLayoutView()) ->setUser($user) + ->appendChild( + id(new AphrontFormStaticControl()) + ->setLabel(pht('Title')) + ->setValue($content->getTitle())) ->appendChild( id(new AphrontFormTextControl()) ->setLabel(pht('New URI')) @@ -152,37 +143,14 @@ final class PhrictionMoveController ->setName('description') ->setCaption($descr_caption)); - if ($request->isAjax()) { - $dialog = new AphrontDialogView(); - $dialog->setUser($user); - $dialog->setTitle(pht('Move Document')); - $dialog->appendChild($form); - $dialog->setSubmitURI($submit_uri); - $dialog->addSubmitButton(pht('Move Document')); - $dialog->addCancelButton($cancel_uri); + $dialog = id(new AphrontDialogView()) + ->setUser($user) + ->setTitle(pht('Move Document')) + ->appendChild($form) + ->setSubmitURI($submit_uri) + ->addSubmitButton(pht('Move Document')) + ->addCancelButton($cancel_uri); - return id(new AphrontDialogResponse())->setDialog($dialog); - } else { - $form->appendChild( - id(new AphrontFormSubmitControl()) - ->addCancelButton($cancel_uri) - ->setValue(pht('Move Document')) - ->setDisabled($e_block)); - - $panel = id(new AphrontPanelView()) - ->setNoBackground() - ->setHeader(pht('Move Phriction Document')) - ->appendChild($form); - - return $this->buildApplicationPage( - array( - $error_view, - $panel, - ), - array( - 'title' => pht('Move Document'), - 'device' => true, - )); - } + return id(new AphrontDialogResponse())->setDialog($dialog); } }