private function handleGET_delForum($request_data) { global $error_msg; if ($this->user_status & PaForumsUsers::_owner || $this->user_status & PaForumsUsers::_admin) { try { PaForum::deletePaForum($request_data['forum_id']); unset($request_data['forum_id']); unset($request_data['action']); $msg = __("Forum sucessfully deleted"); $this->redirectWithMessage($msg, $request_data, 'info_message'); } catch (Exception $e) { $error_msg = "Exception in ForumModule, function handleGET_delForum();<br />Message: " . $e->getMessage(); } } else { $error_msg = __("You don't have required permissions for this task!"); return 'skip'; } }
/** * Delete an existing record - dynamic method: delete_PaForumCategory() * * * Generated with the DalClassGenerator created by: * Zoran Hron <*****@*****.**> * * @param id * @result void **/ public function delete_PaForumCategory($id) { $conditionalStatement = "category_id = {$id} AND is_active = 1"; $forums = PaForum::listPaForum($conditionalStatement); foreach ($forums as $forum) { PaForum::deletePaForum($forum->get_id()); } // sql query $sql = "UPDATE { pa_forum_category } SET is_active = 0 WHERE id = ?;"; $params = array($id); // performs deletion of data $res = Dal::query($sql, $params); }