You are here

function content_access_get_settings in Content Access 7

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. 6 content_access.module \content_access_get_settings()

Return content_access' settings.

Parameters

$setting: One of the content_access_available_settings(), e.g. 'view' or 'per_node'. If 'all' is passed, all available settings are returned.

$type_name: The name of the content type to return settings for.

Return value

The value of the given setting or an array of all settings.

13 calls to content_access_get_settings()
content_access_action_user in content_access_rules/content_access_rules.rules.inc
Process Rule's param, and grant by the passed operation.
content_access_admin_settings in ./content_access.admin.inc
Per content type settings form.
content_access_admin_settings_submit in ./content_access.admin.inc
Submit handler for per content type settings form.
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 231
Content access module file.

Code

function content_access_get_settings($setting, $type_name) {
  $settings = variable_get('content_access_' . $type_name, array());
  $settings += content_access_get_setting_defaults($type_name);
  if ($setting == 'all') {
    return $settings;
  }
  return isset($settings[$setting]) ? $settings[$setting] : NULL;
}