function web_widgets_render_widget in Web Widgets 7
Same name and namespace in other branches
- 6 web_widgets.module \web_widgets_render_widget()
Renders a given content as a widget. This function returns the actual content of a widget wrapped in style specific markup.
Warning: you cannot use all styles. Exception is: uwa
Parameters
$style: One of the widget styles returned by widgets_get_styles().
$content: Content to render as widget.
$add_target: If TRUE, the anchors tags will be modified so they will open in new window.
Return value
HTML wrapped in style specific markup.
1 call to web_widgets_render_widget()
- web_widgets_plugin_display_web_widgets::render in views/
web_widgets_plugin_display_web_widgets.inc - Instead of going through the standard views_view.tpl.php, delegate this to the style handler.
File
- ./
web_widgets.module, line 100 - web_widgets module main. Contains the views api hook and theming functions.
Code
function web_widgets_render_widget($style, $content, $title, $add_target = TRUE, $scripts = array(), $styles = array()) {
require_once DRUPAL_ROOT . '/' . web_widgets_get_style_inc($style);
if ($add_target === TRUE) {
$content = _web_widgets_rewrite_anchors($content);
}
module_invoke_all('web_widgets_render_widget', $content, $title);
return theme('web_widgets_' . $style . '_wrapper', array(
'content' => $content,
'title' => $title,
'scripts' => $scripts,
'styles' => $styles,
));
}