You are here

function role_delegation_delegate_roles_action_form in Role Delegation 7

File

./role_delegation.module, line 343
This module allows site administrators to grant some roles the authority to change roles assigned to users, without them needing the 'administer access control' permission.

Code

function role_delegation_delegate_roles_action_form($context) {
  $form['#tree'] = TRUE;
  $form['#theme'] = 'role_delegation_delegate_roles_action_form';
  foreach (_role_delegation_roles() as $rid => $role_name) {
    $form['role_change'][$rid] = array(
      '#type' => 'select',
      '#title' => check_plain($role_name),
      '#default_value' => isset($context['roles_change'][$rid]) ? $context['roles_change'][$rid] : -1,
      '#options' => array(
        -1 => t('Do not change'),
        1 => t('Add this role'),
        0 => t('Remove this role'),
      ),
    );
  }
  return $form;
}