/** * Wrapperfunktion */ function contact() { if (!$_POST['submit']) { return showContactForm(); } else { return validateContactForm(); } }
function executeSend($request) { $errors = array(); if (!$request->hasParameter("mootact")) { $errors["general"] = "Invalid submission"; return $errors; } $mootact = $request->getParameter("mootact"); if (!is_array($request->getParameter("mootact"))) { $errors["general"] = "Malformed submission"; return $errors; } $errors = validateContactForm($mootact); if (count($errors)) { return $errors; } try { sendMessage($mootact); } catch (Exception $e) { $errors["general"] = 'Failed to send message. Please contact us directly at: <a href="mailto:' . mtConfig::get("send_to") . '">' . mtConfig::get("send_to") . '</a>'; } return $errors; }