summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/form.inc10
-rw-r--r--modules/system.module11
-rw-r--r--modules/system/system.module11
-rw-r--r--modules/user.module4
-rw-r--r--modules/user/user.module4
5 files changed, 18 insertions, 22 deletions
diff --git a/includes/form.inc b/includes/form.inc
index 42240001c..fa7e56368 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -651,7 +651,7 @@ function theme_select($element) {
if (is_array($choice)) {
$select .= '<optgroup label="'. $key .'">';
foreach ($choice as $key => $choice) {
- $select .= '<option value="'. $key .'"'. (is_array($elementp[value]) ? (in_array($key, $element[value]) ? ' selected="selected"' : '') : ($element[value] == $key ? ' selected="selected"' : '')) .'>'. check_plain($choice) .'</option>';
+ $select .= '<option value="'. $key .'"'. (is_array($element[value]) ? (in_array($key, $element[value]) ? ' selected="selected"' : '') : ($element[value] == $key ? ' selected="selected"' : '')) .'>'. check_plain($choice) .'</option>';
}
$select .= '</optgroup>';
}
@@ -781,7 +781,8 @@ function expand_date($element) {
/**
- * Roll out a single checkbox element to a list of checkboxes, using the options array as index.
+ * Roll out a single adios element
+ * to a list of radios, using the options array as index.
*/
function expand_radios($element) {
if (count($element[options]) > 0) {
@@ -861,10 +862,7 @@ function expand_checkboxes($element) {
}
foreach ($element[options] as $key => $choice) {
if (!isset($element[$key])) {
- $element[$key] = array(
- type => 'checkbox', processed => TRUE, title => $choice, tree => TRUE,
- value => in_array($key, $value), attributes => $element[attributes]
- );
+ $element[$key] = array(type => 'checkbox', processed => TRUE, title => $choice, tree => TRUE, default_value => in_array($key, $value), attributes => $element[attributes]);
}
}
}
diff --git a/modules/system.module b/modules/system.module
index 8be2b1749..874bffbfd 100644
--- a/modules/system.module
+++ b/modules/system.module
@@ -829,10 +829,9 @@ function system_modules() {
}
- /**
- * Handle status checkboxes, including overriding the generated checkboxes for required modules.
- */
- $form['status'] = array(type => 'checkboxes', default_value => $status, options => $options, tree => TRUE);
+ // Handle status checkboxes, including overriding the generated
+ // checkboxes for required modules.
+ $form['status'] = array(type => 'checkboxes', default_value => $status, options => $options, tree => TRUE);
$required = array('block', 'filter', 'system', 'user', 'watchdog');
foreach ($required as $require) {
$form['status'][$require] = array(type => 'hidden', value => 1, suffix => t('required'));
@@ -879,11 +878,11 @@ function theme_system_modules($form) {
function system_modules_execute($form_id, $edit) {
- db_query("update {system} set status = 0, throttle = 0 where type = 'module'");
+ db_query("UPDATE {system} SET status = 0, throttle = 0 WHERE type = 'module'");
foreach ($edit['status'] as $key => $choice) {
if ($choice) {
- db_query("update {system} set status = 1 where type = 'module' and name = '%s'", $key);
+ db_query("UPDATE {system} SET status = 1 WHERE type = 'module' AND name = '%s'", $key);
}
}
diff --git a/modules/system/system.module b/modules/system/system.module
index 8be2b1749..874bffbfd 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -829,10 +829,9 @@ function system_modules() {
}
- /**
- * Handle status checkboxes, including overriding the generated checkboxes for required modules.
- */
- $form['status'] = array(type => 'checkboxes', default_value => $status, options => $options, tree => TRUE);
+ // Handle status checkboxes, including overriding the generated
+ // checkboxes for required modules.
+ $form['status'] = array(type => 'checkboxes', default_value => $status, options => $options, tree => TRUE);
$required = array('block', 'filter', 'system', 'user', 'watchdog');
foreach ($required as $require) {
$form['status'][$require] = array(type => 'hidden', value => 1, suffix => t('required'));
@@ -879,11 +878,11 @@ function theme_system_modules($form) {
function system_modules_execute($form_id, $edit) {
- db_query("update {system} set status = 0, throttle = 0 where type = 'module'");
+ db_query("UPDATE {system} SET status = 0, throttle = 0 WHERE type = 'module'");
foreach ($edit['status'] as $key => $choice) {
if ($choice) {
- db_query("update {system} set status = 1 where type = 'module' and name = '%s'", $key);
+ db_query("UPDATE {system} SET status = 1 WHERE type = 'module' AND name = '%s'", $key);
}
}
diff --git a/modules/user.module b/modules/user.module
index 82ec33280..f71713e23 100644
--- a/modules/user.module
+++ b/modules/user.module
@@ -517,8 +517,8 @@ function user_block($op = 'list', $delta = 0, $edit = array()) {
case 0:
// For usability's sake, avoid showing two login forms on one page.
if (!$user->uid && !(arg(0) == 'user' && !is_numeric(arg(1)))) {
- $form['name'] = array(type => 'textfield', title => t('Username'), maxlength => 64, size => 15, required => TRUE);
- $form['pass'] = array(type => 'password', title => t('Password'), maxlength => 64, size => 15, required => TRUE);
+ $form['name'] = array(type => 'textfield', title => t('Username'), maxlength => 64, size => 15);
+ $form['pass'] = array(type => 'password', title => t('Password'), maxlength => 64, size => 15);
$form['submit'] = array(type => 'submit', value => t('Log in'));
$output .= drupal_get_form('user_login_block', $form, 'user_login');
if (variable_get('user_register', 1)) {
diff --git a/modules/user/user.module b/modules/user/user.module
index 82ec33280..f71713e23 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -517,8 +517,8 @@ function user_block($op = 'list', $delta = 0, $edit = array()) {
case 0:
// For usability's sake, avoid showing two login forms on one page.
if (!$user->uid && !(arg(0) == 'user' && !is_numeric(arg(1)))) {
- $form['name'] = array(type => 'textfield', title => t('Username'), maxlength => 64, size => 15, required => TRUE);
- $form['pass'] = array(type => 'password', title => t('Password'), maxlength => 64, size => 15, required => TRUE);
+ $form['name'] = array(type => 'textfield', title => t('Username'), maxlength => 64, size => 15);
+ $form['pass'] = array(type => 'password', title => t('Password'), maxlength => 64, size => 15);
$form['submit'] = array(type => 'submit', value => t('Log in'));
$output .= drupal_get_form('user_login_block', $form, 'user_login');
if (variable_get('user_register', 1)) {