diff options
Diffstat (limited to 'src/view/FormBuilder.php')
-rw-r--r-- | src/view/FormBuilder.php | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/src/view/FormBuilder.php b/src/view/FormBuilder.php index 5f8545c..508763b 100644 --- a/src/view/FormBuilder.php +++ b/src/view/FormBuilder.php | |||
@@ -19,32 +19,31 @@ class FormBuilder extends AbstractBuilder | |||
19 | extract($node->getNodeData()->getData()); | 19 | extract($node->getNodeData()->getData()); |
20 | } | 20 | } |
21 | 21 | ||
22 | $action_url = new URL(['page' => CURRENT_PAGE]); | ||
23 | $captcha = new Captcha; | 22 | $captcha = new Captcha; |
24 | $_SESSION['captcha'] = $captcha->getSolution(); | 23 | $_SESSION['captcha'] = $captcha->getSolution(); |
25 | 24 | ||
26 | $recipient_found = false; | ||
27 | if(isset($email)){ | ||
28 | $recipient_found = true; | ||
29 | } | ||
30 | else{ | ||
31 | $email = ''; | ||
32 | } | ||
33 | |||
34 | $admin_content = ''; | 25 | $admin_content = ''; |
35 | if($_SESSION['admin']) | 26 | if($_SESSION['admin']) |
36 | { | 27 | { |
37 | $admin_content = '<script src="js/form.js"></script> | 28 | $admin_content = '' |
38 | <h3>Configuration du formulaire</h3> | 29 | //. '<h3>Configuration du formulaire</h3>' . "\n" |
39 | <div class="admin_form"> | 30 | . '<div class="admin_form">' . "\n" |
40 | <label for="recipient">E-mail de destination</label> | 31 | /*. '<p> |
41 | <input id="recipient" type="email" name="recipient" placeholder="mon-adresse@email.fr" value="' . $email . '"> | 32 | <label for="recipient">E-mail de destination</label> |
42 | <button onclick="changeRecipient(' . $node->getNodeData()->getId() . ')">Valider</button> | 33 | <input id="recipient" type="email" name="recipient" placeholder="mon-adresse@email.fr" value="' . $email . '"> |
43 | </div>'; | 34 | <input type="hidden" id="recipient_hidden" value=""> |
35 | <button onclick="changeRecipient(' . $node->getNodeData()->getId() . ')">Valider</button> | ||
36 | </p> | ||
37 | <p> | ||
38 | <label for="smtp">Serveur SMTP</label> | ||
39 | <input id="smtp" type="text" name="smtp" value="' . $smtp . '"> | ||
40 | <input type="hidden" id="smtp_hidden" value=""> | ||
41 | <button onclick="changeSmtp(' . $node->getNodeData()->getId() . ')">Valider</button> | ||
42 | </p>' . "\n"*/ | ||
43 | . '<p><button onclick="sendTestEmail()">Envoi d\'un e-mail de test</button></p>' . "\n" | ||
44 | . '<p class="test_email_success full_width_column"></p>' | ||
45 | . '</div>' . "\n"; | ||
44 | } | 46 | } |
45 | |||
46 | // vérifier qu'une adresse de destination est bien configurée | ||
47 | $no_recipient_warning = '<p class="no_recipient_warning ' . ($recipient_found ? 'hidden' : '') . '">Aucune adresse de destination n\'a été configurée, envoi d\'e-mail impossible!</p>'; | ||
48 | 47 | ||
49 | ob_start(); | 48 | ob_start(); |
50 | require $viewFile; | 49 | require $viewFile; |