You are here

function vscc_controls_views_slideshow_widget_controls_form_options in Views Slideshow Configurable Controls 7

Implements [control_key]_views_slideshow_widget_controls_form_options().

File

./vscc.module, line 89
Views Slideshow Configurable Controls hook implementations.

Code

function vscc_controls_views_slideshow_widget_controls_form_options(&$form, &$form_state, &$view, $defaults, $dependency) {
  $closure = end($form);
  $closure_key = key($form);
  array_pop($form);

  // Need to wrap this so it indents correctly.
  $form['vscc_controls_wrapper'] = array(
    '#markup' => '<div class="vs-dependent-lvl3">',
  );
  $elements_states = array(
    'visible' => array(
      ':input[name="' . $dependency . '[enable]"]' => array(
        'checked' => TRUE,
      ),
      ':input[name="' . $dependency . '[type]"]' => array(
        'value' => 'vscc_controls',
      ),
    ),
  );
  $form['vscc_controls_pause'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display pause control'),
    '#states' => $elements_states,
    '#default_value' => $defaults['vscc_controls_pause'],
  );
  $skins = module_invoke_all('vscc_skin_info');
  $options = array();
  foreach ($skins as $key => $skin) {
    $options[$key] = $skin['name'];
  }
  $form['vscc_controls_skin'] = array(
    '#type' => 'select',
    '#title' => t('Controls skin'),
    '#states' => $elements_states,
    '#options' => $options,
    '#default_value' => $defaults['vscc_controls_skin'],
  );
  $form['vscc_controls_wrapper_close'] = array(
    '#markup' => '</div>',
  );
  $form[$closure_key] = $closure;
}