function change_image_user_field (image_value) {
if (image_value==1) {
document.getElementById(\'options\').style.display = \'none\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\' '.get_lang('AdvancedParameters').'\';
$("div#id_image_user_field").html(" ");
$("div#id_image_user_field").html('."'
".Display::return_icon('userfield_text.png', get_lang('AddUserFields'))."'".');
} else if (image_value==2) {
document.getElementById(\'options\').style.display = \'none\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\' '.get_lang('AdvancedParameters').'\';
$("div#id_image_user_field").html(" ");
$("div#id_image_user_field").html('."'
".Display::return_icon('userfield_text_area.png', get_lang('AddUserFields'))."'".');
} else if (image_value==3) {
document.getElementById(\'options\').style.display = \'block\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\' '.get_lang('AdvancedParameters').'\';
$("div#id_image_user_field").html(" ");
$("div#id_image_user_field").html('."'
".Display::return_icon('add_user_field_howto.png', get_lang('AddUserFields'))."'".');
} else if (image_value==4) {
document.getElementById(\'options\').style.display = \'block\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\' '.get_lang('AdvancedParameters').'\';
$("div#id_image_user_field").html(" ");
$("div#id_image_user_field").html('."'
".Display::return_icon('userfield_drop_down.png', get_lang('AddUserFields'))."'".');
} else if (image_value==5) {
document.getElementById(\'options\').style.display = \'block\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\' '.get_lang('AdvancedParameters').'\';
$("div#id_image_user_field").html(" ");
$("div#id_image_user_field").html('."'
".Display::return_icon('userfield_multidropdown.png', get_lang('AddUserFields'))."'".');
} else if (image_value==6) {
document.getElementById(\'options\').style.display = \'none\';
$("div#id_image_user_field").html(" ");
$("div#id_image_user_field").html('."'
".Display::return_icon('userfield_data.png', get_lang('AddUserFields'))."'".');
} else if (image_value==7) {
document.getElementById(\'options\').style.display = \'none\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\' '.get_lang('AdvancedParameters').'\';
$("div#id_image_user_field").html(" ");
$("div#id_image_user_field").html('."'
".Display::return_icon('userfield_date_time.png', get_lang('AddUserFields'))."'".');
} else if (image_value==8) {
document.getElementById(\'options\').style.display = \'block\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\' '.get_lang('AdvancedParameters').'\';
$("div#id_image_user_field").html(" ");
$("div#id_image_user_field").html('."'
".Display::return_icon('userfield_doubleselect.png', get_lang('AddUserFields'))."'".');
} else if (image_value==9) {
document.getElementById(\'options\').style.display = \'none\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\' '.get_lang('AdvancedParameters').'\';
$("div#id_image_user_field").html(" ");
$("div#id_image_user_field").html('."'
".Display::return_icon('userfield_divider.png', get_lang('AddUserFields'))."'".');
} else if (image_value==10) {
document.getElementById(\'options\').style.display = \'none\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\' '.get_lang('AdvancedParameters').'\';
$("div#id_image_user_field").html(" ");
$("div#id_image_user_field").html('."'
".Display::return_icon('userfield_user_tag.png', get_lang('UserTag'))."'".');
}
}
function advanced_parameters() {
if(document.getElementById(\'options\').style.display == \'none\') {
document.getElementById(\'options\').style.display = \'block\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\' '.get_lang('AdvancedParameters').'\';
} else {
document.getElementById(\'options\').style.display = \'none\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\' '.get_lang('AdvancedParameters').'\';
}
}
';
// Database table definitions
$table_admin = Database :: get_main_table(TABLE_MAIN_ADMIN);
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$table_uf = Database :: get_main_table(TABLE_MAIN_USER_FIELD);
$table_uf_opt = Database :: get_main_table(TABLE_MAIN_USER_FIELD_OPTIONS);
$table_uf_val = Database :: get_main_table(TABLE_MAIN_USER_FIELD_VALUES);
$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array ('url' => 'user_fields.php', 'name' => get_lang('UserFields'));
if ($_GET['action']<>'edit')
{
$tool_name = get_lang('AddUserFields');
}
else
{
$tool_name = get_lang('EditUserFields');
}
// Create the form
$form = new FormValidator('user_fields_add');
$form->addElement('header', '', $tool_name);
// Field display name
$form->addElement('text','fieldtitle',get_lang('FieldTitle'));
$form->applyFilter('fieldtitle','html_filter');
$form->applyFilter('fieldtitle','trim');
$form->addRule('fieldtitle', get_lang('ThisFieldIsRequired'), 'required');
// Field type
$types = array();
$types[USER_FIELD_TYPE_TEXT] = get_lang('FieldTypeText');
$types[USER_FIELD_TYPE_TEXTAREA] = get_lang('FieldTypeTextarea');
$types[USER_FIELD_TYPE_RADIO] = get_lang('FieldTypeRadio');
$types[USER_FIELD_TYPE_SELECT] = get_lang('FieldTypeSelect');
$types[USER_FIELD_TYPE_SELECT_MULTIPLE] = get_lang('FieldTypeSelectMultiple');
$types[USER_FIELD_TYPE_DATE] = get_lang('FieldTypeDate');
$types[USER_FIELD_TYPE_DATETIME] = get_lang('FieldTypeDatetime');
$types[USER_FIELD_TYPE_DOUBLE_SELECT] = get_lang('FieldTypeDoubleSelect');
$types[USER_FIELD_TYPE_DIVIDER] = get_lang('FieldTypeDivider');
$types[USER_FIELD_TYPE_TAG] = get_lang('FieldTypeTag');
$types[USER_FIELD_TYPE_TIMEZONE] = get_lang('FieldTypeTimezone');
$types[USER_FIELD_TYPE_SOCIAL_PROFILE] = get_lang('FieldTypeSocialProfile');
$form->addElement('select','fieldtype',get_lang('FieldType'),$types,array('onchange'=>'change_image_user_field(this.value)'));
$form->addRule('fieldtype', get_lang('ThisFieldIsRequired'), 'required');
//Advanced parameters
$form -> addElement('html','