You are here

function rate_panels_rate_widget_render in Rate 7

1 string reference to 'rate_panels_rate_widget_render'
rate_widget.inc in plugins/content_types/rate_widget.inc

File

plugins/content_types/rate_widget.inc, line 59

Code

function rate_panels_rate_widget_render($subtype, $conf, $panel_args, $context) {
  if (empty($context) || empty($context->data)) {
    return;
  }

  // Get a shortcut to the node.
  $node = $context->data;

  // Load information about the node type.
  $type = node_type_get_type($node);
  $widget_code = array(
    '#markup' => rate_generate_widget($conf['widget_name'], 'node', $node->nid, $conf['build_mode']),
  );

  // Build the content type block.
  $block = new stdClass();
  $block->module = 'rate_extras';
  $block->title = $type->title_label;
  $block->content = $widget_code;
  $block->delta = $node->nid;
  return $block;
}