phpBB

Code Changes

File: includes/acp/acp_profile.php

  Unmodified   Added   Modified   Removed
Line 363Line 363
					}

$field_row = array_merge($default_values[$field_type], array(

					}

$field_row = array_merge($default_values[$field_type], array(

						'field_ident'		=> utf8_clean_string(request_var('field_ident', '', true)),

						'field_ident'		=> str_replace(' ', '_', utf8_clean_string(request_var('field_ident', '', true))),

						'field_required'	=> 0,

						'field_required'	=> 0,

 
						'field_show_novalue'=> 0,

						'field_hide'		=> 0,

						'field_hide'		=> 0,

 
						'field_show_profile'=> 0,

						'field_no_view'		=> 0,
'field_show_on_reg' => 0,

						'field_no_view'		=> 0,
'field_show_on_reg' => 0,

 
						'field_show_on_vt'	=> 0,

						'lang_name'			=> utf8_normalize_nfc(request_var('field_ident', '', true)),
'lang_explain' => '',
'lang_default_value'=> '')

						'lang_name'			=> utf8_normalize_nfc(request_var('field_ident', '', true)),
'lang_explain' => '',
'lang_default_value'=> '')

Line 378Line 381

// $exclude contains the data we gather in each step
$exclude = array(


// $exclude contains the data we gather in each step
$exclude = array(

					1	=> array('field_ident', 'lang_name', 'lang_explain', 'field_option', 'field_no_view'),

					1	=> array('field_ident', 'lang_name', 'lang_explain', 'field_option_none', 'field_show_on_reg', 'field_show_on_vt', 'field_required', 'field_show_novalue', 'field_hide', 'field_show_profile', 'field_no_view'),

					2	=> array('field_length', 'field_maxlen', 'field_minlen', 'field_validation', 'field_novalue', 'field_default_value'),
3 => array('l_lang_name', 'l_lang_explain', 'l_lang_default_value', 'l_lang_options')
);

					2	=> array('field_length', 'field_maxlen', 'field_minlen', 'field_validation', 'field_novalue', 'field_default_value'),
3 => array('l_lang_name', 'l_lang_explain', 'l_lang_default_value', 'l_lang_options')
);

Line 400Line 403
				$cp->vars['lang_explain']		= utf8_normalize_nfc(request_var('lang_explain', $field_row['lang_explain'], true));
$cp->vars['lang_default_value'] = utf8_normalize_nfc(request_var('lang_default_value', $field_row['lang_default_value'], true));


				$cp->vars['lang_explain']		= utf8_normalize_nfc(request_var('lang_explain', $field_row['lang_explain'], true));
$cp->vars['lang_default_value'] = utf8_normalize_nfc(request_var('lang_default_value', $field_row['lang_default_value'], true));


				// Field option...
if (isset($_REQUEST['field_option']))
{
$field_option = request_var('field_option', '');






				// Visibility Options...
$visibility_ary = array(
'field_required',
'field_show_novalue',
'field_show_on_reg',
'field_show_on_vt',
'field_show_profile',
'field_hide',
);





					$cp->vars['field_required'] = ($field_option == 'field_required') ? 1 : 0;
$cp->vars['field_show_on_reg'] = ($field_option == 'field_show_on_reg') ? 1 : 0;
$cp->vars['field_hide'] = ($field_option == 'field_hide') ? 1 : 0;
}
else

				foreach ($visibility_ary as $val)





				{

				{

					$cp->vars['field_required'] = $field_row['field_required'];
$cp->vars['field_show_on_reg'] = $field_row['field_show_on_reg'];
$cp->vars['field_hide'] = $field_row['field_hide'];

$field_option = ($field_row['field_required']) ? 'field_required' : (($field_row['field_show_on_reg']) ? 'field_show_on_reg' : (($field_row['field_hide']) ? 'field_hide' : ''));

					$cp->vars[$val] = ($submit || $save) ? request_var($val, 0) : $field_row[$val];





				}


				}


				$cp->vars['field_no_view'] = request_var('field_no_view', $field_row['field_no_view']);

				$cp->vars['field_no_view'] = request_var('field_no_view', (int) $field_row['field_no_view']);


// A boolean field expects an array as the lang options
if ($field_type == FIELD_BOOL)


// A boolean field expects an array as the lang options
if ($field_type == FIELD_BOOL)

Line 506Line 506
							}
}
}

							}
}
}

					/* else if ($field_type == FIELD_BOOL && $key == 'field_default_value')

					else if ($field_type == FIELD_BOOL && $key == 'field_default_value')

					{

					{

						// Get the number of options if this key is 'field_maxlen'
$var = request_var('field_default_value', 0);
}*/
































						// 'field_length' == 1 defines radio buttons. Possible values are 1 or 2 only.
// 'field_length' == 2 defines checkbox. Possible values are 0 or 1 only.
// If we switch the type on step 2, we have to adjust field value.
// 1 is a common value for the checkbox and radio buttons.

// Adjust unchecked checkbox value.
// If we return or save settings from 2nd/3rd page
// and the checkbox is unchecked, set the value to 0.
if (isset($_REQUEST['step']) && !isset($_REQUEST[$key]))
{
$var = 0;
}

