From a118acc21c7327ef0579336b1eb3e30ac3880ce0 Mon Sep 17 00:00:00 2001 From: james Date: Fri, 15 Feb 2008 23:08:33 +0000 Subject: [PATCH] Add the missing 'Gender' field to the user personal profile page, as well as save it :) --- user.inc.php | 3 +-- user_personal.php | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/user.inc.php b/user.inc.php index ef726f6..8f1cde8 100644 --- a/user.inc.php +++ b/user.inc.php @@ -219,7 +219,7 @@ function user_save($u) $fields = array('firstname','lastname','username','password', 'email', 'phonehome','phonework','phonecell','fax','organization', - 'address','address2','city','province','postalcode'); + 'address','address2','city','province','postalcode',"sex"); $set = ""; foreach($fields as $f) { @@ -497,7 +497,6 @@ function user_personal_required_fields($type) * - address2 */ $ret = array_diff($ret, array('address2')); - return $ret; } diff --git a/user_personal.php b/user_personal.php index 18c6619..229ac22 100644 --- a/user_personal.php +++ b/user_personal.php @@ -44,6 +44,7 @@ 'city' => array('name' => 'City'), 'province' => array('name' => 'Province'), 'organization' => array('name' => 'Organization'), + 'sex' => array('name' => 'Gender'), 'phonehome' => array('name' => 'Phone (Home)', 'regexp' => '^[1-9][0-9]{2}-[1-9][0-9]{2}-[0-9]{4}( x[0-9]{1,5})?$', 'format' => '\'NNN-NNN-NNNN\' or \'NNN-NNN-NNNN xEXT\'',), @@ -285,7 +286,21 @@ item($u, 'phonework'); echo ""; echo "\n"; item($u, 'fax'); -echo ''; + if(in_array('sex', $fields)) { + echo ''.i18n('Gender').': '; + echo ''; + echo ""; + if(in_array('sex', $required)) echo REQUIREDFIELD; + echo ''; + } else { + echo ''; + } echo ""; echo "
";