@ -1,32 +1,26 @@
<?php
<?php
/* For licensing terms, see /dokeos_license.txt */
/* For licensing terms, see /license.txt */
/**
/**
==============================================================================
* This script displays a form for registering new users.
* This script displays a form for registering new users.
* @package dokeos.auth
* @package chamilo.admin
==============================================================================
*/
*/
// name of the language file that needs to be included
$language_file = array('registration', 'admin');
$language_file = array('registration', 'admin');
$cidReset = true;
$cidReset = true;
include ("../inc/global.inc.php");
include '../inc/global.inc.php';
require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
require_once (api_get_path(LIBRARY_PATH).'usermanager.lib.php');
require_once (api_get_path(CONFIGURATION_PATH).'profile.conf.php');
require_once(api_get_path(INCLUDE_PATH).'lib/mail.lib.inc.php');
require_once(api_get_path(INCLUDE_PATH).'lib/legal.lib.php');
//require_once(api_get_path(LIBRARY_PATH).'fileManage.lib.php');
require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
//require_once(api_get_path(LIBRARY_PATH).'fileUpload.lib.php');
require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
//require_once (api_get_path(LIBRARY_PATH).'image.lib.php');
require_once api_get_path(CONFIGURATION_PATH).'profile.conf.php';
require_once api_get_path(INCLUDE_PATH).'lib/mail.lib.inc.php';
require_once api_get_path(INCLUDE_PATH).'lib/legal.lib.php';
// Load terms & conditions from the current lang
// Load terms & conditions from the current lang
if (get_setting('allow_terms_conditions') == 'true') {
if (get_setting('allow_terms_conditions') == 'true') {
$get = array_keys($_GET);
$get = array_keys($_GET);
if (isset($get)) {
if (isset($get)) {
if ($get[0] == 'legal') {
if ($get[0] == 'legal') {
//$language = api_get_setting('platformLanguage');
$language = api_get_interface_language();
$language = api_get_interface_language();
$language = api_get_language_id($language);
$language = api_get_language_id($language);
$term_preview = LegalManager::get_last_condition($language);
$term_preview = LegalManager::get_last_condition($language);
@ -41,10 +35,11 @@ if (get_setting('allow_terms_conditions')=='true') {
echo '< div class = "actions-title" > ';
echo '< div class = "actions-title" > ';
echo $tool_name;
echo $tool_name;
echo '< / div > ';
echo '< / div > ';
if (!empty($term_preview['content']))
if (!empty($term_preview['content'])) {
echo $term_preview['content'];
echo $term_preview['content'];
else
} else {
echo get_lang('ComingSoon');
echo get_lang('ComingSoon');
}
Display :: display_footer();
Display :: display_footer();
exit;
exit;
}
}
@ -52,13 +47,13 @@ if (get_setting('allow_terms_conditions')=='true') {
}
}
$action = Security::remove_XSS($_GET['action']);
$action = Security::remove_XSS($_GET['action']);
$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
$tool_name = get_lang('ConfigureInscription');
$tool_name = get_lang('ConfigureInscription');
if (!empty($action)) {
if (!empty($action)) {
$interbreadcrumb[]=array('url' => 'configure_inscription.php',"name" => get_lang('ConfigureInscription'));
$interbreadcrumb[] = array('url' => 'configure_inscription.php', 'name' => get_lang('ConfigureInscription'));
switch($action) {
switch($action) {
case "edit_top" :
case 'edit_top' :
$tool_name=get_lang("EditTopRegister" );
$tool_name = get_lang('EditTopRegister' );
break;
break;
}
}
}
}
@ -73,19 +68,17 @@ if(!empty($_SESSION['user_language_choice'])) {
}
}
// ----- Ensuring availability of main files in the corresponding language -----
// ----- Ensuring availability of main files in the corresponding language -----
if ($_configuration['multiple_access_urls']==true ) {
if ($_configuration['multiple_access_urls']) {
$access_url_id = api_get_current_access_url_id();
$access_url_id = api_get_current_access_url_id();
if ($access_url_id != -1) {
if ($access_url_id != -1) {
$url_info = api_get_access_url($access_url_id);
$url_info = api_get_access_url($access_url_id);
// "http://" and the final "/" replaced
//$url = substr($url_info['url'],7,strlen($url_info['url'])-8);
$url = api_remove_trailing_slash(preg_replace('/https?:\/\//i', '', $url_info['url']));
$url = api_remove_trailing_slash(preg_replace('/https?:\/\//i', '', $url_info['url']));
$clean_url = replace_dangerous_char($url);
$clean_url = replace_dangerous_char($url);
$clean_url = str_replace('/', '-', $clean_url);
$clean_url = str_replace('/', '-', $clean_url);
$clean_url .= '/';
$clean_url .= '/';
$homep = '../../ home/'; //homep for Home Path
$homep = api_get_path(SYS_PATH). 'home/'; //homep for Home Path
$homep_new = '../../ home/'.$clean_url; //homep for Home Path added the url
$homep_new = api_get_path(SYS_PATH). 'home/'.$clean_url; //homep for Home Path added the url
$new_url_dir = api_get_path(SYS_PATH).'home/'.$clean_url;
$new_url_dir = api_get_path(SYS_PATH).'home/'.$clean_url;
//we create the new dir for the new sites
//we create the new dir for the new sites
if (!is_dir($new_url_dir)){
if (!is_dir($new_url_dir)){
@ -94,18 +87,16 @@ if ($_configuration['multiple_access_urls']==true) {
}
}
} else {
} else {
$homep_new = '';
$homep_new = '';
$homep = '../../ home/'; //homep for Home Path
$homep = api_get_path(SYS_PATH). 'home/'; //homep for Home Path
}
}
$topf = 'register_top'; //topf for Top File
$topf = 'register_top'; //topf for Top File
$ext = '.html'; //ext for HTML Extension - when used frequently, variables are
$ext = '.html'; //ext for HTML Extension - when used frequently, variables are
$homef = array($topf);
$homef = array($topf);
// If language-specific file does not exist, create it by copying default file
// If language-specific file does not exist, create it by copying default file
foreach ($homef as $my_file) {
foreach ($homef as $my_file) {
if ($_configuration['multiple_access_urls']==true ) {
if ($_configuration['multiple_access_urls']) {
if (!file_exists($homep_new.$my_file.'_'.$lang.$ext)) {
if (!file_exists($homep_new.$my_file.'_'.$lang.$ext)) {
copy($homep.$my_file.$ext, $homep_new.$my_file.'_'.$lang.$ext);
copy($homep.$my_file.$ext, $homep_new.$my_file.'_'.$lang.$ext);
}
}
@ -130,7 +121,7 @@ if(!empty($action)) {
// Write
// Write
if (file_exists($homep.$topf.'_'.$lang.$ext)) {
if (file_exists($homep.$topf.'_'.$lang.$ext)) {
if (is_writable($homep.$topf.'_'.$lang.$ext)) {
if (is_writable($homep.$topf.'_'.$lang.$ext)) {
$fp=fopen($homep.$topf.'_'.$lang.$ext,"w" );
$fp = fopen($homep.$topf.'_'.$lang.$ext, 'w' );
fputs($fp, $home_top);
fputs($fp, $home_top);
fclose($fp);
fclose($fp);
} else {
} else {
@ -138,7 +129,7 @@ if(!empty($action)) {
}
}
} else {
} else {
//File does not exist
//File does not exist
$fp=fopen($homep.$topf.'_'.$lang.$ext,"w" );
$fp = fopen($homep.$topf.'_'.$lang.$ext, 'w' );
fputs($fp, $home_top);
fputs($fp, $home_top);
fclose($fp);
fclose($fp);
}
}
@ -154,12 +145,13 @@ if(!empty($action)) {
// This request is only the preparation for the update of the home_top
// This request is only the preparation for the update of the home_top
$home_top = '';
$home_top = '';
if (is_file($homep.$topf.'_'.$lang.$ext) & & is_readable($homep.$topf.'_'.$lang.$ext)) {
if (is_file($homep.$topf.'_'.$lang.$ext) & & is_readable($homep.$topf.'_'.$lang.$ext)) {
$home_top=file_get_contents($homep.$topf.'_'.$lang.$ext);
$home_top = @(string) file_get_contents($homep.$topf.'_'.$lang.$ext);
} elseif (is_file($homep.$topf.$lang.$ext) & & is_readable($homep.$topf.$lang.$ext)) {
} elseif (is_file($homep.$topf.$lang.$ext) & & is_readable($homep.$topf.$lang.$ext)) {
$home_top=file_get_contents($homep.$topf.$lang.$ext);
$home_top = @(string) file_get_contents($homep.$topf.$lang.$ext);
} else {
} else {
$errorMsg = get_lang('HomePageFilesNotReadable');
$errorMsg = get_lang('HomePageFilesNotReadable');
}
}
$home_top = api_to_system_encoding($home_top, api_detect_encoding(strip_tags($home_top)));
break;
break;
}
}
}
}
@ -186,98 +178,99 @@ if (!empty($_GET['openid_msg']) && $_GET['openid_msg'] == 'idnotfound') {
$form = new FormValidator('registration');
$form = new FormValidator('registration');
if (get_setting('allow_terms_conditions') == 'true') {
if (get_setting('allow_terms_conditions') == 'true') {
if (!isset($_SESSION['update_term_and_condition'][1])) {
$display_all_form = !isset($_SESSION['update_term_and_condition'][1]);
$display_all_form=true;
} else {
$display_all_form=false;
}
} else {
} else {
$display_all_form = true;
$display_all_form = true;
}
}
if ($display_all_form===true) {
if ($display_all_form) {
if (api_is_western_name_order()) {
// FIRST NAME and LAST NAME
$form->addElement('text', 'lastname', get_lang('LastName'), array('size' => 40, 'disabled' => 'disabled'));
$form->addElement('text', 'firstname', get_lang('FirstName'), array('size' => 40, 'disabled' => 'disabled'));
} else {
// LAST NAME and FIRST NAME
// LAST NAME and FIRST NAME
$form->addElement('text', 'lastname', get_lang('LastName'), array('size' => 40, 'disabled' => 'disabled'));
$form->addElement('text', 'lastname', get_lang('LastName'), array('size' => 40, 'disabled' => 'disabled'));
$form->applyFilter('lastname','trim');
$form->addElement('text', 'firstname', get_lang('FirstName'), array('size' => 40, 'disabled' => 'disabled'));
$form->addElement('text', 'firstname', get_lang('FirstName'), array('size' => 40, 'disabled' => 'disabled'));
}
$form->applyFilter('firstname', 'trim');
$form->applyFilter('firstname', 'trim');
$form->applyFilter('lastname', 'trim');
$form->addRule('lastname', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('lastname', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('firstname', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('firstname', get_lang('ThisFieldIsRequired'), 'required');
// EMAIL
// EMAIL
$form->addElement('text', 'email', get_lang('Email'), array('size' => 40, 'disabled' => 'disabled'));
$form->addElement('text', 'email', get_lang('Email'), array('size' => 40, 'disabled' => 'disabled'));
if (api_get_setting('registration', 'email') == 'true')
if (api_get_setting('registration', 'email') == 'true') {
$form->addRule('email', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('email', get_lang('ThisFieldIsRequired'), 'required');
}
$form->addRule('email', get_lang('EmailWrong'), 'email');
$form->addRule('email', get_lang('EmailWrong'), 'email');
if (api_get_setting('openid_authentication') == 'true') {
if (api_get_setting('openid_authentication') == 'true') {
$form->addElement('text', 'openid', get_lang('OpenIDURL'), array('size' => 40, 'disabled' => 'disabled'));
$form->addElement('text', 'openid', get_lang('OpenIDURL'), array('size' => 40, 'disabled' => 'disabled'));
}
}
// USERNAME
// USERNAME
$form->addElement('text', 'username', get_lang('UserName'), array('size' => 20 , 'disabled' => 'disabled'));
$form->addElement('text', 'username', get_lang('UserName'), array('size' => USERNAME_MAX_LENGTH , 'disabled' => 'disabled'));
$form->addRule('username', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('username', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('username', get_lang('UsernameWrong'), 'username');
$form->addRule('username', get_lang('UsernameWrong'), 'username');
$form->addRule('username', get_lang('UserTaken'), 'username_available');
$form->addRule('username', get_lang('UserTaken'), 'username_available');
$form->addRule('username', sprintf(get_lang('UsernameMaxXCharacters'),'20'), 'maxlength',20);
$form->addRule('username', sprintf(get_lang('UsernameMaxXCharacters'), (string)USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
// PASSWORD
// PASSWORD
$form->addElement('password', 'pass1', get_lang('Pass'), array('size' => 40, 'disabled' => 'disabled'));
$form->addElement('password', 'pass1', get_lang('Pass'), array('size' => 40, 'disabled' => 'disabled'));
$form->addElement('password', 'pass2', get_lang('Confirmation'), array('size' => 40, 'disabled' => 'disabled'));
$form->addElement('password', 'pass2', get_lang('Confirmation'), array('size' => 40, 'disabled' => 'disabled'));
$form->addRule('pass1', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('pass1', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('pass2', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('pass2', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule(array('pass1', 'pass2'), get_lang('PassTwo'), 'compare');
$form->addRule(array('pass1', 'pass2'), get_lang('PassTwo'), 'compare');
if (CHECK_PASS_EASY_TO_FIND)
if (CHECK_PASS_EASY_TO_FIND) {
$form->addRule('password1', get_lang('PassTooEasy').': '.api_generate_password(), 'callback', 'api_check_password');
$form->addRule('password1', get_lang('PassTooEasy').': '.api_generate_password(), 'callback', 'api_check_password');
}
// PHONE
// PHONE
$form->addElement('text', 'phone', get_lang('Phone'), array('size' => 40, 'disabled' => 'disabled'));
$form->addElement('text', 'phone', get_lang('Phone'), array('size' => 40, 'disabled' => 'disabled'));
if (api_get_setting('registration', 'phone') == 'true')
if (api_get_setting('registration', 'phone') == 'true') {
$form->addRule('phone', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('phone', get_lang('ThisFieldIsRequired'), 'required');
}
// LANGUAGE
// LANGUAGE
if (get_setting('registration', 'language') == 'true') {
if (get_setting('registration', 'language') == 'true') {
$form->addElement('select_language', 'language', get_lang('Language'), '', array('disabled' => 'disabled'));
$form->addElement('select_language', 'language', get_lang('Language'), '', array('disabled' => 'disabled'));
}
}
// STUDENT/TEACHER
// STUDENT/TEACHER
if (get_setting('allow_registration_as_teacher') < > 'false') {
if (get_setting('allow_registration_as_teacher') != 'false') {
$form->addElement('radio', 'status', get_lang('Status'), get_lang('RegStudent'), STUDENT, array('disabled' => 'disabled'));
$form->addElement('radio', 'status', get_lang('Status'), get_lang('RegStudent'), STUDENT, array('disabled' => 'disabled'));
$form->addElement('radio', 'status', null, get_lang('RegAdmin'), COURSEMANAGER, array('disabled' => 'disabled'));
$form->addElement('radio', 'status', null, get_lang('RegAdmin'), COURSEMANAGER, array('disabled' => 'disabled'));
}
}
// EXTENDED FIELDS
// EXTENDED FIELDS
if (api_get_setting('extended_profile') == 'true' AND api_get_setting('extendedprofile_registration','mycomptetences') == 'true')
if (api_get_setting('extended_profile') == 'true' & & api_get_setting('extendedprofile_registration','mycomptetences') == 'true') {
{
$form->add_html_editor('competences', get_lang('MyCompetences'), false, false, array('ToolbarSet' => 'Profile', 'Width' => '100%', 'Height' => '130'));
$form->add_html_editor('competences', get_lang('MyCompetences'), false, false, array('ToolbarSet' => 'Profile', 'Width' => '100%', 'Height' => '130'));
}
}
if (api_get_setting('extended_profile') == 'true' AND api_get_setting('extendedprofile_registration','mydiplomas') == 'true')
if (api_get_setting('extended_profile') == 'true' & & api_get_setting('extendedprofile_registration','mydiplomas') == 'true') {
{
$form->add_html_editor('diplomas', get_lang('MyDiplomas'), false, false, array('ToolbarSet' => 'Profile', 'Width' => '100%', 'Height' => '130'));
$form->add_html_editor('diplomas', get_lang('MyDiplomas'), false, false, array('ToolbarSet' => 'Profile', 'Width' => '100%', 'Height' => '130'));
}
}
if (api_get_setting('extended_profile') == 'true' AND api_get_setting('extendedprofile_registration','myteach') == 'true')
if (api_get_setting('extended_profile') == 'true' & & api_get_setting('extendedprofile_registration','myteach') == 'true') {
{
$form->add_html_editor('teach', get_lang('MyTeach'), false, false, array('ToolbarSet' => 'Profile', 'Width' => '100%', 'Height' => '130'));
$form->add_html_editor('teach', get_lang('MyTeach'), false, false, array('ToolbarSet' => 'Profile', 'Width' => '100%', 'Height' => '130'));
}
}
if (api_get_setting('extended_profile') == 'true' AND api_get_setting('extendedprofile_registration','mypersonalopenarea') == 'true')
if (api_get_setting('extended_profile') == 'true' & & api_get_setting('extendedprofile_registration','mypersonalopenarea') == 'true') {
{
$form->add_html_editor('openarea', get_lang('MyPersonalOpenArea'), false, false, array('ToolbarSet' => 'Profile', 'Width' => '100%', 'Height' => '130'));
$form->add_html_editor('openarea', get_lang('MyPersonalOpenArea'), false, false, array('ToolbarSet' => 'Profile', 'Width' => '100%', 'Height' => '130'));
}
}
if (api_get_setting('extended_profile') == 'true')
if (api_get_setting('extended_profile') == 'true') {
{
if (api_get_setting('extendedprofile_registrationrequired', 'mycomptetences') == 'true') {
if (api_get_setting('extendedprofile_registrationrequired','mycomptetences') == 'true')
{
$form->addRule('competences', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('competences', get_lang('ThisFieldIsRequired'), 'required');
}
}
if (api_get_setting('extendedprofile_registrationrequired','mydiplomas') == 'true')
if (api_get_setting('extendedprofile_registrationrequired', 'mydiplomas') == 'true') {
{
$form->addRule('diplomas', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('diplomas', get_lang('ThisFieldIsRequired'), 'required');
}
}
if (api_get_setting('extendedprofile_registrationrequired','myteach') == 'true')
if (api_get_setting('extendedprofile_registrationrequired', 'myteach') == 'true') {
{
$form->addRule('teach', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('teach', get_lang('ThisFieldIsRequired'), 'required');
}
}
if (api_get_setting('extendedprofile_registrationrequired','mypersonalopenarea') == 'true')
if (api_get_setting('extendedprofile_registrationrequired', 'mypersonalopenarea') == 'true') {
{
$form->addRule('openarea', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('openarea', get_lang('ThisFieldIsRequired'), 'required');
}
}
}
}
// EXTRA FIELDS
// EXTRA FIELDS
$extra = UserManager::get_extra_fields(0, 50, 5, 'ASC');
$extra = UserManager::get_extra_fields(0, 50, 5, 'ASC');
$extra_data = UserManager::get_extra_user_data(api_get_user_id(), true);
$extra_data = UserManager::get_extra_user_data(api_get_user_id(), true);
@ -378,20 +371,20 @@ foreach ($extra as $id => $field_details) {
}
}
}
}
//------------ Terms and conditions
// Terms and conditions
if (get_setting('allow_terms_conditions') == 'true') {
if (get_setting('allow_terms_conditions') == 'true') {
//$language = api_get_setting('platformLanguage');
$language = api_get_interface_language();
$language = api_get_interface_language();
$language = api_get_language_id($language);
$language = api_get_language_id($language);
$term_preview = LegalManager::get_last_condition($language);
$term_preview = LegalManager::get_last_condition($language);
if ($term_preview==false ) {
if (! $term_preview) {
//we load from the platform
//we load from the platform
$language = api_get_setting('platformLanguage');
$language = api_get_setting('platformLanguage');
$language = api_get_language_id($language);
$language = api_get_language_id($language);
$term_preview = LegalManager::get_last_condition($language);
$term_preview = LegalManager::get_last_condition($language);
//if is false we load from english
//if is false we load from english
if ($term_preview==false ){
if (! $term_preview) {
$language = api_get_language_id('english'); //this must work
$language = api_get_language_id('english'); //this must work
$term_preview = LegalManager::get_last_condition($language);
$term_preview = LegalManager::get_last_condition($language);
}
}
@ -422,33 +415,33 @@ if (get_setting('allow_terms_conditions')=='true') {
}
}
$form->addElement('style_submit_button', 'submit', get_lang('RegisterUser'), array('class' => 'save', 'disabled' => 'disabled'));
$form->addElement('style_submit_button', 'submit', get_lang('RegisterUser'), array('class' => 'save', 'disabled' => 'disabled'));
$defaults['status'] = STUDENT;
$defaults['status'] = STUDENT;
$form->setDefaults($defaults);
if(isset($_SESSION["user_language_choice"]) & & $_SESSION["user_language_choice"]!=""){
if (isset($_SESSION['user_language_choice']) & & $_SESSION['user_language_choice'] != '') {
$defaults['language'] = $_SESSION["user_language_choice"];
$defaults['language'] = $_SESSION['user_language_choice'];
}
} else {
else{
$defaults['language'] = api_get_setting('platformLanguage');
$defaults['language'] = api_get_setting('platformLanguage');
}
}
if(!empty($_GET['username']))
{
if (!empty($_GET['username'])) {
$defaults['username'] = Security::remove_XSS($_GET['username']);
$defaults['username'] = Security::remove_XSS($_GET['username']);
}
}
if(!empty($_GET['email']))
{
if (!empty($_GET['email'])) {
$defaults['email'] = Security::remove_XSS($_GET['email']);
$defaults['email'] = Security::remove_XSS($_GET['email']);
}
}
if(!empty($_GET['phone']))
if (!empty($_GET['phone'])) {
{
$defaults['phone'] = Security::remove_XSS($_GET['phone']);
$defaults['phone'] = Security::remove_XSS($_GET['phone']);
}
}
if (api_get_setting('openid_authentication')=='true' & & !empty($_GET['openid']))
if (api_get_setting('openid_authentication') == 'true' & & !empty($_GET['openid'])) {
{
$defaults['openid'] = Security::remove_XSS($_GET['openid']);
$defaults['openid'] = Security::remove_XSS($_GET['openid']);
}
}
$form->setDefaults($defaults);
switch ($action){
switch ($action){
case 'edit_top':
case 'edit_top':
if ($action == 'edit_top') {
if ($action == 'edit_top') {
@ -456,16 +449,16 @@ switch($action){
$open = $home_top;
$open = $home_top;
} else {
} else {
$name = $newsf;
$name = $newsf;
$open=@file_get_contents($homep.$newsf.'_'.$lang.$ext);
$open = @(string) file_get_contents($homep.$newsf.'_'.$lang.$ext);
$open = api_to_system_encoding($open, api_detect_encoding(strip_tags($open)));
}
}
if (!empty($errorMsg)) {
if (!empty($errorMsg)) {
Display::display_normal_message($errorMsg); //main API
Display::display_normal_message($errorMsg);
}
}
$default = array();
$default = array();
$form = new FormValidator('configure_homepage _'.$action, 'post', api_get_self().'?action='.$action, '', array('style' => 'margin: 0px;'));
$form = new FormValidator('configure_inscription _'.$action, 'post', api_get_self().'?action='.$action, '', array('style' => 'margin: 0px;'));
$renderer =& $form->defaultRenderer();
$renderer =& $form->defaultRenderer();
$renderer->setHeaderTemplate('');
$renderer->setHeaderTemplate('');
$renderer->setFormTemplate('< form { attributes } > < table border = "0" cellpadding = "5" cellspacing = "0" width = "100%" > {content}< / table > < / form > ');
$renderer->setFormTemplate('< form { attributes } > < table border = "0" cellpadding = "5" cellspacing = "0" width = "100%" > {content}< / table > < / form > ');
@ -488,30 +481,22 @@ switch($action){
$form->display();
$form->display();
break;
break;
default:
default:
/*******************************/
//Form of language
//Form of language
api_display_language_form();
api_display_language_form();
echo ' < a href = "'.api_get_self().'?action=edit_top" > '.Display::display_icon('edit.gif', get_lang('Edit')).'< / a > < a href = "'.api_get_self().'?action=edit_top" > '.get_lang('EditNotice').'< / a > ';
echo ' < a href = "'.api_get_self().'?action=edit_top" > '.Display::display_icon('edit.gif', get_lang('Edit')).'< / a > < a href = "'.api_get_self().'?action=edit_top" > '.get_lang('EditNotice').'< / a > ';
echo '< div class = "note" > ';
//echo '< div class = "note" > ';
$home_notice = '';
echo '< div style = "border:1px solid #E1E1E1; padding:2px;" > ';
$open = '';
if (file_exists($homep.$topf.'_'.$lang.$ext)) {
if (file_exists($homep.$topf.'_'.$lang.$ext)) {
$home_notice = @ file_get_contents($homep.$topf.'_'.$lang.$ext);
$open = @(string) file_get_contents($homep.$topf.'_'.$lang.$ext);
} else {
} else {
$home_notice = @ file_get_contents($homep.$topf.$ext);
$open = @(string) file_get_contents($homep.$topf.$ext);
}
}
echo $home_notice;
$open = api_to_system_encoding($open, api_detect_encoding(strip_tags($open)));
echo $open;
echo '< / div > ';
echo '< / div > ';
/*******************************/
$form->display();
$form->display();
break;
break;
}
}
/*
==============================================================================
FOOTER
==============================================================================
*/
Display :: display_footer();
Display :: display_footer();
?>