$field[1] | ";
- $output .= "". form_checkbox("", "profile_public_fields][", $key, in_array($key, $profile_public_fields)) ." | ";
$output .= "". form_checkbox("", "profile_private_fields][", $key, in_array($key, $profile_private_fields)) ." | ";
+ $output .= "". form_checkbox("", "profile_public_fields][", $key, in_array($key, $profile_public_fields)) ." | ";
$output .= "". form_checkbox("", "profile_required_fields][", $key, in_array($key, $profile_required_fields)) ." | ";
$output .= "". form_checkbox("", "profile_register_fields][", $key, in_array($key, $profile_register_fields)) ." | ";
$output .= "
\n";
@@ -135,15 +135,16 @@ function _profile_form($edit, $mode) {
}
function _profile_validate($edit, $mode) {
+
global $profile_fields, $user, $HTTP_POST_VARS;
- $req_fields = _profile_active_fields($mode);
+ $enabled_fields = _profile_active_fields($mode);
- if (in_array("birthday", $req_fields) && ($birth_error = _profile_validate_birth($edit))) {
+ if (in_array("birthday", $enabled_fields) && ($birth_error = _profile_validate_birth($edit))) {
$error .= $birth_error."\n";
- $output .= "field | public | private | required | show in registration form |
\n";
+ $output .= "field | enable | public | required | show in registration form |
\n";
foreach ($profile_fields as $key => $field) {
$output .= "$field[1] | ";
- $output .= "". form_checkbox("", "profile_public_fields][", $key, in_array($key, $profile_public_fields)) ." | ";
$output .= "". form_checkbox("", "profile_private_fields][", $key, in_array($key, $profile_private_fields)) ." | ";
+ $output .= "". form_checkbox("", "profile_public_fields][", $key, in_array($key, $profile_public_fields)) ." | ";
$output .= "". form_checkbox("", "profile_required_fields][", $key, in_array($key, $profile_required_fields)) ." | ";
$output .= "". form_checkbox("", "profile_register_fields][", $key, in_array($key, $profile_register_fields)) ." | ";
$output .= "
\n";
@@ -135,15 +135,16 @@ function _profile_form($edit, $mode) {
}
function _profile_validate($edit, $mode) {
+
global $profile_fields, $user, $HTTP_POST_VARS;
- $req_fields = _profile_active_fields($mode);
+ $enabled_fields = _profile_active_fields($mode);
- if (in_array("birthday", $req_fields) && ($birth_error = _profile_validate_birth($edit))) {
+ if (in_array("birthday", $enabled_fields) && ($birth_error = _profile_validate_birth($edit))) {
$error .= $birth_error."
";
}
- if (in_array("avatar", $req_fields) && ($avatar_error = _profile_validate_avatar($edit))) {
+ if (in_array("avatar", $enabled_fields) && ($avatar_error = _profile_validate_avatar($edit))) {
$error .= $avatar_error."
";
}
@@ -156,7 +157,7 @@ function _profile_validate($edit, $mode) {
// now check for required fields
foreach(_profile_active_fields("required") as $required) {
- if (in_array($required, $req_fields)) {
+ if (in_array($required, $enabled_fields)) {
if (!$edit["profile_".$required]) {
$error .= t("This required field is missing: %a", array("%a" => $profile_fields[$required][1]))."
";
}