You are here

function redhen_relation_handler_field_redhen_relation_status_edit::views_form in RedHen CRM 7

Add to and alter the form.

File

modules/redhen_relation/includes/views/redhen_relation_handler_field_redhen_relation_status_edit.inc, line 40
A Views' field handler for editing the RedHen relation affiliation status field.

Class

redhen_relation_handler_field_redhen_relation_status_edit
@file

Code

function views_form(&$form, &$form_redhen_relation_status) {

  // Create a container for our replacements
  $form[$this->options['id']] = array(
    '#type' => 'container',
    '#tree' => TRUE,
  );

  // Iterate over the result and add our replacement fields to the form.
  foreach ($this->view->result as $row_index => $row) {

    // Add a text field to the form.  This array convention
    // corresponds to the placeholder HTML comment syntax.
    $form[$this->options['id']][$row_index] = array(
      '#type' => 'checkbox',
      '#default_value' => $row->{$this->aliases[REDHEN_RELATION_STATUS_FIELD]},
    );
  }
}