Example #1
0
 public function deleteAction()
 {
     $this->view->title = "Suppression d'une categorie";
     if ($this->view->aclIsAllowed($this->_moduleTitle, 'manage', true)) {
         // Get the e id
         $id = (int) $this->_getParam($this->_paramId);
         // generate the form
         $returnUrl = $this->_moduleTitle . "/" . $this->_name . "/" . $this->_defaultAction . "/";
         $this->view->assign('return', $this->view->baseUrl() . "/" . $returnUrl);
         $oData = new BannerFeaturedObject();
         $select = $oData->getAll(null, false, $id);
         $data = $this->_db->fetchRow($select);
         $this->view->data = $data;
         if ($this->_request->isPost()) {
             $del = $this->_request->getPost('delete');
             if ($del && $id > 0) {
                 // get all';
                 $oData->delete($id);
                 Cible_FunctionsGeneral::delFolder($this->_imagesFolder . $id);
                 $oImgFeat = new BannerFeaturedImageObject();
                 $oImgFeat->delAssociatedImg($id);
             }
             $this->_redirect($returnUrl);
         }
     }
 }