You are here

function content_access_set_settings in Content Access 7

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

Save content_access settings of a content type.

2 calls to content_access_set_settings()
content_access_admin_settings_submit in ./content_access.admin.inc
Submit handler for per content type settings form.
content_access_node_type_update in ./content_access.module
Implements hook_node_type_update().

File

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

Code

function content_access_set_settings($settings, $type_name) {

  // Do not store default values so we do not have to care about syncing our
  // settings with the permissions.
  foreach (content_access_get_setting_defaults($type_name) as $setting => $default_value) {
    if (isset($settings[$setting]) && $settings[$setting] == $default_value) {
      unset($settings[$setting]);
    }
  }
  variable_set('content_access_' . $type_name, $settings);
}