You are here

function views_slideshow_plugin_style_slideshow::options_form in Views Slideshow 6.2

Same name and namespace in other branches
  1. 6.3 views_slideshow_plugin_style_slideshow.inc \views_slideshow_plugin_style_slideshow::options_form()
  2. 6 views_slideshow_plugin_style_slideshow.inc \views_slideshow_plugin_style_slideshow::options_form()
  3. 7.3 views_slideshow_plugin_style_slideshow.inc \views_slideshow_plugin_style_slideshow::options_form()

File

./views_slideshow_plugin_style_slideshow.inc, line 47
Contains the list style plugin.

Class

views_slideshow_plugin_style_slideshow
Style plugin to render each item in a slideshow of an ordered or unordered list.

Code

function options_form(&$form, &$form_state) {
  module_load_all_includes('views_slideshow.inc');
  parent::options_form($form, $form_state);
  $modules = module_invoke_all('views_slideshow_modes');
  if ($modules) {
    $form['mode'] = array(
      '#type' => 'select',
      '#title' => t('Slideshow mode'),
      '#options' => $modules,
      '#default_value' => $this->options['mode'],
    );
    foreach (module_implements('views_slideshow_options_form') as $module) {

      // We wrap our fieldsets in a div so we can use dependent.js to
      // show/hide our fieldsets.
      $form[$module . '-prefix'] = array(
        '#type' => 'hidden',
        '#id' => $module . '-options-wrapper',
        '#prefix' => '<div><div id="' . $module . '-options-wrapper">',
        '#process' => array(
          'views_process_dependency',
        ),
        '#dependency' => array(
          'edit-style-options-mode' => array(
            $module,
          ),
        ),
      );
      $form[$module] = array(
        '#type' => 'fieldset',
        '#title' => t($modules[$module] . ' options'),
        '#collapsible' => TRUE,
        '#attributes' => array(
          'class' => $module,
        ),
      );
      $function = $module . '_views_slideshow_options_form';
      call_user_func_array($function, array(
        &$form,
        &$form_state,
        &$this,
      ));
      $form[$module . '-suffix'] = array(
        '#value' => '</div></div>',
      );
    }
  }
  else {
    $form['enable_module'] = array(
      '#value' => t('There is no Views Slideshow plugin enabled. Go to the !modules and enable a Views Slideshow plugin module. For example Views Slideshow Singleframe.', array(
        '!modules' => l('Modules Page', 'admin/build/modules'),
      )),
    );
  }
}