|
@@ -121,23 +121,30 @@ $form->applyFilter('select_language', 'html_filter');
|
|
|
|
|
|
if ($course_validation_feature) {
|
|
|
|
|
|
- // Terms and conditions to be accepted before sending a course request.
|
|
|
- $form->addElement('checkbox', 'legal', get_lang('IAcceptTermsAndConditions'), '', 1);
|
|
|
- $form->addRule('legal', get_lang('YouHaveToAcceptTermsAndConditions'), 'required', '', '');
|
|
|
- // Link to terms and conditios.
|
|
|
- // TODO: This hardcoded value is to be corrected/eliminated.
|
|
|
- $link_terms_and_conditions = '<script type="text/JavaScript">
|
|
|
- <!--
|
|
|
- function MM_openBrWindow(theURL,winName,features) { //v2.0
|
|
|
- window.open(theURL,winName,features);
|
|
|
+ // URL to terms and conditions.
|
|
|
+ $terms_and_conditions_url = trim(api_get_setting('course_validation_terms_and_conditions_url'));
|
|
|
+ if (empty($terms_and_conditions_url)) {
|
|
|
+ // TODO: If Chamilo's module "Terms and conditions" is active, we may get the URL from there.
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!empty($terms_and_conditions_url)) {
|
|
|
+ // Terms and conditions to be accepted before sending a course request.
|
|
|
+ $form->addElement('checkbox', 'legal', get_lang('IAcceptTermsAndConditions'), '', 1);
|
|
|
+ $form->addRule('legal', get_lang('YouHaveToAcceptTermsAndConditions'), 'required', '', '');
|
|
|
+ // Link to terms and conditions.
|
|
|
+ $link_terms_and_conditions = '<script type="text/JavaScript">
|
|
|
+ <!--
|
|
|
+ function MM_openBrWindow(theURL,winName,features) { //v2.0
|
|
|
+ window.open(theURL,winName,features);
|
|
|
+ }
|
|
|
+ //-->
|
|
|
+ </script>
|
|
|
+ <div class="row">
|
|
|
+ <div class="formw">
|
|
|
+ <a href="#" onclick="javascript: MM_openBrWindow(\''.$terms_and_conditions_url.'\',\'Conditions\',\'scrollbars=yes, width=800\')">';
|
|
|
+ $link_terms_and_conditions .= get_lang('ReadTermsAndConditions').'</a></div></div>';
|
|
|
+ $form->addElement('html', $link_terms_and_conditions);
|
|
|
}
|
|
|
- //-->
|
|
|
- </script>
|
|
|
- <div class="row">
|
|
|
- <div class="formw">
|
|
|
- <a href="#" onclick="javascript: MM_openBrWindow(\'http://TODO.change.this/hardcoded/value/use/a/setting.html\',\'Conditions\',\'scrollbars=yes, width=800\')">';
|
|
|
- $link_terms_and_conditions .= get_lang('ReadTermsAndConditions').'</a></div></div>';
|
|
|
- $form->addElement('html', $link_terms_and_conditions);
|
|
|
|
|
|
}
|
|
|
|