registration-dist.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  78. <link href="/custompages/css/vendor/bootstrap.min.css" rel="stylesheet">
  79. <!--[if !IE 6]><!-->
  80. <link rel="stylesheet" type="text/css" href="/custompages/style.css" />
  81. <!--<![endif]-->
  82. <!--[if IE 6]>
  83. <link rel="stylesheet" type="text/css" href="/custompages/style-ie6.css" />
  84. <![endif]-->
  85. <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
  86. <!--[if lt IE 9]>
  87. <script src="js/vendor/html5shiv.js"></script>
  88. <script src="js/vendor/respond.min.js"></script>
  89. <![endif]-->
  90. <script type="text/javascript" src="<?php echo $rootWeb ?>web/assets/jquery/jquery.min.js"></script>
  91. </head>
  92. <body>
  93. <img id="backgroundimage" src="/custompages/images/page-background.png"">
  94. <section id="registration">
  95. <div class="container">
  96. <div class="row">
  97. <div class="col-xs-12">
  98. <div class="form-wrap">
  99. <div class="logo">
  100. <img src="/custompages/images/header.png">
  101. </div>
  102. <?php if (isset($content['error']) && !empty($content['error'])) {
  103. echo '<div id="registration-form-error" class="alert alert-danger">'.$content['error'].'</div>';
  104. }?>
  105. <div id="registration-form-box" class="form-box">
  106. <div class="block-form-login">
  107. <?php
  108. $content['form']->display();
  109. ?>
  110. </div>
  111. <div id="links">
  112. <!--<a href="mailto: support@cblue.be"><?php echo custompages_get_lang('NeedContactAdmin')?></a><br />-->
  113. </div>
  114. </div>
  115. <div id="footer">
  116. <img src="/custompages/images/footer.png" />
  117. </div> <!-- #footer -->
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122. </section>
  123. </body>
  124. </html>