summaryrefslogtreecommitdiff
path: root/modules/user
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-04-24 14:49:14 +0000
committerDries Buytaert <dries@buytaert.net>2010-04-24 14:49:14 +0000
commit45f4a1e166d090e23cb385c3238835fce61d1607 (patch)
tree63384d78144e0caee7c6700c44e444a70fc58845 /modules/user
parent3e547ae045849264745f8cc456a0f379246060ea (diff)
downloadbrdo-45f4a1e166d090e23cb385c3238835fce61d1607.tar.gz
brdo-45f4a1e166d090e23cb385c3238835fce61d1607.tar.bz2
- Patch #482816 by sun, Rob Loach: make a consistent wrapper around submit buttons.
Diffstat (limited to 'modules/user')
-rw-r--r--modules/user/user.admin.inc11
-rw-r--r--modules/user/user.module10
-rw-r--r--modules/user/user.pages.inc13
3 files changed, 19 insertions, 15 deletions
diff --git a/modules/user/user.admin.inc b/modules/user/user.admin.inc
index 7d92b7484..b0970019b 100644
--- a/modules/user/user.admin.inc
+++ b/modules/user/user.admin.inc
@@ -73,9 +73,9 @@ function user_filter_form() {
}
$form['filters']['actions'] = array(
- '#type' => 'container',
+ '#type' => 'actions',
'#id' => 'user-admin-buttons',
- '#attributes' => array('class' => array('form-actions', 'container-inline')),
+ '#attributes' => array('class' => array('container-inline')),
);
$form['filters']['actions']['submit'] = array(
'#type' => 'submit',
@@ -708,7 +708,7 @@ function user_admin_permissions($form, $form_state, $rid = NULL) {
$form['role_names'][$rid] = array('#markup' => check_plain($name), '#tree' => TRUE);
}
- $form['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions')));
+ $form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Save permissions'));
$form['#attached']['js'][] = drupal_get_path('module', 'user') . '/user.permissions.js';
@@ -844,7 +844,8 @@ function user_admin_roles($form, $form_state) {
'#validate' => array('user_admin_role_validate'),
'#submit' => array('user_admin_role_submit'),
);
- $form['submit'] = array(
+ $form['actions'] = array('#type' => 'actions');
+ $form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save order'),
'#submit' => array('user_admin_roles_order_submit'),
@@ -934,7 +935,7 @@ function user_admin_role($form, $form_state, $role) {
'#type' => 'value',
'#value' => $role->weight,
);
- $form['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions')));
+ $form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save role'),
diff --git a/modules/user/user.module b/modules/user/user.module
index 063704054..9124d4762 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -1165,7 +1165,8 @@ function user_login_block($form) {
'#size' => 15,
'#required' => TRUE,
);
- $form['submit'] = array('#type' => 'submit',
+ $form['actions'] = array('#type' => 'actions');
+ $form['actions']['submit'] = array('#type' => 'submit',
'#value' => t('Log in'),
);
$items = array();
@@ -1829,7 +1830,8 @@ function user_login($form, &$form_state) {
'#required' => TRUE,
);
$form['#validate'] = user_login_default_validators();
- $form['submit'] = array('#type' => 'submit', '#value' => t('Log in'), '#weight' => 2);
+ $form['actions'] = array('#type' => 'actions');
+ $form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Log in'));
return $form;
}
@@ -3357,10 +3359,10 @@ function user_register_form($form, &$form_state) {
$form_state['redirect'] = $_GET['q'];
}
- $form['submit'] = array(
+ $form['actions'] = array('#type' => 'actions');
+ $form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Create new account'),
- '#weight' => 30,
);
// Add the final user registration form submit handler.
diff --git a/modules/user/user.pages.inc b/modules/user/user.pages.inc
index 1a5dfe227..74d508644 100644
--- a/modules/user/user.pages.inc
+++ b/modules/user/user.pages.inc
@@ -48,7 +48,8 @@ function user_pass() {
'#suffix' => '</p>',
);
}
- $form['submit'] = array('#type' => 'submit', '#value' => t('E-mail new password'));
+ $form['actions'] = array('#type' => 'actions');
+ $form['actions']['submit'] = array('#type' => 'submit', '#value' => t('E-mail new password'));
return $form;
}
@@ -140,7 +141,8 @@ function user_pass_reset($form, &$form_state, $uid, $timestamp, $hashed_pass, $a
else {
$form['message'] = array('#markup' => t('<p>This is a one-time login for %user_name and will expire on %expiration_date.</p><p>Click on this button to log in to the site and change your password.</p>', array('%user_name' => $account->name, '%expiration_date' => format_date($timestamp + $timeout))));
$form['help'] = array('#markup' => '<p>' . t('This login can be used only once.') . '</p>');
- $form['submit'] = array('#type' => 'submit', '#value' => t('Log in'));
+ $form['actions'] = array('#type' => 'actions');
+ $form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Log in'));
$form['#action'] = url("user/reset/$uid/$timestamp/$hashed_pass/login");
return $form;
}
@@ -251,16 +253,15 @@ function user_profile_form($form, &$form_state, $account, $category = 'account')
// Attach field widgets.
field_attach_form('user', $account, $form, $form_state);
- $form['submit'] = array(
+ $form['actions'] = array('#type' => 'actions');
+ $form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save'),
- '#weight' => 30,
);
if ($category == 'account') {
- $form['cancel'] = array(
+ $form['actions']['cancel'] = array(
'#type' => 'submit',
'#value' => t('Cancel account'),
- '#weight' => 31,
'#submit' => array('user_edit_cancel_submit'),
'#access' => $account->uid > 1 && (($account->uid == $user->uid && user_access('cancel account')) || user_access('administer users')),
);