You are here

class mediafront_plugin_style_player in MediaFront 6

Same name and namespace in other branches
  1. 6.2 views/mediafront_plugin_style_player.inc \mediafront_plugin_style_player
  2. 7.2 views/mediafront_plugin_style_player.inc \mediafront_plugin_style_player
  3. 7 views/mediafront_plugin_style_player.inc \mediafront_plugin_style_player

@class Extension of the Views Plugin Syle for the Media Player from MediaFront

This class extended the default views plugin class to provide a style plugin for the MediaFront module.

Hierarchy

Expanded class hierarchy of mediafront_plugin_style_player

2 string references to 'mediafront_plugin_style_player'
mediafront_views_plugins in views/mediafront.views.inc
Implementation of hook_views_plugins
mediafront_views_query_alter in ./mediafront.module
Implements hook_views_query_alter().

File

views/mediafront_plugin_style_player.inc, line 17
This file holds style plugin for MediaFront Views

View source
class mediafront_plugin_style_player extends views_plugin_style {

  /**
   * Set the default options.
   */
  function option_definition() {
    $options = parent::option_definition();
    $options['mediafront_preset'] = array(
      'default' => '',
    );
    return $options;
  }

  /**
   * Shows the options form for the media player style
   */
  function options_form(&$form, &$form_state) {
    parent::options_form($form, $form_state);
    $form['mediafront_preset'] = mediafront_preset_select_form($this->options);
  }

  /**
   * Override the query to tell our view to get the total number of rows.
   */
  function query() {
    parent::query();
    $this->view->get_total_rows = TRUE;
  }

  /**
   * Renders the media player.
   */
  function render() {
    $output = '';

    // Check for live preview.
    if (!empty($this->view->live_preview)) {
      return t('MediaFront views are not compatible with live preview.');
    }

    // Now render the media player for this view.
    return theme($this
      ->theme_functions(), $this->view, $this->options['mediafront_preset']);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
mediafront_plugin_style_player::options_form function Shows the options form for the media player style
mediafront_plugin_style_player::option_definition function Set the default options.
mediafront_plugin_style_player::query function Override the query to tell our view to get the total number of rows.
mediafront_plugin_style_player::render function Renders the media player.