Ejemplo n.º 1
0
 /**
  * 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);
             }
             $this->_redirect($returnUrl);
         } elseif ($id > 0) {
             // get date details
             $this->view->data = $oData->populate($id, $this->getCurrentEditLanguage());
         }
     }
 }
Ejemplo n.º 2
0
 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'));
             }
         }
     }
 }
Ejemplo n.º 3
0
 /**
  * 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());
         }
     }
 }
Ejemplo n.º 4
0
 function deleteAction()
 {
     $this->view->title = "Supprimer une page";
     // retrieve the ID of the parent page
     $PageID = $this->_getParam('ID');
     if (Cible_ACL::hasAccess($PageID)) {
         // generates tree by Language and send the result to the view
         Zend_Registry::set('baseUrl', $this->view->baseUrl());
         $this->view->TreeView = $this->view->getTreeView();
         if ($this->_request->isPost()) {
             //$PageID = (int)$this->_request->getPost('PageID');
             // if is set delete, then delete
             $delete = isset($_POST['delete']);
             if ($delete && $PageID > 0) {
                 Cible_FunctionsPages::deleteAllChildPage($PageID);
                 Cible_FunctionsPages::deleteAllBlock($PageID);
                 $pageSelect = new PagesIndex();
                 $select = $pageSelect->select()->where('PI_PageID = ?', $PageID);
                 $pageData = $pageSelect->fetchAll($select)->toArray();
                 foreach ($pageData as $page) {
                     $indexData['moduleID'] = 0;
                     $indexData['contentID'] = $PageID;
                     $indexData['languageID'] = $page['PI_LanguageID'];
                     $indexData['action'] = 'delete';
                     Cible_FunctionsIndexation::indexation($indexData);
                 }
                 $Page = new Pages();
                 $Where = 'P_ID = ' . $PageID;
                 $Page->delete($Where);
                 $PageIndex = new PagesIndex();
                 $Where = 'PI_PageID = ' . $PageID;
                 $PageIndex->delete($Where);
                 if (!$this->_request->isXmlHttpRequest()) {
                     $this->_redirect('/');
                 }
             } else {
                 if (!$this->_isXmlHttpRequest) {
                     $this->_redirect('/page/edit/ID/' . $PageID);
                 }
             }
         } else {
             if ($PageID > 0) {
                 $Page = new Pages();
                 $this->view->page = $Page->fetchRow('P_ID=' . $PageID);
                 $PageIndex = new PagesIndex();
                 $Select = $PageIndex->select()->where("PI_PageID = ?", $PageID)->where("PI_LanguageID = ?", $this->_defaultEditLanguage);
                 $this->view->pageindex = $PageIndex->fetchRow($Select);
             }
         }
     }
 }
Ejemplo n.º 5
0
 public function deactivateBlockAction()
 {
     $this->disableView();
     $_pageID = $this->getRequest()->getParam('ID');
     $_blockID = $this->getRequest()->getParam('blockID');
     if (Cible_ACL::hasAccess($_pageID)) {
         if ($this->_request->isPost()) {
             $formData = $this->_request->getPost();
             $db = $this->_db;
             $where = $db->quoteInto('B_ID = ?', $_blockID);
             $n = $db->update('Blocks', array('B_ZoneID' => -1), $where);
             if ($n == 1) {
                 echo Zend_Json::encode(array('result' => true));
                 return;
             }
         }
     }
     echo Zend_Json::encode(array('result' => false));
 }