You are here

public function views_handler_area_result::options_form in Views (for Drupal 7) 7.3

Default options form that provides the label widget that all fields should have.

Overrides views_handler_area::options_form

File

handlers/views_handler_area_result.inc, line 38
Definition of views_handler_area_result.

Class

views_handler_area_result
Views area handler to display some configurable result summary.

Code

public function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);
  $variables = array(
    'items' => array(
      '@start -- the initial record number in the set',
      '@end -- the last record number in the set',
      '@total -- the total records in the set',
      '@name -- the human-readable name of the view',
      '@per_page -- the number of items per page',
      '@current_page -- the current page number',
      '@current_record_count -- the current page record count',
      '@page_count -- the total page count',
    ),
  );
  $list = theme('item_list', $variables);
  $form['content'] = array(
    '#title' => t('Display'),
    '#type' => 'textarea',
    '#rows' => 3,
    '#default_value' => $this->options['content'],
    '#description' => t('You may use HTML code in this field. The following tokens are supported:') . $list,
  );
  $form['format_plural'] = array(
    '#type' => 'checkbox',
    '#title' => t('Format plural'),
    '#description' => t('If checked, special handling will be used for plurality.'),
    '#default_value' => $this->options['format_plural'],
  );
  $form['format_plural_count'] = array(
    '#type' => 'select',
    '#title' => t('Count token'),
    '#description' => t('Token used to select plural format.'),
    '#default_value' => $this->options['format_plural_count'],
    '#options' => drupal_map_assoc(array(
      '@start',
      '@end',
      '@total',
      '@name',
      '@per_page',
      '@current_page',
      '@current_record_count',
      '@page_count',
    )),
    '#dependency' => array(
      'edit-options-format-plural' => array(
        TRUE,
      ),
    ),
  );
  $form['format_plural_plural'] = array(
    '#title' => t('Plural form'),
    '#type' => 'textarea',
    '#rows' => 3,
    '#default_value' => $this->options['format_plural_plural'],
    '#description' => t('Text to use for the plural form.'),
    '#dependency' => array(
      'edit-options-format-plural' => array(
        TRUE,
      ),
    ),
  );
}