summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornatrak <>2001-06-18 20:51:57 +0000
committernatrak <>2001-06-18 20:51:57 +0000
commit542b60a19a3c95df99c6a14493bbc0bf167ae886 (patch)
tree907f4ce3f8c2258513fae09c80bf61f6d44c0920
parent6e64691450be0ec2a77fa7c6da74d67f4376db62 (diff)
downloadbrdo-542b60a19a3c95df99c6a14493bbc0bf167ae886.tar.gz
brdo-542b60a19a3c95df99c6a14493bbc0bf167ae886.tar.bz2
Changes
- Modifed form_select() to accept an optional 6th parameter which is appeneded to the select tag. $value can now also be an array. This allows for multiple selects: form_select($header, $name, $values, $options, $help, "multiple=\"true\" size=\"10\""); - Updated account.module to use the extended form_select() functionality.
-rw-r--r--modules/account.module10
1 files changed, 8 insertions, 2 deletions
diff --git a/modules/account.module b/modules/account.module
index 560d706f0..de547a674 100644
--- a/modules/account.module
+++ b/modules/account.module
@@ -147,14 +147,20 @@ function account_form($account = 0) {
function access($name) {
global $access, $account;
- if (module_hook($name, "admin")) $access .= "<OPTION VALUE=\"$name\"". (user_access($account, $name) ? " SELECTED" : "") .">$name</OPTION>";
+ if (module_hook($name, "admin")) $access[$name] = $name;
}
module_iterate("access");
+ $account->access = explode(",", $account->access);
+ foreach ($account->access as $key=>$value) {
+ $account->access[$key] = substr($value, 0, -2);
+ }
+
$form .= $account->id ? form_item("ID", $account->id) . form_hidden("id", $account->id) : "";
$form .= $account->userid ? form_item(t("Username"), check_output($account->userid)) . form_hidden("userid", $account->userid) : form_textfield(t("Username"), "userid", $account->userid, 15, 15);
$form .= form_select(t("Status"), "status", ($account->status ? $account->status : 1), array("blocked", "not confirmed", "open"));
- $form .= form_item(t("Administrator access"), "<SELECT NAME=\"edit[access][]\" MULTIPLE=\"true\" SIZE=\"10\">$access</SELECT>");
+ $form .= form_select(t("Administrator access"), "access", $account->access, $access, 0, "multiple=\"true\" size=\"10\"");
+// $form .= form_item(t("Administrator access"), "<SELECT NAME=\"edit[access][]\" MULTIPLE=\"true\" SIZE=\"10\">$access</SELECT>");
$form .= form_textfield(t("Real name"), "name", $account->name, 30, 55);
$form .= form_textfield(t("Real e-mail address"), "real_email", $account->real_email, 30, 55);
$form .= form_textfield(t("Fake e-mail address"), "fake_email", $account->fake_email, 30, 55);