You are here

class ViewsFractionsliderStylePlugin in Views FractionSlider 7.2

Implementation of views_plugin_style().

Hierarchy

Expanded class hierarchy of ViewsFractionsliderStylePlugin

1 string reference to 'ViewsFractionsliderStylePlugin'
views_fractionslider_views_plugins in views/views_fractionslider.views.inc
Implements hook_views_plugin().

File

views/views_fractionslider_style_plugin.inc, line 11
Provide an fractionslider style plugin for Views.

View source
class ViewsFractionsliderStylePlugin extends views_plugin_style {

  /**
   * Set default options.
   */
  public function option_definition() {
    $options = parent::option_definition();
    return $options;
  }

  /**
   * Render the given style.
   */
  public function options_form(&$form, &$form_state) {
    parent::options_form($form, $form_state);
    $form['general_settings'] = array(
      '#type' => 'fieldset',
      '#title' => t('General Settings'),
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
    );
    $form['class'] = array(
      '#title' => t('Div class'),
      '#description' => t('The class to provide on the Div element itself. In addition with "slide" class.'),
      '#type' => 'textfield',
      '#size' => '30',
      '#default_value' => $this->options['class'],
      '#fieldset' => 'general_settings',
    );
    $form['pager'] = array(
      '#type' => 'select',
      '#title' => t('Pager'),
      '#options' => array(
        'true' => t('True'),
        'false' => t('False'),
      ),
      '#default_value' => $this->options['pager'],
      '#description' => t('Set Pager True or False. Default is True.'),
      '#fieldset' => 'general_settings',
    );
    $form['controls'] = array(
      '#type' => 'select',
      '#title' => t('Controls'),
      '#options' => array(
        'true' => t('True'),
        'false' => t('False'),
      ),
      '#default_value' => $this->options['controls'],
      '#description' => t('Set Controls True or False. Default is True.'),
      '#fieldset' => 'general_settings',
    );
    $form['views_dimensions'] = array(
      '#type' => 'textfield',
      '#title' => t('Dimensions'),
      '#default_value' => $this->options['views_dimensions'] ? $this->options['views_dimensions'] : '1000, 400',
      '#description' => t('Default: 1000, 400'),
      '#fieldset' => 'general_settings',
    );
    $form['views_fullwidth'] = array(
      '#type' => 'select',
      '#title' => t('Full width'),
      '#options' => array(
        'false' => t('False'),
        'true' => t('True'),
      ),
      '#default_value' => $this->options['views_fullwidth'],
      '#description' => t('Transition over the full width of the window. Default: false'),
      '#fieldset' => 'general_settings',
    );
    $form['views_responsive'] = array(
      '#type' => 'select',
      '#title' => t('Responsive'),
      '#options' => array(
        'false' => t('False'),
        'true' => t('True'),
      ),
      '#default_value' => $this->options['views_responsive'],
      '#description' => t('Default: true'),
      '#fieldset' => 'general_settings',
    );
    $form['views_increase'] = array(
      '#type' => 'select',
      '#title' => t('Increase'),
      '#options' => array(
        'false' => t('False'),
        'true' => t('True'),
      ),
      '#default_value' => $this->options['views_increase'],
      '#description' => t('If set, slider is allowed to get bigger than basic dimensions. Default: false'),
      '#fieldset' => 'general_settings',
    );
    $form['fields_settings'] = array(
      '#type' => 'fieldset',
      '#title' => t('Fields Settings'),
      '#collapsible' => TRUE,
      '#collapsed' => FALSE,
    );
    $current_display = $this->row_plugin->view->display_handler->options['defaults']['fields'] ? 'default' : $this->row_plugin->view->current_display;
    $fields = $this->view->display[$current_display]->display_options['fields'];
    foreach ($fields as $key => $field) {
      $form[$field['id']] = array(
        '#type' => 'fieldset',
        '#title' => check_plain($field['field']),
        '#collapsible' => TRUE,
        '#collapsed' => TRUE,
        '#fieldset' => 'fields_settings',
      );
      $form[$field['id']]['data-in'] = array(
        '#type' => 'select',
        '#title' => t('data-in'),
        '#options' => array(
          'left' => t('left'),
          'fade' => t('fade'),
          'none' => t('none'),
          'right' => t('right'),
          'top' => t('top'),
          'bottom' => t('bottom'),
          'bottomLeft' => t('bottomLeft'),
          'bottomRight' => t('bottomRight'),
          'topLeft' => t('topLeft'),
          'topRight' => t('topRight'),
        ),
        '#default_value' => !empty($this->options[$field['id']]) ? $this->options[$field['id']]['data-in'] : '',
        '#description' => t('Type of the in-animation (default is left).'),
        '#fieldset' => $field['id'],
      );
      $form[$field['id']]['data-out'] = array(
        '#type' => 'select',
        '#title' => t('data-out'),
        '#options' => array(
          'fade' => t('fade'),
          'none' => t('none'),
          'left' => t('left'),
          'right' => t('right'),
          'top' => t('top'),
          'bottom' => t('bottom'),
          'bottomLeft' => t('bottomLeft'),
          'bottomRight' => t('bottomRight'),
          'topLeft' => t('topLeft'),
          'topRight' => t('topRight'),
        ),
        '#default_value' => !empty($this->options[$field['id']]) ? $this->options[$field['id']]['data-out'] : '',
        '#description' => t('Type of the out-animation (default is fade).'),
        '#fieldset' => $field['id'],
      );
      $form[$field['id']]['data-step'] = array(
        '#type' => 'select',
        '#title' => t('data-step'),
        '#options' => array(
          0 => t('0'),
          1 => t('1'),
          2 => t('2'),
          3 => t('3'),
          4 => t('4'),
          5 => t('5'),
          6 => t('6'),
          7 => t('7'),
          8 => t('8'),
          9 => t('9'),
        ),
        '#default_value' => !empty($this->options[$field['id']]) ? $this->options[$field['id']]['data-step'] : '',
        '#description' => t('You can group your elements in different steps. All animation of one step will start at the same time (maybe with your choosen element-specific data-delay). Elements of the next step will not start before the previous step is finished. If an element has no data-step attribute the plugin will thread it as having data-step=”0″.'),
        '#fieldset' => $field['id'],
      );
      $form[$field['id']]['data-ease-in'] = array(
        '#type' => 'select',
        '#title' => t('data-ease-in'),
        '#options' => array(
          '' => t('-None-'),
          'linear' => t('linear'),
          'swing' => t('swing'),
          'easeInQuad' => t('easeInQuad'),
          'easeOutQuad' => t('easeOutQuad'),
          'easeInOutQuad' => t('easeInOutQuad'),
          'easeInCubic' => t('easeInCubic'),
          'easeOutCubic' => t('easeOutCubic'),
          'easeInOutCubic' => t('easeInOutCubic'),
          'easeInQuart' => t('easeInQuart'),
          'easeOutQuart' => t('easeOutQuart'),
          'easeInOutQuart' => t('easeInOutQuart'),
          'easeInQuint' => t('easeInQuint'),
          'easeOutQuint' => t('easeOutQuint'),
          'easeInOutQuint' => t('easeInOutQuint'),
          'easeInExpo' => t('easeInExpo'),
          'easeOutExpo' => t('easeOutExpo'),
          'easeInOutExpo' => t('easeInOutExpo'),
          'easeInSine' => t('easeInSine'),
          'easeOutSine' => t('easeOutSine'),
          'easeInOutSine' => t('easeInOutSine'),
          'easeInCirc' => t('easeInCirc'),
          'easeOutCirc' => t('easeOutCirc'),
          'easeInOutCirc' => t('easeInOutCirc'),
          'easeInElastic' => t('easeInElastic'),
          'easeOutElastic' => t('easeOutElastic'),
          'easeInOutElastic' => t('easeInOutElastic'),
          'easeInBack' => t('easeInBack'),
          'easeOutBack' => t('easeOutBack'),
          'easeInOutBack' => t('easeInOutBack'),
          'easeInBounce' => t('easeInBounce'),
          'easeOutBounce' => t('easeOutBounce'),
          'easeInOutBounce' => t('easeInOutBounce'),
        ),
        '#default_value' => !empty($this->options[$field['id']]) ? $this->options[$field['id']]['data-ease-in'] : '',
        '#description' => t('easing for the animations (you can use all in jquery-ui contained <a target="_blank" href="http://jqueryui.com/effect/#easing">easing methods)</a>.'),
        '#fieldset' => $field['id'],
      );
      $form[$field['id']]['data-ease-out'] = array(
        '#type' => 'select',
        '#title' => t('data-ease-out'),
        '#options' => array(
          '' => t('-None-'),
          'linear' => t('linear'),
          'swing' => t('swing'),
          'easeInQuad' => t('easeInQuad'),
          'easeOutQuad' => t('easeOutQuad'),
          'easeInOutQuad' => t('easeInOutQuad'),
          'easeInCubic' => t('easeInCubic'),
          'easeOutCubic' => t('easeOutCubic'),
          'easeInOutCubic' => t('easeInOutCubic'),
          'easeInQuart' => t('easeInQuart'),
          'easeOutQuart' => t('easeOutQuart'),
          'easeInOutQuart' => t('easeInOutQuart'),
          'easeInQuint' => t('easeInQuint'),
          'easeOutQuint' => t('easeOutQuint'),
          'easeInOutQuint' => t('easeInOutQuint'),
          'easeInExpo' => t('easeInExpo'),
          'easeOutExpo' => t('easeOutExpo'),
          'easeInOutExpo' => t('easeInOutExpo'),
          'easeInSine' => t('easeInSine'),
          'easeOutSine' => t('easeOutSine'),
          'easeInOutSine' => t('easeInOutSine'),
          'easeInCirc' => t('easeInCirc'),
          'easeOutCirc' => t('easeOutCirc'),
          'easeInOutCirc' => t('easeInOutCirc'),
          'easeInElastic' => t('easeInElastic'),
          'easeOutElastic' => t('easeOutElastic'),
          'easeInOutElastic' => t('easeInOutElastic'),
          'easeInBack' => t('easeInBack'),
          'easeOutBack' => t('easeOutBack'),
          'easeInOutBack' => t('easeInOutBack'),
          'easeInBounce' => t('easeInBounce'),
          'easeOutBounce' => t('easeOutBounce'),
          'easeInOutBounce' => t('easeInOutBounce'),
        ),
        '#default_value' => !empty($this->options[$field['id']]) ? $this->options[$field['id']]['data-ease-out'] : '',
        '#description' => t('easing for the animations (you can use all in jquery-ui contained <a target="_blank" href="http://jqueryui.com/effect/#easing">easing methods)</a>.'),
        '#fieldset' => $field['id'],
      );
      $form[$field['id']]['data-time'] = array(
        '#title' => t('Data Time'),
        '#description' => t('Time after which the elements animation is complete. It will start at the beginning of the slide/step, or after its specificed delay. Default is 1000. Add 00 for none/instead of 0.'),
        '#type' => 'textfield',
        '#size' => '10',
        '#default_value' => !empty($this->options[$field['id']]) ? $this->options[$field['id']]['data-time'] : '1000',
        '#fieldset' => $field['id'],
      );
      $form[$field['id']]['space'] = array(
        '#title' => t('Field Spacing Top'),
        '#description' => t('The Space/Gap between fields while sliding. Similar padding-top. Default is 30. Add 00 for none/instead of 0.'),
        '#type' => 'textfield',
        '#size' => '10',
        '#default_value' => !empty($this->options[$field['id']]) ? $this->options[$field['id']]['space'] : '30',
        '#fieldset' => $field['id'],
      );
      $form[$field['id']]['lspace'] = array(
        '#title' => t('Field Spacing Left'),
        '#description' => t('The Space/Gap between fields while sliding. Similar padding-left. Default is 30. Add 00 for none/instead of 0.'),
        '#type' => 'textfield',
        '#size' => '10',
        '#default_value' => !empty($this->options[$field['id']]) ? $this->options[$field['id']]['lspace'] : '30',
        '#fieldset' => $field['id'],
      );
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ViewsFractionsliderStylePlugin::options_form public function Render the given style. Overrides views_plugin_style::options_form
ViewsFractionsliderStylePlugin::option_definition public function Set default options. Overrides views_plugin_style::option_definition
views_object::$definition public property Handler's definition.
views_object::$options public property Except for displays, options for the object will be held here. 1
views_object::altered_option_definition function Collect this handler's option definition and alter them, ready for use.
views_object::construct public function Views handlers use a special construct function. 4
views_object::export_option public function 1
views_object::export_options public function
views_object::export_option_always public function Always exports the option, regardless of the default value.
views_object::options Deprecated public function Set default options on this object. 1
views_object::set_default_options public function Set default options.
views_object::set_definition public function Let the handler know what its full definition is.
views_object::unpack_options public function Unpack options over our existing defaults, drilling down into arrays so that defaults don't get totally blown away.
views_object::unpack_translatable public function Unpack a single option definition.
views_object::unpack_translatables public function Unpacks each handler to store translatable texts.
views_object::_set_option_defaults public function
views_plugin::$display public property The current used views display.
views_plugin::$plugin_name public property The plugin name of this plugin, for example table or full.
views_plugin::$plugin_type public property The plugin type of this plugin, for example style or query.
views_plugin::$view public property The top object of a view. Overrides views_object::$view 1
views_plugin::additional_theme_functions public function Provide a list of additional theme functions for the theme info page.
views_plugin::options_submit public function Handle any special handling on the validate form. 9
views_plugin::plugin_title public function Return the human readable name of the display.
views_plugin::summary_title public function Returns the summary of the settings in the display. 8
views_plugin::theme_functions public function Provide a full list of possible theme templates used by this style.
views_plugin_style::$row_plugin public property The row plugin, if it's initialized and the style itself supports it.
views_plugin_style::$row_tokens public property Store all available tokens row rows.
views_plugin_style::build_sort public function Called by the view builder to see if this style handler wants to interfere with the sorts. If so it should build; if it returns any non-TRUE value, normal sorting will NOT be added to the query. 1
views_plugin_style::build_sort_post public function Called by the view builder to let the style build a second set of sorts that will come after any other sorts in the view. 1
views_plugin_style::destroy public function Destructor. Overrides views_object::destroy
views_plugin_style::even_empty public function Should the output of the style plugin be rendered even if it's empty. 1
views_plugin_style::get_field public function Get a rendered field.
views_plugin_style::get_field_value public function Get the raw field value.
views_plugin_style::get_row_class public function Return the token replaced row class for the specified row.
views_plugin_style::init public function Initialize a style plugin.
views_plugin_style::options_validate public function Validate the options form. Overrides views_plugin::options_validate
views_plugin_style::pre_render public function Allow the style to do stuff before each row is rendered.
views_plugin_style::query public function Add anything to the query that we might need to. Overrides views_plugin::query 2
views_plugin_style::render public function Render the display in this style. 5
views_plugin_style::render_fields public function Render all of the fields for a given style and store them on the object.
views_plugin_style::render_grouping public function Group records as needed for rendering.
views_plugin_style::render_grouping_sets public function Render the grouping sets.
views_plugin_style::tokenize_value public function Take a value and apply token replacement logic to it.
views_plugin_style::uses_fields public function Return TRUE if this style also uses fields.
views_plugin_style::uses_row_class public function Return TRUE if this style also uses a row plugin.
views_plugin_style::uses_row_plugin public function Return TRUE if this style also uses a row plugin.
views_plugin_style::uses_tokens public function Return TRUE if this style uses tokens.
views_plugin_style::validate public function Validate that the plugin is correct and can be saved. Overrides views_plugin::validate