Beispiel #1
0
 public function getarticles()
 {
     $result = array();
     $articlemodel = new myarticleModel();
     $articles = $articlemodel->get();
     foreach ($articles as $article) {
         $result[$article->getId()] = $article->getAlias();
     }
     return $result;
 }
 public function deleteSection($parameters = array())
 {
     $view = new ui($this);
     if ($parameters['sure'] != 'sure') {
         $model = new myarticlesectionModel();
         $section = $model->getfromId($parameters['id']);
         if (count($section) == 1) {
             $section = $section[0];
             $view->assign('section', $section);
             $articlemodel = new myarticleModel();
             $linked = '';
             if (count($section->getArticleid()) > 0) {
                 $cond = array('id' => array('mode' => 'IN', 'value' => $section->getArticleid()));
                 $linked = $articlemodel->get($cond);
             }
             $view->assign('linked', $linked);
             return $view->fetch('myarticle_deletesection.tpl');
         }
     } else {
         $model = new myarticlesectionModel();
         try {
             $model->delete(array('id' => array('mode' => '=', 'value' => $parameters['id'])));
         } catch (Exception $e) {
             $flash = new popupController();
             $flash->createflash(array('name' => 'erroredit', 'type' => 'error', 'content' => 'De gegevens werden niet aangepast! Raadpleeg de informaticadienst.'));
             return false;
         }
         $flash = new popupController();
         $flash->createflash(array('name' => 'flash_del_' . $parameters['-gridid-'], 'type' => 'success', 'content' => 'De gegevens zijn goed verwijderd.'));
         return true;
     }
 }