You are here

function content_access_admin_settings in Content Access 7

Same name and namespace in other branches
  1. 5 content_access.module \content_access_admin_settings()
  2. 6 content_access.admin.inc \content_access_admin_settings()

Per content type settings form.

1 string reference to 'content_access_admin_settings'
content_access_menu in ./content_access.module
Implements hook_menu().

File

./content_access.admin.inc, line 114
Content access administration UI.

Code

function content_access_admin_settings($form, &$form_state, $content_type) {
  $type = $content_type->type;
  $form_state['type'] = $type;

  // Add role based per content type settings
  $defaults = array();
  foreach (_content_access_get_operations() as $op => $label) {
    $defaults[$op] = content_access_get_settings($op, $type);
  }
  content_access_role_based_form($form, $defaults, $type);

  // Per node:
  $form['node'] = array(
    '#type' => 'fieldset',
    '#title' => t('Per content node access control settings'),
    '#collapsible' => TRUE,
    '#description' => t('Optionally you can enable per content node access control settings. If enabled, a new tab for the content access settings appears when viewing content. You have to configure permission to access these settings at the !permissions page.', array(
      '!permissions' => l(t('permissions'), 'admin/people/permissions'),
    )),
  );
  $form['node']['per_node'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable per content node access control settings'),
    '#default_value' => content_access_get_settings('per_node', $type),
  );
  $form['advanced'] = array(
    '#type' => 'fieldset',
    '#title' => t('Advanced'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['advanced']['priority'] = array(
    '#type' => 'weight',
    '#title' => t('Give content node grants priority'),
    '#default_value' => content_access_get_settings('priority', $type),
    '#description' => t('If you are only using this access control module, you can safely ignore this. If you are using multiple access control modules you can adjust the priority of this module.'),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Submit'),
    '#weight' => 10,
  );
  return $form;
}