You are here

function block_access_fieldset in Block Access 6

Same name and namespace in other branches
  1. 6.2 block_access.module \block_access_fieldset()
  2. 7 block_access.module \block_access_fieldset()
2 calls to block_access_fieldset()
block_access_form_alter in ./block_access.module
block_access_module_form in ./block_access.admin.inc

File

./block_access.module, line 359

Code

function block_access_fieldset(&$form, $role_options, $perm, $module, $delta = null) {
  $default_role_options = block_access_get_roles($module, $perm, $delta);
  $collapsed = empty($default_role_options) ? TRUE : FALSE;
  $form['role_' . $perm . '_settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Role specific ' . $perm . ' settings'),
    '#collapsible' => TRUE,
    '#collapsed' => $collapsed,
  );
  $form['role_' . $perm . '_settings'][$perm . '_roles'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Set permission for specific roles'),
    '#default_value' => $default_role_options,
    '#options' => $role_options,
    '#description' => t('Set this permission for the selected role(s). If no roles are set the option will be available to all.'),
  );
}