1 views_handler_field_file_icon.inc public views_handler_field_file_icon::options_form(&$form, &$form_state)

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

Overrides views_handler_field::options_form

File

core/modules/file/views/views_handler_field_file_icon.inc, line 26
Definition of views_handler_field_file_icon.

Class

views_handler_field_file_icon

Code

public function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);
  $form['icon_size'] = array(
    '#type' => 'number',
    '#title' => t('Icon size'),
    '#min' => 8,
    '#max' => 300,
    '#default_value' => $this->options['icon_size'],
    '#field_suffix' => 'px',
  );
  $form['display_type'] = array(
    '#type' => 'radios',
    '#title' => t('Display type'),
    '#options' => array(
      'svg' => t('Embedded with !svg tag', array(
        '!svg' => '<code>&lt;svg&gt;</code>',
      )),
      'img' => t('Referenced with !img tag', array(
        '!img' => '<code>&lt;img&gt;</code>',
      )),
    ),
    '#default_value' => $this->options['display_type'],
  );
  $form['display_type']['svg']['#description'] = t('Inline SVG icons are efficient and easier to recolor and style.');
  $form['display_type']['img']['#description'] = t('Referenced images can be more efficient when showing the same icon many times.');
  $form['add_alt_text'] = array(
    '#type' => 'checkbox',
    '#title' => t('Include text alternative'),
    '#default_value' => $this->options['add_alt_text'],
    '#description' => t('Adds descriptive text. Do not enable for icons that are decorative only.'),
  );
}