You are here

function og_perm_ctools_access_settings in Organic groups 7.2

Same name and namespace in other branches
  1. 7 plugins/access/og_perm.inc \og_perm_ctools_access_settings()

Settings form for the 'by perm' access plugin

1 string reference to 'og_perm_ctools_access_settings'
og_perm.inc in plugins/access/og_perm.inc
Plugin to provide access control based on user permission strings in a group.

File

plugins/access/og_perm.inc, line 29
Plugin to provide access control based on user permission strings in a group.

Code

function og_perm_ctools_access_settings($form, &$form_state, $conf) {
  $perms = array();

  // Get list of permissions
  foreach (og_get_permissions() as $perm => $value) {

    // By keeping them keyed by module we can use optgroups with the
    // 'select' type.
    $perms[$value['module']][$perm] = $value['title'];
  }
  $form['settings']['perm'] = array(
    '#type' => 'select',
    '#options' => $perms,
    '#title' => t('Group permission'),
    '#default_value' => $conf['perm'],
    '#description' => t('Only users with the selected permission flag, in the specified group, will be able to access this.'),
    '#required' => TRUE,
  );
  return $form;
}