You are here

function duplicate_role_form in Duplicate role 6.2

Same name and namespace in other branches
  1. 6 duplicate_role.module \duplicate_role_form()
  2. 7 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 106

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['varid'] = array(
    '#type' => 'select',
    '#title' => t('Choose role to duplicate'),
    '#default_value' => variable_get('copiarol_varid', 0),
    '#description' => t("Select role to duplicate"),
    '#options' => $options,
  );
  $form['nome'] = array(
    '#type' => 'textfield',
    '#title' => t('New role'),
    '#default_value' => variable_get('copiarol_nome', ''),
    '#required' => true,
    '#size' => 40,
    '#maxlength' => 40,
    '#description' => t("New role name"),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Create new role'),
  );
  return $form;
}