/** * Delete page with all content */ function handleDelete($id) { $doc = new Model\Document($this->database); $doc->delete($id); Model\IO::removeDirectory(APP_DIR . '/media/' . $id); $this->redirect(":Admin:Events:default", array("id" => null)); }
/** * Delete page */ function handleDeletePage($id) { $page = new Model\Page($this->database); $pages = $page->getChildren($id); $pages[] = $id; foreach ($pages as $item) { echo 1; $doc = new Model\Document($this->database); $doc->delete($item); Model\IO::removeDirectory(APP_DIR . '/media/' . $item); } $this->redirect(this, array("id" => null, "type" => $this->getParameter("type"))); }
/** * Delete contact with all other tables and related page */ function handleDelete($id) { for ($a = 0; $a < count($id); $a++) { $contacts = $this->database->table("contacts")->get($id[$a]); if ($contacts) { $page = $this->database->table("pages")->get($contacts->pages_id); if ($page) { $doc = new \App\Model\Document($this->database); $doc->delete($page->id); \App\Model\IO::removeDirectory(APP_DIR . '/media/' . $page->id); } } } $this->presenter->redirect(this, array("id" => null)); }