function duplicate_role_form in Duplicate role 7
Same name and namespace in other branches
- 6.2 duplicate_role.module \duplicate_role_form()
- 6 duplicate_role.module \duplicate_role_form()
Module selection interface.
1 string reference to 'duplicate_role_form'
- duplicate_role_menu in ./
duplicate_role.module - Implements hook_menu().
File
- ./
duplicate_role.module, line 105
Code
function duplicate_role_form() {
$form = array();
$u_roles = user_roles();
asort($u_roles);
$options = array();
$options[] = t('-- Please select one role --');
foreach ($u_roles as $key => $value) {
$options[$key] = $value;
}
$form['base_role'] = array(
'#type' => 'select',
'#title' => t('Choose role to duplicate'),
'#default_value' => variable_get('base_role', 0),
'#description' => t("Select role to duplicate"),
'#options' => $options,
);
$form['new_role_name'] = array(
'#type' => 'textfield',
'#title' => t('New role'),
'#default_value' => variable_get('new_role_name', ''),
'#required' => TRUE,
'#size' => 40,
'#maxlength' => 40,
'#description' => t("New role name"),
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Create new role'),
);
return $form;
}