You are here

function feedback_entry_form in Feedback 7.2

Form builder; Feedback entry edit form.

1 string reference to 'feedback_entry_form'
feedback_menu in ./feedback.module
Implements hook_menu().

File

./feedback.admin.inc, line 167
Administrative functionality for Feedback module.

Code

function feedback_entry_form($form, &$form_state, $entry) {
  $form['#fid'] = $entry->fid;
  $form['location'] = array(
    '#type' => 'textfield',
    '#title' => t('Location'),
    '#required' => TRUE,
    '#default_value' => $entry->location,
  );
  $account = user_load($entry->uid);
  $form['user'] = array(
    '#title' => t('User'),
    '#type' => 'item',
    '#markup' => theme('username', array(
      'account' => $account,
    )),
  );
  $form['status'] = array(
    '#title' => t('Processed'),
    '#type' => 'radios',
    '#options' => array(
      FEEDBACK_OPEN => 'Open',
      FEEDBACK_PROCESSED => 'Processed',
    ),
    '#default_value' => $entry->status,
  );
  $form['message'] = array(
    '#type' => 'textarea',
    '#title' => t('Message'),
    '#required' => TRUE,
    '#wysiwyg' => FALSE,
    '#default_value' => $entry->message,
  );
  field_attach_form('feedback', $entry, $form, $form_state);
  $form['actions'] = array(
    '#type' => 'actions',
  );
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Submit'),
  );
  $form['actions']['delete'] = array(
    '#type' => 'submit',
    '#value' => t('Delete'),
    '#submit' => array(
      'feedback_entry_form_delete_submit',
    ),
  );
  return $form;
}