You are here

function content_access_page_submit in Content Access 5

Same name and namespace in other branches
  1. 6 content_access.admin.inc \content_access_page_submit()
  2. 7 content_access.admin.inc \content_access_page_submit()

File

./content_access.module, line 161

Code

function content_access_page_submit($form_id, $form_values) {
  $node = $form_values['node'];
  $settings = array();
  foreach (array(
    'view',
    'update',
    'delete',
  ) as $op) {

    // Set the settings so that further calls will return this settings.
    unset($form_values[$op][0]);
    $settings[$op] = array_filter($form_values[$op]);
    if (module_exists('acl') && isset($form_values['acl'][$op])) {
      acl_save_form($form_values['acl'][$op]);
    }
  }

  // Save per-node settings.
  content_access_save_per_node_settings($node, $settings);

  // Apply new settings.
  node_access_acquire_grants($node);
  cache_clear_all();
  drupal_set_message('Your changes have been saved.');
}