You are here

public function isotope_reaction::options_form in Isotope (with Masonry and Packery) 7

Same name and namespace in other branches
  1. 7.2 plugins/context/isotope_reaction.inc \isotope_reaction::options_form()

Configuration form for the Isotope context reaction.

Overrides context_reaction::options_form

1 call to isotope_reaction::options_form()
isotope_reaction::editor_form in plugins/isotope_reaction.inc
Editor form.

File

plugins/isotope_reaction.inc, line 29
Contains the isotope_reaction subclass.

Class

isotope_reaction
Expose isotope configurations as context reactions.

Code

public function options_form($context) {
  $values = $this
    ->fetch_from_context($context);
  $form = array(
    '#tree' => TRUE,
    '#title' => t('Isotope'),
    'pre' => array(
      '#type' => 'item',
      '#title' => t('Isotope Configuration'),
      '#description' => t('For detailed examples and documentation, please see !link.', array(
        '!link' => l(t('The Isotope Manual'), 'http://isotope.metafizzy.co/docs/layout-modes.html'),
      )),
    ),
    'container_selector' => array(
      '#title' => t('Container Selector'),
      '#description' => t('CSS selector for the Isotope container. Example: .view-content.'),
      '#type' => 'textfield',
      '#default_value' => isset($values['container_selector']) ? $values['container_selector'] : '',
    ),
    'item_selector' => array(
      '#title' => t('Item Selector'),
      '#description' => t('CSS selector for the Isotope Items. Example: .views-row.'),
      '#type' => 'textfield',
      '#default_value' => isset($values['item_selector']) ? $values['item_selector'] : '',
    ),
    'layout_mode' => array(
      '#title' => t('Layout Mode'),
      '#description' => t('An !isotope_layout to use for this Isotope instance.', array(
        '!isotope_layout' => l(t('Isotope Layout Mode'), 'http://isotope.metafizzy.co/docs/layout-modes.html'),
      )),
      '#type' => 'select',
      '#options' => array(
        'masonry' => 'masonry',
        'fitRows' => 'fitRows',
        'cellsByRow' => 'cellsByRow',
        'straightDown' => 'straightDown',
        'masonryHorizontal' => 'masonryHorizontal',
        'fitColumns' => 'fitColumns',
        'cellsByColumn' => 'cellsByColumn',
        'straightAcross' => 'straightAcross',
      ),
      '#default_value' => isset($values['layout_mode']) ? $values['layout_mode'] : 'masonry',
    ),
    'column_width' => array(
      '#title' => t('Column Width'),
      '#description' => t('The numeric value for the Column Width setting for the selected layout mode. Leave blank to exclude.'),
      '#type' => 'textfield',
      '#default_value' => isset($values['column_width']) ? $values['column_width'] : '',
    ),
    'row_height' => array(
      '#title' => t('Row Height'),
      '#description' => t('The numeric value for the Row Height setting for the selected layout mode. Leave blank to exlude.'),
      '#type' => 'textfield',
      '#default_value' => isset($values['row_height']) ? $values['row_height'] : '',
    ),
    'resizable' => array(
      '#title' => t('Resizable'),
      '#description' => t('Trigger layout logic when browser window is resized.'),
      '#type' => 'checkbox',
      '#default_value' => isset($values['resizable']) ? $values['resizable'] : TRUE,
    ),
    'resize_container' => array(
      '#title' => t('Resize Container'),
      '#description' => t('Resize the specified Isotope container after repositioning items.'),
      '#type' => 'checkbox',
      '#default_value' => isset($values['resize_container']) ? $values['resize_container'] : TRUE,
    ),
    'animation_engine' => array(
      '#title' => t('Animation Engine'),
      '#description' => t('An !isotope_animationengine configuration for this Isotope instance.', array(
        '!isotope_animationengine' => l(t('Isotope Animation Engine'), 'http://isotope.metafizzy.co/docs/options.html', array(
          'fragment' => 'animationengine',
        )),
      )),
      '#type' => 'select',
      '#options' => array(
        'best-available' => 'Best Available',
        'css' => 'CSS',
        'jquery' => 'jQuery',
      ),
      '#default_value' => isset($values['animation_engine']) ? $values['animation_engine'] : 'best-available',
    ),
    'apply_css' => array(
      '#type' => 'checkbox',
      '#title' => t('Automatically apply height and width styles to Isotope items based on the configured Column Width and Row Height.'),
      '#description' => t('Apply style settings via jQuery to Isotope items based on the configuration specified above. Style settings applied are limited to those utilized by the specified Isotope Layout Mode. This option is not recommended for advanced implementations. See the !layout_documentation for clarification.', array(
        '!layout_documentation' => l(t('Isotope Layout Modes Documentation'), 'http://isotope.metafizzy.co/docs/layout-modes.html'),
      )),
      '#default_value' => isset($values['apply_css']) ? $values['apply_css'] : TRUE,
    ),
  );
  return $form;
}