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