You are here

function views_fluid_grid_plugin_style::options_form in Views Fluid Grid 7.3

Same name and namespace in other branches
  1. 6 views/views_fluid_grid_plugin_style.inc \views_fluid_grid_plugin_style::options_form()

Provide a form to edit options for this plugin.

Overrides views_plugin_style::options_form

File

views/views_fluid_grid_plugin_style.inc, line 34
Contains the fluid grid style plugin.

Class

views_fluid_grid_plugin_style
Style plugin to render items in a fluid grid.

Code

function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);
  $alignment_options = array(
    '' => t('Inherit'),
    'left' => t('Left'),
    'right' => t('Right'),
    'center' => t('Center'),
    'justify' => t('Justify'),
  );
  $items_width_options = array(
    '' => t('Auto'),
  ) + drupal_map_assoc(variable_get('views_fluid_grid_plugin_style_widths', array(
    100,
    150,
    180,
    200,
    250,
    300,
    350,
    400,
    450,
    500,
  )));
  $items_height_options = array(
    '' => t('Auto'),
  ) + drupal_map_assoc(variable_get('views_fluid_grid_plugin_style_heights', array(
    100,
    150,
    200,
    250,
    300,
    350,
    400,
    450,
    500,
  )));
  $items_margin_options = array(
    '' => t('None'),
  ) + drupal_map_assoc(variable_get('views_fluid_grid_plugin_style_margins', array(
    '0',
    '2px',
    '4px',
    '6px',
    '8px',
    '10px',
    '0.2em',
    '0.5em',
    '0.8em',
    '1em',
    '1.2em',
    '1.5em',
    '1.8em',
    '2em',
  )));
  $form['size'] = array(
    '#type' => 'fieldset',
    '#title' => t('Items size'),
  );
  $form['size']['items_width'] = array(
    '#type' => 'select',
    '#title' => t('Width'),
    '#options' => $items_width_options,
    '#default_value' => $this->options['items_width'],
  );
  $form['size']['items_height'] = array(
    '#type' => 'select',
    '#title' => t('Height'),
    '#options' => $items_height_options,
    '#default_value' => $this->options['items_height'],
  );
  $form['advanced_layout'] = array(
    '#type' => 'value',
    '#value' => $this->options['advanced_layout'],
  );
  $form['advanced'] = array(
    '#type' => 'fieldset',
    '#title' => t('Advanced layout options'),
    '#collapsible' => TRUE,
    '#collapsed' => empty($this->options['advanced_layout']),
  );
  $form['advanced']['align'] = array(
    '#type' => 'fieldset',
    '#title' => t('Alignment'),
    '#collapsible' => TRUE,
    '#collapsed' => empty($this->options['advanced_layout']['align']),
  );
  $form['advanced']['align']['list_alignment'] = array(
    '#type' => 'select',
    '#title' => t('Items in the list'),
    '#options' => $alignment_options,
    '#default_value' => $this->options['list_alignment'],
    '#description' => t('Horizontal alignment for the items in the list. Note: text-align:justify does not seem to work in IE6.'),
  );
  $form['advanced']['align']['items_alignment'] = array(
    '#type' => 'select',
    '#title' => t('Content of the items'),
    '#options' => $alignment_options,
    '#default_value' => $this->options['items_alignment'],
    '#description' => t('Horizontal alignment for the content of the items.'),
  );
  $form['advanced']['margins'] = array(
    '#type' => 'fieldset',
    '#title' => t('Margins'),
    '#collapsible' => TRUE,
    '#collapsed' => empty($this->options['advanced_layout']['margins']),
  );
  $form['advanced']['margins']['items_h_margin'] = array(
    '#type' => 'select',
    '#title' => t('Horizontal'),
    '#options' => $items_margin_options,
    '#default_value' => $this->options['items_h_margin'],
    '#description' => t('Horizontal margin between items.'),
  );
  $form['advanced']['margins']['items_v_margin'] = array(
    '#type' => 'select',
    '#title' => t('Vertical'),
    '#options' => $items_margin_options,
    '#default_value' => $this->options['items_v_margin'],
    '#description' => t('Vertical margin between items.'),
  );
  $form['advanced']['css3'] = array(
    '#type' => 'fieldset',
    '#title' => t('CSS3 style properties'),
    '#description' => t('Note that these style properties may not be supported by all browsers.'),
    '#collapsible' => TRUE,
    '#collapsed' => empty($this->options['advanced_layout']['css3']),
  );
  $form['advanced']['css3']['box_shadow'] = array(
    '#type' => 'radios',
    '#title' => t('Box shadow'),
    '#options' => array(
      0 => t('Disabled'),
      1 => t('Enabled'),
    ),
    '#default_value' => $this->options['box_shadow'],
  );
  $form['advanced']['css3']['border_radius'] = array(
    '#type' => 'radios',
    '#title' => t('Border radius'),
    '#options' => array(
      0 => t('Disabled'),
      1 => t('Enabled'),
    ),
    '#default_value' => $this->options['border_radius'],
  );
}