Feld laesst sich jetzt auch als optional definieren.
\r
$user_fields['beruf']['min'] = 5;\r
$user_fields['beruf']['max'] = 50;\r
\r
$user_fields['beruf']['min'] = 5;\r
$user_fields['beruf']['max'] = 50;\r
-$user_fields['beruf']['optional'] = 0;\r
-$user_fields['beruf']['regex'] = '/^[A-Za-z]$/';\r
+$user_fields['beruf']['optional'] = 1;\r
+$user_fields['beruf']['regex'] = '/^[A-Za-z]+$/';\r
$user_fields['beruf']['check'] = 'check_beruf';\r
$user_fields['beruf']['tpl_var'] = 'BERUF';\r
\r
$user_fields['beruf']['check'] = 'check_beruf';\r
$user_fields['beruf']['tpl_var'] = 'BERUF';\r
\r
\r
while(list($user_field,$user_field_data) = each($user_fields)) {\r
$user_field_content = formdata($user_field);\r
\r
while(list($user_field,$user_field_data) = each($user_fields)) {\r
$user_field_content = formdata($user_field);\r
+ \r
+ if((!$user_field_data['optional']) && (!$user_field_content)) {\r
+ show_user_error($user_field_data['errors']['not_set']);\r
+ }\r
+ elseif($user_field_data['optional'] && (!$user_field_content)) {\r
+ $prepared_user_fields[$user_field_data['tpl_var']] = '';\r
+ continue;\r
+ }\r
\r
if(isset($user_field_data['check']) && $user_field_data['check'] != '') {\r
if(function_exists($user_field_data['check']) && call_user_func($user_field_data['check'],$user_field_content) === false) {\r
\r
if(isset($user_field_data['check']) && $user_field_data['check'] != '') {\r
if(function_exists($user_field_data['check']) && call_user_func($user_field_data['check'],$user_field_content) === false) {\r