page.subscribe.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <?php global $conf; ?>
  2. <div class="row justify-content-md-center">
  3. <div id="subscribe-form" class="col-lg-7 col-xl-5 text-center subscribe-form <?php if(!empty($conf->get('subscribe_disable_paste'))) echo "subscribe-disable-paste"; ?>" data-action="subscribe_save">
  4. <h5 class="text-muted text-uppercase">Inscription</h5>
  5. <img src="plugin/subscribe/img/subscribe_head.svg">
  6. <p class="mt-2 mb-3">Veuillez remplir le formulaire ci-dessous pour vous inscrire</p>
  7. <div class="row">
  8. <?php
  9. $passwordLegend = '';
  10. $forbiddenChars = htmlentities($conf->get('password_forbidden_char'));
  11. if(!empty($forbiddenChars)) $passwordLegend .= '<span class="text-danger pointer d-inline-block ml-1" data-tooltip title="'.$forbiddenChars.' interdits"><i class="far fa-question-circle"></i></span>';
  12. $selectedFormats = json_decode($conf->get('password_format'),true);
  13. if(is_array($selectedFormats) && !empty($selectedFormats)) $passwordLegend .= '<span class="font-italic text-primary pointer d-inline-block mt-1 float-right user-select-none subscribe-password-rules" data-type="card" data-action="subscribe_password_card" data-parameters=""><u>Voir les règles</u></span>';
  14. $fields = array(
  15. 'firstname' => array(
  16. 'label' => '<i class="far fa-user"></i>',
  17. 'type' => 'text',
  18. 'placeholder' => 'ex: John',
  19. 'legend' => 'Prénom',
  20. 'default' => '',
  21. 'required' => true,
  22. 'attributes' => array(
  23. 'class' => '"text-capitalize form-control"'
  24. ),
  25. ),
  26. 'name' => array(
  27. 'label' => '<i class="fas fa-user"></i>',
  28. 'type' => 'text',
  29. 'placeholder' => 'ex: DOE',
  30. 'legend' => 'Nom de famille',
  31. 'default' => '',
  32. 'required' => true,
  33. 'attributes' => array(
  34. 'class' => '"text-uppercase form-control"'
  35. ),
  36. ),
  37. 'mail' => array(
  38. 'label' => '<i class="far fa-envelope"></i>',
  39. 'type' => 'mail',
  40. 'placeholder' => 'john@doe.com',
  41. 'legend' => 'Votre email',
  42. 'default' => '',
  43. 'required' => true,
  44. ),
  45. 'mail_confirm' => array(
  46. 'label' => '<i class="far fa-envelope"></i>',
  47. 'type' => 'mail',
  48. 'placeholder' => 'john@doe.com',
  49. 'legend' => 'Confirmation de votre email',
  50. 'default' => '',
  51. 'required' => true,
  52. ),
  53. 'password_initialisation' => array(
  54. 'label' => '<i class="fas fa-lock"></i>',
  55. 'type' => 'password',
  56. 'placeholder' => '************',
  57. 'attributes' => array(
  58. 'autocomplete'=>'"new-password"',
  59. 'data-generator' => true,
  60. 'data-show-strength' => true,
  61. 'data-forbidden' => $forbiddenChars,
  62. 'data-length' => '"6"',
  63. 'onkeyup' => '"subscribe_password_update(this)"',
  64. 'onchange' => '"subscribe_password_update(this)"',
  65. ),
  66. 'legend' => 'Mot de passe '.$passwordLegend,
  67. 'default' => '',
  68. 'required' => true
  69. ),
  70. 'password_confirm' => array(
  71. 'label' => '<i class="fas fa-lock"></i>',
  72. 'type' => 'password',
  73. 'placeholder' => '************',
  74. 'legend' => 'Confirmation de mot de passe',
  75. 'default' => '',
  76. 'required' => true
  77. )
  78. );
  79. Plugin::callHook('subscribe_form',array(&$fields));
  80. foreach(FieldType::toForm($fields) as $field): ?>
  81. <div class="col-lg-12 col-xl-6 mb-3 text-left">
  82. <span class="pl-1 mb-1 d-inline-block"><?php echo $field['label']; ?></span>
  83. <?php if(!empty($field['legend'])): ?>
  84. <small class="text-muted"> - <?php echo $field['legend']; ?></small>
  85. <?php endif;
  86. echo $field['input'] ?>
  87. </div>
  88. <?php endforeach; ?>
  89. <?php if($conf->get('subscribe_enable_captcha')): ?>
  90. <div class="col-md-12 subscribe-captcha-container">
  91. <hr>
  92. <legend class="mb-3">Question anti-robot<div class="btn btn-small" title="Renouveler le captcha" onclick="subscribe_reload_captcha(this)"><i class="fas fa-fw fa-sync-alt"></i></div></legend>
  93. <?php echo subscribe_captcha(); ?>
  94. <input class="form-control form-anti-robot text-center" type="text">
  95. </div>
  96. <?php endif; ?>
  97. </div>
  98. <div class="btn btn-success mt-3 w-100" title="Valider l'inscription" onclick="subscribe_save()"><i class="fas fa-fw fa-check"></i> Valider</div>
  99. </div>
  100. <!-- page de validation -->
  101. <div class="col-md-4 text-center subscribe-validation hidden">
  102. <?php if(!$conf->get('subscribe_disable_mail')): ?>
  103. <h5 class="text-muted text-uppercase">Inscription validée</h5>
  104. <img class="my-3" src="plugin/subscribe/img/subscribe_check.svg">
  105. <p class="mt-2">Vous allez recevoir un e-mail <br>de confirmation dans peu de temps.</p>
  106. <p class="mt-2">Si vous ne voyez pas l'email dans votre boîte de réception, <br>merci de regarder dans vos courriers indésirables.</p>
  107. <?php else: ?>
  108. <h5 class="text-muted text-uppercase">Inscription terminée</h5>
  109. <img src="plugin/subscribe/img/subscribe_head.svg">
  110. <p class="mt-2 px-3">Vous pouvez dès à présent vous connecter avec les éléments suivants :</p>
  111. <ul class="list-unstyled px-5 text-left">
  112. <li><strong>Identifiant :</strong> <code class="font-weight-bold bg-light p-2 pointer" onclick="select_text(this, event);copy_string($(this).text(), this);"></code></li>
  113. <li><strong>Mot de passe : </strong><small>Le mot de passe renseigné lors de votre inscription</small></li>
  114. </ul>
  115. <?php endif; ?>
  116. <a href="index.php">Revenir à l'accueil</a>
  117. </div>
  118. </div>