From 1000b4661f70f65986a1798805f232dc089ed041 Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Tue, 11 Nov 2014 11:51:18 +0100 Subject: [PATCH] AddToDashboard: Remove controller logic refs #4537 --- .../controllers/DashboardController.php | 24 +------------------ 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/application/controllers/DashboardController.php b/application/controllers/DashboardController.php index d357231ca..fb8da0f5a 100644 --- a/application/controllers/DashboardController.php +++ b/application/controllers/DashboardController.php @@ -80,30 +80,8 @@ class DashboardController extends ActionController 'url' => Url::fromRequest() ) )->activate('addurl'); - $form = new AddUrlForm(); - $request = $this->getRequest(); - if ($request->isPost()) { - if ($form->isValid($request->getPost()) && $form->isSubmitted()) { - $dashboard = $this->getDashboard(); - $dashboard->setComponentUrl( - $form->getValue('pane'), - $form->getValue('component'), - ltrim($form->getValue('url'), '/') - ); - - $configFile = Config::app('dashboard/dashboard')->getConfigFile(); - if ($this->writeConfiguration(new Config($dashboard->toArray()), $configFile)) { - $this->redirectNow(Url::fromPath('dashboard', array('pane' => $form->getValue('pane')))); - } else { - $this->render('showConfiguration'); - return; - } - } - } else { - $form->create()->setDefault('url', htmlspecialchars_decode($request->getParam('url', ''))); - } - + $form->handleRequest(); $this->view->form = $form; }