You are here

function web_widgets_plugin_display_web_widgets::render in Web Widgets 7

Same name and namespace in other branches
  1. 6 views/web_widgets_plugin_display_web_widgets.inc \web_widgets_plugin_display_web_widgets::render()

Instead of going through the standard views_view.tpl.php, delegate this to the style handler.

Overrides views_plugin_display::render

File

views/web_widgets_plugin_display_web_widgets.inc, line 44
Implementation of widget display.

Class

web_widgets_plugin_display_web_widgets
The plugin that handles a feed, such as RSS or atom.

Code

function render() {

  // Ensure that the embed style functions are available
  $current_style = $this
    ->get_option('embed_style');
  $current_style = empty($current_style) ? 'iframe' : $current_style;
  require_once DRUPAL_ROOT . '/' . web_widgets_get_style_inc($current_style);

  // See if the render() function is "overloaded" or not
  web_widgets_inside_widget(TRUE);
  $render_func = 'web_widgets_' . $current_style . '_render';
  if (function_exists($render_func)) {
    $output = $render_func($this);
  }
  else {

    // Fallback to default way
    // TODO Please change this theme call to use an associative array for the $variables parameter.
    $content = theme($this
      ->theme_functions(), array(
      'view' => $this->view,
    ));
    $code = '';
    $track = $this
      ->get_option('track');
    if (!empty($track)) {

      // TODO Please change this theme call to use an associative array for the $variables parameter.
      $code = theme('web_widgets_tracking_code', $track);
    }
    $title = $this->view
      ->get_title();
    $output = web_widgets_render_widget($current_style, $code . $content, $title);
  }
  web_widgets_inside_widget(FALSE);
  return $output;
}