Replacing formw and row with the formvalidator functions

skala
Julio Montoya 14 years ago
parent c3f14c54ae
commit dd14a63f08
  1. 122
      main/auth/inscription.php
  2. 11
      main/create_course/add_course.php

@ -278,77 +278,75 @@ if (is_array($extra_data)) {
$form->setDefaults($defaults);
if (api_get_setting('use_custom_pages') != 'true') {
// Load terms & conditions from the current lang
if (api_get_setting('allow_terms_conditions') == 'true') {
$get = array_keys($_GET);
if (isset($get)) {
if ($get[0] == 'legal'){
$language = api_get_interface_language();
$language = api_get_language_id($language);
$term_preview = LegalManager::get_last_condition($language);
if (!$term_preview) {
//look for the default language
$language = api_get_setting('platformLanguage');
$language = api_get_language_id($language);
$term_preview = LegalManager::get_last_condition($language);
}
$tool_name = get_lang('TermsAndConditions');
Display :: display_header('');
echo '<div class="actions-title">';
echo $tool_name;
echo '</div>';
if (!empty($term_preview['content'])) {
echo $term_preview['content'];
} else {
echo get_lang('ComingSoon');
// Load terms & conditions from the current lang
if (api_get_setting('allow_terms_conditions') == 'true') {
$get = array_keys($_GET);
if (isset($get)) {
if ($get[0] == 'legal') {
$language = api_get_interface_language();
$language = api_get_language_id($language);
$term_preview = LegalManager::get_last_condition($language);
if (!$term_preview) {
//look for the default language
$language = api_get_setting('platformLanguage');
$language = api_get_language_id($language);
$term_preview = LegalManager::get_last_condition($language);
}
$tool_name = get_lang('TermsAndConditions');
Display :: display_header($tool_name);
if (!empty($term_preview['content'])) {
echo $term_preview['content'];
} else {
echo get_lang('ComingSoon');
}
Display :: display_footer();
exit;
}
}
Display :: display_footer();
exit;
}
}
}
$tool_name = get_lang('Registration',null,(!empty($_POST['language'])?$_POST['language']:$_user['language']));
Display :: display_header($tool_name);
$form->addElement('header', $tool_name);
$home = api_get_path(SYS_PATH).'home/';
if ($_configuration['multiple_access_urls']) {
$access_url_id = api_get_current_access_url_id();
if ($access_url_id != -1) {
$url_info = api_get_access_url($access_url_id);
$url = api_remove_trailing_slash(preg_replace('/https?:\/\//i', '', $url_info['url']));
$clean_url = replace_dangerous_char($url);
$clean_url = str_replace('/', '-', $clean_url);
$clean_url .= '/';
$home_old = api_get_path(SYS_PATH).'home/';
$home = api_get_path(SYS_PATH).'home/'.$clean_url;
$tool_name = get_lang('Registration',null,(!empty($_POST['language'])?$_POST['language']:$_user['language']));
Display :: display_header($tool_name);
$form->addElement('header', $tool_name);
$home = api_get_path(SYS_PATH).'home/';
if ($_configuration['multiple_access_urls']) {
$access_url_id = api_get_current_access_url_id();
if ($access_url_id != -1) {
$url_info = api_get_access_url($access_url_id);
$url = api_remove_trailing_slash(preg_replace('/https?:\/\//i', '', $url_info['url']));
$clean_url = replace_dangerous_char($url);
$clean_url = str_replace('/', '-', $clean_url);
$clean_url .= '/';
$home_old = api_get_path(SYS_PATH).'home/';
$home = api_get_path(SYS_PATH).'home/'.$clean_url;
}
}
}
if (file_exists($home.'register_top_'.$user_selected_language.'.html')) {
$home_top_temp = @(string)file_get_contents($home.'register_top_'.$user_selected_language.'.html');
$open = str_replace('{rel_path}', api_get_path(REL_PATH), $home_top_temp);
$open = api_to_system_encoding($open, api_detect_encoding(strip_tags($open)));
if (!empty($open)) {
echo '<div style="border:1px solid #E1E1E1; padding:2px;">'.$open.'</div>';
if (file_exists($home.'register_top_'.$user_selected_language.'.html')) {
$home_top_temp = @(string)file_get_contents($home.'register_top_'.$user_selected_language.'.html');
$open = str_replace('{rel_path}', api_get_path(REL_PATH), $home_top_temp);
$open = api_to_system_encoding($open, api_detect_encoding(strip_tags($open)));
if (!empty($open)) {
echo '<div style="border:1px solid #E1E1E1; padding:2px;">'.$open.'</div>';
}
}
}
// Forbidden to self-register
if (api_get_setting('allow_registration') == 'false') {
api_not_allowed();
}
// Forbidden to self-register
if (api_get_setting('allow_registration') == 'false') {
api_not_allowed();
}
//api_display_tool_title($tool_name);
if (api_get_setting('allow_registration') == 'approval') {
Display::display_normal_message(get_lang('YourAccountHasToBeApproved'));
}
//if openid was not found
if (!empty($_GET['openid_msg']) && $_GET['openid_msg'] == 'idnotfound') {
Display::display_warning_message(get_lang('OpenIDCouldNotBeFoundPleaseRegister'));
}
//api_display_tool_title($tool_name);
if (api_get_setting('allow_registration') == 'approval') {
Display::display_normal_message(get_lang('YourAccountHasToBeApproved'));
}
//if openid was not found
if (!empty($_GET['openid_msg']) && $_GET['openid_msg'] == 'idnotfound') {
Display::display_warning_message(get_lang('OpenIDCouldNotBeFoundPleaseRegister'));
}
}

@ -149,7 +149,7 @@ if ($course_validation_feature) {
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->addElement('checkbox', 'legal', null, get_lang('IAcceptTermsAndConditions'), 1);
$form->addRule('legal', get_lang('YouHaveToAcceptTermsAndConditions'), 'required');
// Link to terms and conditions.
$link_terms_and_conditions = '<script type="text/JavaScript">
@ -158,12 +158,9 @@ if ($course_validation_feature) {
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><a href="#" onclick="javascript: MM_openBrWindow(\''.$terms_and_conditions_url.'\',\'Conditions\',\'scrollbars=yes, width=800\')">';
$link_terms_and_conditions .= get_lang('ReadTermsAndConditions').'</a>';
$form->addElement('label', null, $link_terms_and_conditions);
}
}

Loading…
Cancel
Save