You are here

function content_access_parse_settings in Content Access 5

Same name and namespace in other branches
  1. 6 content_access.rules.inc \content_access_parse_settings()

Parse submitted settings for per-node form into internal format.

Parameters

$form_values: Form values array variable, modified settings are also reflected here.

2 calls to content_access_parse_settings()
content_access_action_set_node_permissions_submit in ./content_access.workflow_ng.inc
Save configuration for content_access_action_set_node_permissions action.
content_access_condition_check_permissions_submit in ./content_access.workflow_ng.inc
Save configuration for content_access_condition_check_permissions().

File

./content_access.workflow_ng.inc, line 14
Workflow-ng specific functions that expose content_access's API.

Code

function content_access_parse_settings(&$form_values) {
  $settings = array();
  foreach (array(
    'view',
    'update',
    'delete',
  ) as $setting) {
    if (is_array($form_values[$setting])) {
      unset($form_values[$setting][0]);
      $form_values[$setting] = array_filter($form_values[$setting]);
    }
    $settings[$setting] = $form_values[$setting];
  }
  return $settings;
}