On this page
function user_admin_role
user_admin_role($form, $form_state, $role)
Form to configure a single role.
See also
Related topics
File
- modules/user/user.admin.inc, line 951
- Admin page callback file for the user module.
Code
function user_admin_role($form, $form_state, $role) {
if ($role->rid == DRUPAL_ANONYMOUS_RID || $role->rid == DRUPAL_AUTHENTICATED_RID) {
drupal_goto('admin/people/permissions/roles');
}
// Display the edit role form.
$form['name'] = array(
'#type' => 'textfield',
'#title' => t('Role name'),
'#default_value' => $role->name,
'#size' => 30,
'#required' => TRUE,
'#maxlength' => 64,
'#description' => t('The name for this role. Example: "moderator", "editorial board", "site architect".'),
);
$form['rid'] = array(
'#type' => 'value',
'#value' => $role->rid,
);
$form['weight'] = array(
'#type' => 'value',
'#value' => $role->weight,
);
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save role'),
);
$form['actions']['delete'] = array(
'#type' => 'submit',
'#value' => t('Delete role'),
'#submit' => array('user_admin_role_delete_submit'),
);
return $form;
}
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!user!user.admin.inc/function/user_admin_role/7.x