You are here

function insight_report_form in Insight 7

1 string reference to 'insight_report_form'
insight_menu in ./insight.module
Implements hook.().

File

./insight.reports.inc, line 3

Code

function insight_report_form($form, $form_state, $report) {
  drupal_add_css(drupal_get_path('module', 'contentanalysis') . '/contentanalysis.css');
  $analyzer_defs = insight_analyzer_info(TRUE);
  $report_defs = $analyzer_defs['#meta']['reports'];
  $title = t('%name report', array(
    '%name' => $report_defs[$report['name']]['title'],
  ));
  drupal_set_title($title, PASS_THROUGH);
  $form_state['report'] = $report;
  $form['#attached']['css'][drupal_get_path('module', 'insight') . '/insight.admin.css'] = array();
  if ($report['nid']) {
    $form['for'] = array(
      '#type' => 'markup',
      '#markup' => t('for') . ': ' . l(substr(url('node/' . $report['nid']), 1), 'node/' . $report['nid']),
    );
  }

  // Show the thumbnail preview.
  $form['report'] = array(
    '#type' => 'markup',
    '#markup' => $report['report'],
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => $report['active'] ? t('Ignore report') : t('Re-activate report'),
  );
  $destination = drupal_get_destination();
  $form['back'] = array(
    '#markup' => l(t('Back'), $destination['destination']),
  );
  return $form;
}