You are here

function web_widgets_render_embed_code in Web Widgets 7

Same name and namespace in other branches
  1. 6 web_widgets.module \web_widgets_render_embed_code()

Renders the embed code for a given widget style.

Parameters

$style: One of the widget styles returned by widgets_get_styles().

$path: Path that returns a widget.

$width: Width of the widget (not respected by all styles).

$height: Height of the widget (not respected by all styles).

Return value

HTML that displays the widget embed code.

1 call to web_widgets_render_embed_code()
web_widgets_plugin_display_web_widgets::attach_to in views/web_widgets_plugin_display_web_widgets.inc
Attach to another view.

File

./web_widgets.module, line 76
web_widgets module main. Contains the views api hook and theming functions.

Code

function web_widgets_render_embed_code($style, $variables) {
  require_once DRUPAL_ROOT . '/' . web_widgets_get_style_inc($style);

  // TODO Please change this theme call to use an associative array for the $variables parameter.
  $code = theme('web_widgets_' . $style, $variables);

  // TODO Please change this theme call to use an associative array for the $variables parameter.
  return theme('web_widgets_embed_code', array(
    'code' => $code,
    'style' => $style,
  ));
}