You are here

function insight_report_save in Insight 7

Save a report.

Parameters

set: An widget set array.

Return value

An widget set array. In the case of a new set, 'wsid' will be populated.

1 call to insight_report_save()
insight_contentanalysis_analysis_alter in ./insight.module

File

./insight.module, line 165

Code

function insight_report_save($report) {

  // check if report already exists
  $report0 = insight_report_load_by_params($report['name'], $report['nid'], $report['path']);
  $report += array(
    'created' => REQUEST_TIME,
    'active' => 1,
  );
  if (isset($report0['irid'])) {
    $report['irid'] = $report0['irid'];
    drupal_write_record('insight_report', $report, array(
      'irid',
    ));
  }
  else {
    drupal_write_record('insight_report', $report);
  }

  // Let other modules update as necessary on save.
  module_invoke_all('insight_report_save', $report);
  return $report;
}