public function getTemplateParameters() { $id = $this->_websoccer->getRequestParameter("id"); $message = MessagesDataService::getMessageById($this->_websoccer, $this->_db, $id); // update "seen" state if ($message && !$message["seen"]) { $columns["gelesen"] = "1"; $fromTable = $this->_websoccer->getConfig("db_prefix") . "_briefe"; $whereCondition = "id = %d"; $this->_db->queryUpdate($columns, $fromTable, $whereCondition, $id); } return array("message" => $message); }
public function executeAction($parameters) { $id = $parameters["id"]; $message = MessagesDataService::getMessageById($this->_websoccer, $this->_db, $id); if ($message == null) { throw new Exception($this->_i18n->getMessage("messages_delete_invalidid")); } // delete $fromTable = $this->_websoccer->getConfig("db_prefix") . "_briefe"; $whereCondition = "id = %d"; $this->_db->queryDelete($fromTable, $whereCondition, $id); // success message $this->_websoccer->addFrontMessage(new FrontMessage(MESSAGE_TYPE_SUCCESS, $this->_i18n->getMessage("messages_delete_success"), "")); return null; }