// If we switch to the checkbox type but former radio buttons value was 2,
// which is not the case for the checkbox, set it to 0 (unchecked).
if ($cp->vars['field_length'] == 2 && $var == 2)
{
$var = 0;
}
// If we switch to the radio buttons but the former checkbox value was 0,
// which is not the case for the radio buttons, set it to 0.
else if ($cp->vars['field_length'] == 1 && $var == 0)
{
$var = 2;
}
}
else if ($field_type == FIELD_INT && $key == 'field_default_value')
{
// Permit an empty string
if ($action == 'create' && request_var('field_default_value', '') === '')
{
$var = '';
}
}


$cp->vars[$key] = $var;
}


$cp->vars[$key] = $var;
}

Line 669Line 700
						else if ($field_type == FIELD_BOOL && $key == 'l_lang_options' && isset($_REQUEST['l_lang_options']))
{
$_new_key_ary[$key] = utf8_normalize_nfc(request_var($key, array(array('')), true));

						else if ($field_type == FIELD_BOOL && $key == 'l_lang_options' && isset($_REQUEST['l_lang_options']))
{
$_new_key_ary[$key] = utf8_normalize_nfc(request_var($key, array(array('')), true));

 
						}
else if ($field_type == FIELD_BOOL && $key == 'field_default_value')
{
$_new_key_ary[$key] = request_var($key, $cp->vars[$key]);

						}
else
{

						}
else
{

Line 724Line 759
						$template->assign_vars(array(
'S_STEP_ONE' => true,
'S_FIELD_REQUIRED' => ($cp->vars['field_required']) ? true : false,

						$template->assign_vars(array(
'S_STEP_ONE' => true,
'S_FIELD_REQUIRED' => ($cp->vars['field_required']) ? true : false,

 
							'S_FIELD_SHOW_NOVALUE'=> ($cp->vars['field_show_novalue']) ? true : false,

							'S_SHOW_ON_REG'		=> ($cp->vars['field_show_on_reg']) ? true : false,

							'S_SHOW_ON_REG'		=> ($cp->vars['field_show_on_reg']) ? true : false,

 
							'S_SHOW_ON_VT'		=> ($cp->vars['field_show_on_vt']) ? true : false,

							'S_FIELD_HIDE'		=> ($cp->vars['field_hide']) ? true : false,

							'S_FIELD_HIDE'		=> ($cp->vars['field_hide']) ? true : false,

 
							'S_SHOW_PROFILE'	=> ($cp->vars['field_show_profile']) ? true : false,

							'S_FIELD_NO_VIEW'	=> ($cp->vars['field_no_view']) ? true : false,

'L_LANG_SPECIFIC' => sprintf($user->lang['LANG_SPECIFIC_OPTIONS'], $config['default_lang']),

							'S_FIELD_NO_VIEW'	=> ($cp->vars['field_no_view']) ? true : false,

'L_LANG_SPECIFIC' => sprintf($user->lang['LANG_SPECIFIC_OPTIONS'], $config['default_lang']),

Line 925Line 963
			
case FIELD_TEXT:
case FIELD_STRING:

			
case FIELD_TEXT:
case FIELD_STRING:

				if ($cp->vars['lang_default_value'])

				if (strlen($cp->vars['lang_default_value']))

				{
$options['lang_default_value'] = ($field_type == FIELD_STRING) ? 'string' : 'text';
}

				{
$options['lang_default_value'] = ($field_type == FIELD_STRING) ? 'string' : 'text';
}

Line 1038Line 1076
			'field_default_value'	=> $cp->vars['field_default_value'],
'field_validation' => $cp->vars['field_validation'],
'field_required' => $cp->vars['field_required'],

			'field_default_value'	=> $cp->vars['field_default_value'],
'field_validation' => $cp->vars['field_validation'],
'field_required' => $cp->vars['field_required'],

 
			'field_show_novalue'	=> $cp->vars['field_show_novalue'],

			'field_show_on_reg'		=> $cp->vars['field_show_on_reg'],

			'field_show_on_reg'		=> $cp->vars['field_show_on_reg'],

 
			'field_show_on_vt'		=> $cp->vars['field_show_on_vt'],

			'field_hide'			=> $cp->vars['field_hide'],

			'field_hide'			=> $cp->vars['field_hide'],

 
			'field_show_profile'	=> $cp->vars['field_show_profile'],

			'field_no_view'			=> $cp->vars['field_no_view']
);


			'field_no_view'			=> $cp->vars['field_no_view']
);


Line 1470Line 1511

case 'mssql':
case 'mssql_odbc':


case 'mssql':
case 'mssql_odbc':

 
			case 'mssqlnative':


// We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
$sql = 'ALTER TABLE [' . PROFILE_FIELDS_DATA_TABLE . "] ADD [$field_ident] ";


// We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
$sql = 'ALTER TABLE [' . PROFILE_FIELDS_DATA_TABLE . "] ADD [$field_ident] ";

Line 1541Line 1583
			case 'firebird':

// We are defining the biggest common value, because of the possibility to edit the min/max values of each field.

			case 'firebird':

// We are defining the biggest common value, because of the possibility to edit the min/max values of each field.

				$sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD \"$field_ident\" ";

				$sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . ' ADD "' . strtoupper($field_ident) . '" ';


switch ($field_type)
{


switch ($field_type)
{

Line 1613Line 1655
}

?>

}

?>