function accessibility_reporting_report

cis7 accessibility_reporting.module accessibility_reporting_report()
cle7 accessibility_reporting.module accessibility_reporting_report()
elmsmedia7 accessibility_reporting.module accessibility_reporting_report()
icor7 accessibility_reporting.module accessibility_reporting_report()
meedjum_blog7 accessibility_reporting.module accessibility_reporting_report()
mooc7 accessibility_reporting.module accessibility_reporting_report()

Report callback. Stores posted data to accessibility_reporting table.

1 string reference to 'accessibility_reporting_report'
accessibility_reporting_menu in sites/all/modules/ulmus/accessibility/modules/accessibility_reporting/accessibility_reporting.module
Implements hook_menu().

File

sites/all/modules/ulmus/accessibility/modules/accessibility_reporting/accessibility_reporting.module, line 92

Code

function accessibility_reporting_report() {
  if (!isset($_POST['results'])) {
    return;
  }
  foreach ($_POST['results'] as $result) {
    array_walk($result, 'check_plain');
    db_delete('accessibility_reporting')->condition('entity_type', $result['entity_type'])->condition('entity_id', $result['entity_id'])->execute();
    if (isset($result['total']) && count($result['total'])) {
      foreach ($result['total'] as $test_id => $total) {
        db_insert('accessibility_reporting')->fields(array(
          'test_id' => $test_id,
          'entity_type' => $result['entity_type'],
          'bundle' => $result['bundle'],
          'entity_id' => $result['entity_id'],
          'field' => $result['field'],
          'total' => $total,
        ))->execute();
      }
    }
  }
}