You are here

function views_send_handler_field_selector::views_form in Views Send 7

The form which replaces the placeholder from render().

File

views/views_send_handler_field_selector.inc, line 34
Views field handler. Outputs a checkbox for selecting a row for email sending. Implements the Views Form API.

Class

views_send_handler_field_selector
@file Views field handler. Outputs a checkbox for selecting a row for email sending. Implements the Views Form API.

Code

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

  // The view is empty, abort.
  if (empty($this->view->result)) {
    return;
  }
  $form[$this->options['id']] = array(
    '#tree' => TRUE,
  );
  foreach ($this->view->result as $row_index => $row) {
    $form[$this->options['id']][$row_index] = array(
      '#type' => 'checkbox',
      '#default_value' => FALSE,
      '#attributes' => array(
        'class' => array(
          'views-send-select',
        ),
      ),
    );
  }
}