You are here

function content_access_get_settings in Content Access 6

Same name and namespace in other branches
  1. 8 content_access.module \content_access_get_settings()
  2. 5 content_access.module \content_access_get_settings()
  3. 7 content_access.module \content_access_get_settings()

Returns the content_access' settings.

Parameters

$return: One of the content_access_available_settings(), e.g. 'view' or 'per_node'.

$type: If not all, return the setting for the specified type.

15 calls to content_access_get_settings()
content_access_action_acl_grant_access in ./content_access.rules.inc
Action implementation: Grant access for a user.
content_access_admin_settings in ./content_access.admin.inc
Per content type administration page form.
content_access_admin_settings_submit in ./content_access.admin.inc
content_access_force_permissions in ./content_access.admin.inc
Formapi #after_build callback, that disables checkboxes for roles without access to content.
content_access_get_type_grant in ./content_access.module
Returns the default grants for a given node type.

... See full list

File

./content_access.module, line 175
Content access module file.

Code

function content_access_get_settings($return = 'all', $type = NULL) {
  if ($return == 'all') {
    return variable_get('content_access_settings', array());
  }
  if (isset($type)) {
    $settings = content_access_get_settings($return);
    return isset($settings[$type]) ? $settings[$type] : content_access_get_setting_defaults($return, $type);
  }
  if (!isset($type)) {
    $settings = content_access_get_settings();
    return isset($settings[$return]) ? $settings[$return] : array();
  }
  return array();
}