You are here

function audit_log_filter_by_entity_form_submit in Audit Log 7

Form submit callback.

1 call to audit_log_filter_by_entity_form_submit()
audit_log_filter_update_7001 in modules/audit_log_filter/audit_log_filter.install
Update filters.

File

modules/audit_log_filter/audit_log_filter.admin.inc, line 100
Hook implemenations for the Audit database logging module.

Code

function audit_log_filter_by_entity_form_submit($form, &$form_state) {
  $actions = audit_log_action_options();
  $alf_exclude =& $form_state['values']['audit_log_exclude_entity_types'];
  $entity_info = entity_get_info();
  foreach ($entity_info as $entity_type => $info) {
    foreach ($info['bundles'] as $bundle_name => $bundle_info) {

      // If the Entity is selected, all bundles will be selected.
      if (isset($alf_exclude[$entity_type . '-all']) && TRUE == $alf_exclude[$entity_type . '-all']) {
        $alf_exclude[$entity_type][$bundle_name . '-all'] = TRUE;
      }
      foreach ($actions as $action_name => $action_label) {
        if (isset($alf_exclude[$entity_type][$bundle_name . '-all']) && TRUE == $alf_exclude[$entity_type][$bundle_name . '-all']) {
          $alf_exclude[$entity_type][$bundle_name][$action_name] = TRUE;
        }
      }
    }
  }
  variable_set('audit_log_exclude_entity_types', $alf_exclude);
  drupal_set_message(t('The configuration options have been saved.'));
}