public function deleteTreshold($parameters = array())
 {
     $view = new ui($this);
     $flash = new popupController();
     $model = new directorywatchertresholdModel();
     $tresholds = $model->getfromId($parameters['id']);
     if (count($tresholds) == 1) {
         $treshold = $tresholds[0];
         if ($parameters['sure'] == 'sure') {
             try {
                 $model->deletebyId($treshold->getId());
             } catch (Exception $e) {
                 $flash->createflash(array('name' => 'err', 'type' => 'error', 'content' => 'Deze treshold werd niet goed verwijderd.'));
                 return false;
             }
             $flash->createflash(array('name' => 'success', 'type' => 'success', 'content' => 'De gegevens zijn goed verwijderd.'));
             $this->response->assign('gridextra_' . $parameters['-gridid-'], 'innerHTML', '');
             $grid = new mygrid($parameters['-gridid-']);
             $grid->registerAddrequest('directorywatcher', 'addTreshold', array('title' => 'Treshold toevoegen', 'currentid' => $parameters['currentid']));
             $grid->unregisterRequest('-edit-');
             $grid->unregisterRequest('-delete-');
             $testmodel = new dirstatusModel();
             $current = $testmodel->getfromId($parameters['currentid']);
             $current = $current[0];
             $parent = $current->getParent();
             $parenttresholds = array();
             if ($parent != '') {
                 $parentobj = $testmodel->getfromPath($parent);
                 $parentobj = $parentobj[0];
                 $parenttresholds = $model->getfromPath($parent);
                 while (count($parenttresholds) == 0 && $parent != '') {
                     $parent = $parentobj->getParent();
                     $parentobj = $testmodel->getfromPath($parent);
                     $parentobj = $parentobj[0];
                     $parenttresholds = $model->getfromPath($parent);
                 }
             }
             if (count($parenttresholds) == 0 && $parent == '') {
                 $parent = '_default_';
                 $parenttresholds = $model->getfromPath($parent);
             }
             $grid->setDefaultconditions(array('path' => array('mode' => '=', 'value' => $parent)));
             return true;
         } else {
             $view->assign('treshold', $treshold);
             return $view->fetch('directorywatcher_deletetreshold.tpl');
         }
     } else {
         $flash->createflash(array('name' => 'err', 'type' => 'warning', 'content' => 'Deze treshold werd niet gevonden.'));
         return false;
     }
 }