public function updateDashletAction()
 {
     $this->createTabs();
     $dashboard = $this->dashboard;
     $form = new DashletForm();
     $form->setDashboard($dashboard);
     $form->setSubmitLabel($this->translate('Update Dashlet'));
     if (!$this->_request->getParam('pane')) {
         throw new Zend_Controller_Action_Exception('Missing parameter "pane"', 400);
     }
     if (!$this->_request->getParam('dashlet')) {
         throw new Zend_Controller_Action_Exception('Missing parameter "dashlet"', 400);
     }
     $action = $this;
     $form->setOnSuccess(function (Form $form) use($dashboard, $action) {
         try {
             $pane = $dashboard->getPane($form->getValue('pane'));
         } catch (ProgrammingError $e) {
             $pane = new Dashboard\Pane($form->getValue('pane'));
             $pane->setUserWidget();
             $dashboard->addPane($pane);
         }
         try {
             $dashlet = $pane->getDashlet($form->getValue('dashlet'));
             $dashlet->setUrl($form->getValue('url'));
         } catch (ProgrammingError $e) {
             $dashlet = new Dashboard\Dashlet($form->getValue('dashlet'), $form->getValue('url'), $pane);
             $pane->addDashlet($dashlet);
         }
         $dashlet->setUserWidget();
         // Rename dashlet
         if ($form->getValue('org_dashlet') && $form->getValue('org_dashlet') !== $dashlet->getTitle()) {
             $pane->removeDashlet($form->getValue('org_dashlet'));
         }
         // Move
         if ($form->getValue('org_pane') && $form->getValue('org_pane') !== $pane->getTitle()) {
             $oldPane = $dashboard->getPane($form->getValue('org_pane'));
             $oldPane->removeDashlet($dashlet->getTitle());
         }
         $dashboardConfig = $dashboard->getConfig();
         try {
             $dashboardConfig->saveIni();
         } catch (Exception $e) {
             $action->view->error = $e;
             $action->view->config = $dashboardConfig;
             $action->render('error');
             return false;
         }
         Notification::success(t('Dashlet updated'));
         return true;
     });
     $form->setTitle($this->translate('Edit Dashlet'));
     $form->setRedirectUrl('dashboard/settings');
     $form->handleRequest();
     $pane = $dashboard->getPane($this->getParam('pane'));
     $dashlet = $pane->getDashlet($this->getParam('dashlet'));
     $form->load($dashlet);
     $this->view->form = $form;
 }