registration-dist.php 3.9 KB

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