registration-dist.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * This script allows for specific registration rules (see CustomPages feature of Chamilo)
  5. * Please contact CBlue regarding any licences issues.
  6. * Author: noel@cblue.be
  7. * Copyright: CBlue SPRL, 20XX (GNU/GPLv3).
  8. *
  9. * @package chamilo.custompages
  10. */
  11. require_once api_get_path(SYS_PATH).'main/inc/global.inc.php';
  12. require_once __DIR__.'/language.php';
  13. /**
  14. * Removes some unwanted elementend of the form object.
  15. */
  16. $content['form']->removeElement('extra_mail_notify_invitation');
  17. $content['form']->removeElement('extra_mail_notify_message');
  18. $content['form']->removeElement('extra_mail_notify_group_message');
  19. $content['form']->removeElement('official_code');
  20. $content['form']->removeElement('phone');
  21. $content['form']->removeElement('submit');
  22. if (isset($content['form']->_elementIndex['status'])) {
  23. $content['form']->removeElement('status');
  24. $content['form']->removeElement('status');
  25. }
  26. $rootWeb = api_get_path('WEB_PATH');
  27. // Deprecated since 2015-03-26
  28. /**
  29. * Code to change the way QuickForm render html.
  30. */
  31. /*
  32. $renderer = & $content['form']->defaultRenderer();
  33. $form_template = <<<EOT
  34. <form {attributes}>
  35. {content}
  36. <div class="clear">
  37. &nbsp;
  38. </div>
  39. <p><a href="#" class="btn btn-primary" onclick="$('#registration-form').submit()"><span>S'inscrire</span></a></p>
  40. </form>
  41. EOT;
  42. $renderer->setFormTemplate($form_template);
  43. $element_template = <<<EOT
  44. <div class="field decalle">
  45. <label>
  46. <!-- BEGIN required --><span class="form_required">*</span> <!-- END required -->{label}
  47. </label>
  48. <div class="formw">
  49. <!-- BEGIN error --><span class="form_error">{error}</span><br /><!-- END error --> {element}
  50. </div>
  51. </div>
  52. EOT;
  53. $element_template_wimage = <<<EOT
  54. <div class="field decalle display">
  55. <label>
  56. <!-- BEGIN required --><span class="form_required">*</span> <!-- END required -->{label}
  57. </label>
  58. <div class="formw">
  59. <!-- BEGIN error --><span class="form_error">{error}</span><br /><!-- END error --> {element}
  60. <img src="/custompages/images/perso.jpg" alt="" />
  61. </div>
  62. </div>
  63. EOT;
  64. $renderer->setElementTemplate($element_template_wimage,'pass1');
  65. $renderer->setElementTemplate($element_template);
  66. $header_template = <<<EOT
  67. <div class="row">
  68. <div class="form_header">{header}</div>
  69. </div>
  70. EOT;
  71. */
  72. ?>
  73. <html>
  74. <head>
  75. <title><?php echo custompages_get_lang('Registration'); ?></title>
  76. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  77. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  78. <script type="text/javascript" src="<?php echo $rootWeb; ?>web/assets/jquery/dist/jquery.min.js"></script>
  79. </head>
  80. <body>
  81. <img id="backgroundimage" src="/custompages/images/page-background.png"">
  82. <section id="registration">
  83. <div class="container">
  84. <div class="row">
  85. <div class="col-xs-12">
  86. <div class="form-wrap">
  87. <div class="logo">
  88. <img src="/custompages/images/header.png">
  89. </div>
  90. <?php if (isset($content['error']) && !empty($content['error'])) {
  91. echo '<div id="registration-form-error" class="alert alert-danger">'.$content['error'].'</div>';
  92. }?>
  93. <div id="registration-form-box" class="form-box">
  94. <div class="block-form-login">
  95. <?php
  96. $content['form']->display();
  97. ?>
  98. </div>
  99. <div id="links">
  100. <!--<a href="mailto: support@cblue.be"><?php echo custompages_get_lang('NeedContactAdmin'); ?></a><br />-->
  101. </div>
  102. </div>
  103. <div id="footer">
  104. <img src="/custompages/images/footer.png" />
  105. </div> <!-- #footer -->
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. </section>
  111. </body>
  112. </html>