diff --git a/php/cl_contactform_input.php b/php/cl_contactform_input.php index 87a7724..d93a781 100644 --- a/php/cl_contactform_input.php +++ b/php/cl_contactform_input.php @@ -26,14 +26,6 @@ $oField = new cHTMLTextbox("CMS_VAR[4]", "CMS_VALUE[4]"); $oField->setWidth(8); $oCfgTable->setCell(4, 0, mi18n("Hintergrundfarbe bei Fehlern (z.B. red):")); $oCfgTable->setCell(4, 1, $oField->render()); -/* -$oField = new cHTMLCheckbox("CMS_VAR[5]", "true"); -$bHasJQuery = ("CMS_VALUE[5]" == 'true')?true:false; -$oField->setChecked($bHasJQuery); -$oField->setLabelText(' '); -$oCfgTable->setCell(5, 0, mi18n("jQuery Script vorhanden:")); -$oCfgTable->setCell(5, 1, $oField->render()); -*/ $oCfgTable->render(true); ?> '', - 'from' => array( - 'name' => '', - 'email' => '' - ), - 'message' => '', - 'subject' => '' - ); - private $unraveled = array(); - private $form = array( - 'form' => '', - 'answer' => '', - 'colorError' => '' - ); - private $formField = array(); + private array $email = ['adresses' => '', 'from' => ['name' => '', 'email' => ''], 'message' => '', 'subject' => '']; + private array $unraveled = []; + private array $form = ['form' => '', 'answer' => '', 'colorError' => '']; + private array $formField = []; public function __construct() { } - private function sendEmail() { + private function sendEmail(): bool + { $this->unravel($this->suppress('sent')); $this->generateEmailMessage(); @@ -58,7 +47,8 @@ class w3form { return false; } - private function unravel($toUnravel, $prefix = '') { + private function unravel($toUnravel, $prefix = ''): void + { foreach ($toUnravel as $key => $value) { if (is_array($value)) { $this->unravel($value, $key . ' '); @@ -86,6 +76,7 @@ class w3form { } private function suppress() { + $fields = []; $suppress = func_get_args(); foreach ($_POST as $key => $value) { if (array_search($key, $suppress) === false) @@ -125,7 +116,7 @@ class w3form { public function formInterpretation(&$form) { $fields = explode('###', $form); - $field = array(); + $field = []; for ($i = 1; $i < count($fields); $i = $i + 2) { $attributte = explode(';', trim($fields[$i])); @@ -202,7 +193,7 @@ class w3form { } } // show captcha HTML using Securimage::getCaptchaHtml() - $options = array(); + $options = []; $options['input_name'] = 'ct_captcha'; // change name of input element for form post input_text $options['input_text'] = mi18n("Zeichen eingeben"); $options['input_required'] = false; @@ -231,7 +222,7 @@ class w3form { break; case 'select': echo "