You are here

function group_group_role_access_settings in Group 7

Settings form for the group role access plugin.

1 string reference to 'group_group_role_access_settings'
group_role.inc in plugins/ctools/access/group_role.inc
Plugin to provide access control based upon group role.

File

plugins/ctools/access/group_role.inc, line 31
Plugin to provide access control based upon group role.

Code

function group_group_role_access_settings(&$form, &$form_state, $conf) {
  if ($options = group_role_labels(TRUE)) {
    asort($options);
    $form['settings']['roles'] = array(
      '#type' => 'checkboxes',
      '#title' => t('Group role'),
      '#description' => t('Only the checked group roles will be granted access.'),
      '#options' => $options,
      '#default_value' => $conf['roles'],
      '#required' => TRUE,
    );
  }
  else {
    $form['settings']['info'] = array(
      '#markup' => t('There are no group roles yet, so this will always deny access.'),
      '#prefix' => '<p>',
      '#suffix' => '</p>',
    );
  }
  return $form;
}