You are here

function spam_admin_feedback_form in Spam 6

Same name and namespace in other branches
  1. 5.3 spam.module \spam_admin_feedback_form()

Spam feedback details.

1 string reference to 'spam_admin_feedback_form'
spam_menu in ./spam.module
Drupal _menu() hook.

File

./spam.module, line 1029
Spam module, v3 Copyright(c) 2006-2008 Jeremy Andrews <jeremy@tag1consulting.com>. All rights reserved.

Code

function spam_admin_feedback_form($form_state, $bid) {
  $form = array();
  $feedback = db_fetch_object(db_query('SELECT * FROM {spam_filters_errors} WHERE bid = %d', $bid));
  $form = spam_invoke_module($feedback->content_type, 'feedback_form', unserialize($feedback->content));
  if (!is_array($form)) {
    $form = array();
  }
  $form['date'] = array(
    '#type' => 'markup',
    '#prefix' => '<div><strong>' . t('Posted') . ':</strong></div>',
    '#value' => format_date($feedback->timestamp),
  );
  $form['feedback'] = array(
    '#type' => 'textarea',
    '#title' => t('Feedback'),
    '#value' => $feedback->feedback,
    '#disabled' => TRUE,
  );
  $trid = db_result(db_query_range("SELECT trid FROM {spam_log} WHERE content_type = '%s' AND content_id = '%s'", $feedback->content_type, $feedback->content_id, 0, 1));
  if (!empty($trid)) {
    $form['logs'] = array(
      '#type' => 'markup',
      '#prefix' => '<div>',
      '#suffix' => '</div>',
      '#value' => l(t('Spam logs'), "admin/reports/spam/{$trid}/trace"),
    );
  }
  $form['publish'] = array(
    '#type' => 'submit',
    '#value' => t('Publish content'),
  );
  $form['delete'] = array(
    '#type' => 'submit',
    '#value' => t('Delete feedback'),
    '#submit' => array(
      'spam_admin_feedback_delete_submit',
    ),
  );
  $form['cancel'] = array(
    '#value' => l(t('Cancel'), 'admin/content/spam/feedback'),
  );
  $form['content'] = array(
    '#type' => 'hidden',
    '#value' => $feedback->content,
  );
  $form['spam_form'] = array(
    '#type' => 'hidden',
    '#value' => $feedback->form,
  );
  $form['bid'] = array(
    '#type' => 'hidden',
    '#value' => $feedback->bid,
  );
  $form['type'] = array(
    '#type' => 'hidden',
    '#value' => $feedback->content_type,
  );
  $form['id'] = array(
    '#type' => 'hidden',
    '#value' => $feedback->content_id,
  );
  return $form;
}