diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2011-09-04 21:13:47 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2011-09-04 21:13:47 -0400 |
commit | ad4a7ff9159c2c64cea98d7189f46fa7d6174fc2 (patch) | |
tree | 508f971f1dbc6c6f01207426c675542b55e0333e /src/views/pages/users/individual.html.php | |
parent | f3b3ea69fb46e45bf3598aa7a6bcf62aa80e4703 (diff) |
Screw it, I'm tired of trying to break this into individual commits
Diffstat (limited to 'src/views/pages/users/individual.html.php')
-rw-r--r-- | src/views/pages/users/individual.html.php | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/src/views/pages/users/individual.html.php b/src/views/pages/users/individual.html.php index 4d6e4fc..9e3048a 100644 --- a/src/views/pages/users/individual.html.php +++ b/src/views/pages/users/individual.html.php @@ -8,6 +8,12 @@ function inputText($user, $key, $label, $hint='') { $t->inputText("user_$key", $label, $hint, $current_setting, !$user->canEdit()); } +function inputTextarea($user, $key, $label, $hint='') { + global $VARS; $t = $VARS['template']; + $current_setting = $user->getConf($key); + $t->inputTextarea("user_$key", $label, $hint, $current_setting, + !$user->canEdit()); +} function inputArray($user, $key, $arr) { global $VARS; $t = $VARS['template']; @@ -19,12 +25,27 @@ function inputArray($user, $key, $arr) { } } +function inputField($user, $arr) { + $fieldname = $arr[0]; + $fieldlabel = $arr[1]; + $fieldtype = $arr[2]; + + switch ($fieldtype) { + case 'text': + inputText($user, $fieldname, $fieldlabel, ''); + break; + case 'textarea': + inputTextarea($user, $fieldname, $fieldlabel, ''); + break; + } +} //////////////////////////////////////////////////////////////////////////////// +$username = $user->getName(); $t->header("Users: $username"); -$t->tag('h1', array(), ($user->canEdit()?'Edit':'View')." User (UID: $uid)"); +$t->tag('h1', array(), ($user->canEdit()?'Edit':'View')." User <q>$username</q> (UID: ".$user->getUID().")"); if ($user->canEdit()) { $t->openTag('form', array('method'=>'post', @@ -53,17 +74,26 @@ if (@$VARS['pw_updated']===true) { if (@$VARS['pw mixmatch']===true) { $t->inputP("Passwords don't match.", true); } -if ($user->canEdit()) inputNewPassword($user, 'auth_password','Reset Password'); +if ($user->canEdit()) $t->inputNewPassword('auth_password','Reset Password'); //////////////////////////////////////////////////////////////////////////////// $t->closeFieldset(); +/* $t->openFieldset("Information"); inputText($user, 'firstname','First Name',''); inputText($user, 'lastname','Last Name',''); inputText($user, 'hsclass','Highschool Class of', 'Please put the full year (ex: 2012)'); $t->closeFieldset(); +*/ +foreach ($VARS['config_options'] as $groupname=>$options) { + $t->openFieldset($groupname); + foreach ($options as $option) { + inputField($user, $option); + } + $t->closeFieldset(); +} $t->openFieldset("Contact"); // TODO: I should make this a setting for admins to set. @@ -80,9 +110,9 @@ $use_arr = array(); foreach ($CONTACT_METHODS as $method) { inputText($user, $method->addr_slug, - ucwords($method->addr_word), + ucwords($method->addr_text), $hints[$method->addr_slug]); - $use_arr[$method->verb_slug] = ucwords($method->verb_word); + $use_arr[$method->verb_slug] = ucwords($method->verb_text); } $t->inputP("When I recieve a message, notify me using the following methods:"); |