You are here

function content_access_admin_settings in Content Access 6

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

Per content type administration page form.

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

File

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

Code

function content_access_admin_settings(&$form_state, $type) {
  $form_state['type'] = $type;

  // Add role based per content type settings
  $defaults = array();
  foreach (_content_access_get_operations() as $op) {
    $defaults[$op] = content_access_get_settings($op, $type);
  }
  $form = content_access_role_based_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/user/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;
}