AddToDashboard: Remove controller logic

refs #4537
This commit is contained in:
Marius Hein 2014-11-11 11:51:18 +01:00
parent 5f8fcf4005
commit 1000b4661f
1 changed files with 1 additions and 23 deletions

View File

@ -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;
}