/** * Deletes one page * @note For the moment, this method doesn't delete the linked articles, which will stay in database as phantom * @param int $id_page * */ public function delete($id_page) { $affected_rows = $this->page_model->delete($id_page); // Delete was successful if ($affected_rows > 0) { // Clean URL table $this->url_model->clean_table(); // Clear the cache Cache()->clear_cache(); // Remove deleted article from DOM $this->callback[] = array('fn' => 'ION.deleteDomElements', 'args' => array('.page' . $id_page)); // If the current edited article is deleted if ($this->input->post('redirect')) { $this->callback[] = array('fn' => 'ION.updateElement', 'args' => array('element' => 'mainPanel', 'url' => 'dashboard')); } $this->success(lang('ionize_message_operation_ok')); } else { $this->error(lang('ionize_message_operation_nok')); } }