summaryrefslogtreecommitdiff
path: root/src/views/pages/users/individual.html.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/views/pages/users/individual.html.php')
-rw-r--r--src/views/pages/users/individual.html.php38
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:");