function deleteMenuAction() { $this->view->assign('isXmlHttpRequest', $this->_isXmlHttpRequest); $this->view->assign('success', false); $_itemId = (int) $this->_request->getParam('itemID'); $_menuId = (int) $this->_request->getParam('menuID'); $this->disableView(); if ($this->_request->isPost()) { $delete = isset($_POST['delete']); if ($delete) { $menuObject = new MenuObject($_menuId); $menuObject->deleteItem($_itemId); $dir = $this->_imgMenuFolder . $_itemId; Cible_FunctionsGeneral::delFolder($dir); } } }
public function deleteAction() { // variables $pageID = (int) $this->_getParam('pageID'); $blockID = (int) $this->_getParam('blockID'); $eventID = (int) $this->_getParam('eventID'); $this->view->return = $this->view->baseUrl() . "/events/index/list/blockID/{$blockID}/pageID/{$pageID}"; $eventsObject = new EventsObject(); if (Cible_ACL::hasAccess($pageID)) { if ($this->_request->isPost()) { $del = $this->_request->getPost('delete'); if ($del && $eventID > 0) { $eventsObject->delete($eventID); $indexData['moduleID'] = $this->_moduleID; $indexData['contentID'] = $eventID; $indexData['languageID'] = Zend_Registry::get("currentEditLanguage"); $indexData['action'] = 'delete'; Cible_FunctionsIndexation::indexation($indexData); Cible_FunctionsGeneral::delFolder("../../{$this->_config->document_root}/data/images/event/" . $eventID); } if (!empty($pageID)) { $this->_redirect("/events/index/list/blockID/{$blockID}/pageID/{$pageID}"); } else { $this->_redirect("/events/index/list-all/"); } } else { if ($eventID > 0) { // get event details $this->view->event = $eventsObject->populate($eventID, Zend_Registry::get('currentEditLanguage')); } } } }
public static function delFolder($dir) { $files = glob($dir . '*', GLOB_MARK); foreach ($files as $file) { if (substr($file, -1) == '/') { Cible_FunctionsGeneral::delFolder($file); } else { if (file_exists($file)) { unlink($file); } } //echo("deleteFile : " . $file . "<br/>"); } if (file_exists($dir)) { echo $dir; rmdir($dir); } //echo("deleteDir : " . $dir . "<br/>"); }
public function deleteAction() { // web page title $this->view->title = "Suppression d'une galerie"; //if ($this->view->aclIsAllowed('gallery','manage',true)){ // variables $this->view->assign('isXmlHttpRequest', $this->_isXmlHttpRequest); $this->view->assign('success', false); $pageID = (int) $this->_getParam('pageID'); $blockID = (int) $this->_getParam('blockID'); $galleryID = (int) $this->_getParam('galleryID'); if ($blockID != '') { $return = "/gallery/index/list/blockID/{$blockID}/pageID/{$pageID}"; } elseif ($this->_categoryID) { $return = "/gallery/index/list/catID/{$this->_categoryID}"; } else { $return = "/gallery/index/list/"; } $this->view->return = $this->view->baseUrl() . $return; $galleryObject = new GalleryObject(); $galleryDataIndex = $galleryObject->populate($galleryID, $this->_defaultEditLanguage); if (!$galleryDataIndex) { if ($this->_request->isPost()) { $this->view->assign('success', true); } $this->view->assign('deleted', true); $this->view->assign('galleryID', $galleryID); } else { $this->view->assign('deleted', false); $this->view->gallery = $galleryDataIndex; if ($this->_request->isPost()) { $formData = $this->_request->getPost(); if ($galleryDataIndex) { $gallerySelect = new GalleriesIndex(); $select = $gallerySelect->select()->where('GI_GalleryID = ?', $galleryID); $galleryData = $gallerySelect->fetchAll($select); foreach ($galleryData as $gallery) { $indexData['moduleID'] = $this->_moduleID; $indexData['contentID'] = $galleryID; $indexData['languageID'] = $gallery['GI_LanguageID']; $indexData['action'] = 'delete'; Cible_FunctionsIndexation::indexation($indexData); $imageSelect = new GalleriesImages(); $select = $imageSelect->select()->setIntegrityCheck(false)->from('Galleries_Images')->where('GI_GalleryID = ?', $galleryID)->join('ImagesIndex', 'II_ImageID = GI_ImageID')->where('II_LanguageID = ?', $gallery['GI_LanguageID']); $imageData = $imageSelect->fetchAll($select)->toArray(); $cpt = count($imageData); for ($i = 0; $i < $cpt; $i++) { $indexData['moduleID'] = $this->_moduleID; $indexData['contentID'] = $imageData[$i]['II_ImageID']; $indexData['languageID'] = $imageData[$i]['II_LanguageID']; $indexData['action'] = 'delete'; Cible_FunctionsIndexation::indexation($indexData); } } //delete all images associated with the gallery $galleryImagesSelect = new GalleriesImages(); $select = $galleryImagesSelect->select()->where('GI_GalleryID = ?', $galleryID); $galleryImagesData = $galleryImagesSelect->fetchAll($select); foreach ($galleryImagesData as $galleryImages) { $imageDelete = new Images(); $where = "I_ID = " . $galleryImages['GI_ImageID']; $imageDelete->delete($where); $imageIndexDelete = new ImagesIndex(); $where = "II_ImageID = " . $galleryImages['GI_ImageID']; $imageIndexDelete->delete($where); } $galleryImagesDelete = new GalleriesImages(); $where = "GI_GalleryID = " . $galleryID; $galleryImagesDelete->delete($where); $galleryObject->delete($galleryID); /* //delete the gallery $galleryDelete = new Galleries(); $where = 'G_ID = ' . $galleryID; $galleryDelete->delete($where); $galleryIndexDelete = new GalleriesIndex(); $where = 'GI_GalleryID = ' . $galleryID; $galleryIndexDelete->delete($where); */ //delete the gallery folder Cible_FunctionsGeneral::delFolder("../../{$this->_config->document_root}/data/images/gallery/" . $galleryID); if (!$this->_isXmlHttpRequest) { if ($blockID != '') { $this->_redirect("/gallery/index/list/blockID/{$blockID}/pageID/{$pageID}"); } elseif ($this->_categoryID) { $this->_redirect("/gallery/index/list/catID/{$this->_categoryID}"); } else { $this->_redirect("/gallery/index/list/"); } } else { $buttonAction = $formData['buttonAction']; $this->view->assign('success', true); $this->view->assign('buttonAction', $buttonAction); $this->view->assign('galleryID', $galleryID); $this->view->assign('deleted', true); } } } } //} }
/** * Delete action for the current object. * * @access public * * @return void */ public function deleteAction() { // variables $page = (int) $this->_getParam('page'); $blockId = (int) $this->_getParam('blockID'); $id = (int) $this->_getParam($this->_ID); $this->view->return = $this->view->baseUrl() . "/" . $this->_moduleTitle . "/" . $this->_name . "/" . $this->_currentAction . "/" . "page/" . $page; $this->view->action = $this->_currentAction; $returnAction = $this->_getParam('return'); if ($returnAction) { $returnUrl = $this->_moduleTitle . "/index/" . $returnAction; } else { $returnUrl = $this->_moduleTitle . "/" . $this->_name . "/" . $this->_currentAction . "/" . "page/" . $page; } $oDataName = $this->_objectList[$this->_currentAction]; $oData = new $oDataName(); if (Cible_ACL::hasAccess($page)) { if ($this->_request->isPost()) { $del = $this->_request->getPost('delete'); if ($del && $id > 0) { $oData->delete($id); Cible_FunctionsGeneral::delFolder($this->_imageFolder . $id); // update the page associate to this group of banner image $db = $this->_db; $db->update('Pages', array('P_BannerGroupID' => ''), 'P_BannerGroupID = ' . $id); if (class_exists('Catalog_CategoriesData')) { $db->update('Catalog_CategoriesData', array('C_BannerGroupID' => ''), 'C_BannerGroupID = ' . $id); } if (class_exists('Catalog_SousCategoriesData')) { $db->update('Catalog_SousCategoriesData', array('SC_BannerGroupID' => ''), 'SC_BannerGroupID = ' . $id); } } $this->_redirect($returnUrl); } elseif ($id > 0) { // get date details $this->view->data = $oData->populate($id, $this->getCurrentEditLanguage()); } } }
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); } } }
function deleteAction() { $this->view->title = "'Suppression d'un article à une parution"; $this->view->assign('isXmlHttpRequest', $this->_isXmlHttpRequest); $this->view->assign('success', false); if ($this->view->aclIsAllowed('newsletter', 'manage', true)) { // variables $articleID = $this->_getParam('articleID'); $newsletterID = $this->_getParam('newsletterID'); $return = "/newsletter/index/edit/newsletterID/{$newsletterID}"; $this->view->return = $this->view->baseUrl() . $return; $newsletterArticleSelect = new NewsletterArticles(); $select = $newsletterArticleSelect->select(); $select->where('NA_ID = ?', $articleID); $newsletterArticleData = $newsletterArticleSelect->fetchRow($select); if (!$newsletterArticleData) { if ($this->_request->isPost()) { $this->view->assign('success', true); } $this->view->assign('deleted', true); $this->view->assign('articleID', $articleID); } else { $this->view->assign('deleted', false); $this->view->newsletterArticle = $newsletterArticleData->toArray(); if ($this->_request->isPost()) { $del = $this->_request->getPost('delete'); if ($del && $newsletterArticleData) { // delete index // check if release is online $releaseSelect = new NewsletterReleases(); $select = $releaseSelect->select()->where('NR_ID = ?', $newsletterArticleData['NA_ReleaseID']); $releaseData = $releaseSelect->fetchRow($select); $indexData['moduleID'] = 8; $indexData['contentID'] = $newsletterArticleData['NA_ID']; $indexData['languageID'] = $releaseData['NR_LanguageID']; $indexData['action'] = 'delete'; Cible_FunctionsIndexation::indexation($indexData); Cible_FunctionsGeneral::delFolder("../../{$this->_config->document_root}/data/images/newsletter/{$newsletterID}/{$articleID}"); // update position for all article higher $newsletterArticlePosition = new NewsletterArticles(); $where = 'NA_PositionID > ' . $newsletterArticleData['NA_PositionID']; $where .= ' AND NA_ReleaseID = ' . $newsletterArticleData['NA_ReleaseID']; $where .= ' AND NA_ZoneID = ' . $newsletterArticleData['NA_ZoneID']; $newsletterArticlePosition->update(array('NA_PositionID' => new Zend_Db_Expr('NA_PositionID - 1 ')), $where); $newsletterArticleData->delete(); if (!$this->_isXmlHttpRequest) { $this->_redirect($return); } else { $this->view->assign('success', true); $this->view->assign('articleID', $articleID); } } else { $this->_redirect($return); } } } } }
public function deleteAction() { // web page title $this->view->title = "Suppression d'une parution"; if ($this->view->aclIsAllowed('newsletter', 'manage', true)) { // variables $pageID = (int) $this->_getParam('pageID'); $blockID = (int) $this->_getParam('blockID'); $newsletterID = (int) $this->_getParam('newsletterID'); // generate the form if (empty($pageID) && empty($blockID)) { $returnUrl = "/newsletter/index/list-all/"; } else { $returnUrl = "/newsletter/index/list/blockID/{$blockID}/pageID/{$pageID}"; } $this->view->assign('return', "{$this->view->baseUrl()}{$returnUrl}"); $newsletterSelect = new NewsletterReleases(); $select = $newsletterSelect->select(); $select->where('NR_ID = ?', $newsletterID); $newsletterData = $newsletterSelect->fetchRow($select); $this->view->newsletter = $newsletterData->toArray(); if ($this->_request->isPost()) { $del = $this->_request->getPost('delete'); if ($del && $newsletterData) { // get all article in the release $articlesSelect = new NewsletterArticles(); $select = $articlesSelect->select()->where('NA_ReleaseID = ?', $newsletterID); $articlesData = $articlesSelect->fetchAll($select); $indexData['pageID'] = $pageID; $indexData['moduleID'] = 8; $indexData['languageID'] = $newsletterData['NR_LanguageID']; $indexData['action'] = 'delete'; foreach ($articlesData as $article) { $indexData['contentID'] = $article['NA_ID']; Cible_FunctionsIndexation::indexation($indexData); } $newsletterData->delete(); $newsletterArticleDelete = new NewsletterArticles(); $where = "NA_ReleaseID = " . $newsletterID; $newsletterArticleDelete->delete($where); Cible_FunctionsGeneral::delFolder("../../{$this->_config->document_root}/data/images/newsletter/{$newsletterID}"); } $this->_redirect($returnUrl); } } }
function deleteAction() { $this->view->title = "Suppression d'une image"; //if ($this->view->aclIsAllowed('gallery','manage',true)){ $this->view->assign('isXmlHttpRequest', $this->_isXmlHttpRequest); $this->view->assign('success', false); $pageID = (int) $this->_getParam('pageID'); $blockID = (int) $this->_getParam('blockID'); $galleryID = (int) $this->_getParam('galleryID'); $imageID = (int) $this->_getParam('imageID'); $imageIndexSelect = new ImagesIndex(); $select = $imageIndexSelect->select()->where('II_ImageID = ?', $imageID); $imageIndexData = $imageIndexSelect->fetchRow($select); if (!$imageIndexData) { if ($this->_request->isPost()) { $this->view->assign('success', true); } $this->view->assign('deleted', true); $this->view->assign('imageID', $imageID); } else { $imageObject = new ImageObject(); $imageIndexData = $imageObject->populate($imageID, Zend_Registry::get("languageID")); //$imageIndexData = $imageObject->populate($imageID,$this->_defaultEditLanguage); $this->view->assign('deleted', false); $return = "/gallery/index/list/blockID/{$blockID}/pageID/{$pageID}"; $this->view->return = $this->view->baseUrl() . $return; $this->view->image = $imageIndexData; if ($this->_request->isPost()) { //$del = $this->_request->getPost('delete'); //if ($del && $imageIndexData) { if ($imageIndexData) { $imageSelect = new ImagesIndex(); $select = $imageSelect->select()->where('II_ImageID = ?', $imageID); $imageData = $imageSelect->fetchAll($select)->toArray(); $cpt = count($imageData); for ($i = 0; $i < $cpt; $i++) { $indexData['moduleID'] = $this->_moduleID; $indexData['contentID'] = $imageData[$i]['II_ImageID']; $indexData['languageID'] = $imageData[$i]['II_LanguageID']; $indexData['action'] = 'delete'; Cible_FunctionsIndexation::indexation($indexData); } $imageObject->delete($imageID); $galleryImageDelete = new GalleriesImages(); $where = 'GI_GalleryID = ' . $galleryID . " and GI_ImageID = " . $imageID; $galleryImageDelete->delete($where); //delete the gallery folder Cible_FunctionsGeneral::delFolder("../../{$this->_config->document_root}/data/images/gallery/" . $galleryID . "/" . $imageID); if (!$this->_isXmlHttpRequest) { $this->_redirect("/gallery/index/list/blockID/{$blockID}/pageID/{$pageID}"); } else { $this->view->assign('success', true); $this->view->assign('imageID', $imageID); } } //$this->_redirect($return); } } //} }
public function deleteAction() { // variables $pageID = (int) $this->_getParam('pageID'); $blockID = (int) $this->_getParam('blockID'); $newsID = (int) $this->_getParam('newsID'); if ($this->view->aclIsAllowed('news', 'publish', true)) { $this->view->return = !empty($pageID) ? $this->view->baseUrl() . "/news/index/list/blockID/{$blockID}/pageID/{$pageID}" : $this->view->baseUrl() . "/news/index/list-all/"; $newsObject = new NewsObject(); if ($this->_request->isPost()) { $del = $this->_request->getPost('delete'); if ($del && $newsID > 0) { $newsObject->delete($newsID); $indexData['moduleID'] = $this->_moduleID; $indexData['contentID'] = $newsID; $indexData['languageID'] = Zend_Registry::get("currentEditLanguage"); $indexData['action'] = 'delete'; Cible_FunctionsIndexation::indexation($indexData); Cible_FunctionsGeneral::delFolder("../../{$this->_config->document_root}/data/images/news/" . $newsID); } if (!empty($pageID)) { $this->_redirect("/news/index/list/blockID/{$blockID}/pageID/{$pageID}"); } else { $this->_redirect("/news/index/list-all/"); } } elseif ($newsID > 0) { $this->view->news = $newsObject->populate($newsID, Zend_Registry::get('currentEditLanguage')); } } }
public function deleteAction() { $this->view->title = "Suppression d'un produit"; 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 ProductsObject(); $select = $oData->getAll(null, false, $id); $data = $this->_db->fetchRow($select); $this->view->product = $data; if ($this->_request->isPost()) { $del = $this->_request->getPost('delete'); if ($del && $id > 0) { $oData->delete($id); Cible_FunctionsGeneral::delFolder($this->_imageFolder . $id); // DELETE ASSOCIATION $association = new ProductsAssociationData(); $where = "AP_MainProductID = " . $id; $association->delete($where); } $this->_redirect($returnUrl); } } }