You are here

function draggableviews_draggableviews_style_plugin_form_alter in DraggableViews 7

Same name and namespace in other branches
  1. 6.3 draggableviews.module \draggableviews_draggableviews_style_plugin_form_alter()

Implements hook_draggableviews_style_plugin_form_alter.().

Define style plugin settings for the native handler.

File

./draggableviews.module, line 621
Draggableviews module provides a style plugin for views. With this plugin rows become draggable and can be organized in complex structures.

Code

function draggableviews_draggableviews_style_plugin_form_alter(&$form, $form_state, $style_plugin) {

  // Check for input.
  if (!empty($form_state['input']['style_options'])) {

    // Define the input data as the current data.
    $current = $form_state['input']['style_options'];
  }
  else {

    // Define the already stored data as the current data.
    $current = $style_plugin->options;
  }
  $form['draggableviews_native_header'] = array(
    '#prefix' => '<div style="background: #F6F6F6; border-top: 1px solid #D6DBDE; font-weight: bold; padding: 1em 1em 0;">',
    '#suffix' => '</div>',
    '#value' => t('@display: Style options: Native handler Settings', array(
      '@display' => $style_plugin->display->display_title,
    )),
  );
  $form['draggableviews_arguments'] = array(
    '#type' => 'checkboxes',
    '#name' => 'draggableviews_arguments',
    '#options' => array(
      'use_args' => t('Use arguments as well as view ID to order nodes.'),
    ),
    '#description' => t('If checked, nodes can be reordered for any set of views arguments.  Use with care: If you have many combinations of arguments, your database could become very large.'),
    '#default_value' => $current['draggableviews_arguments'],
  );
}